views:

963

answers:

5

Hi,

I need to add a "xml:lang" attribute on the root xml node in the outbound doument from Biztalk. This is a fixed value, so it may be set in the schema or something.

This is what I want to get out:

<Catalog xml:lang="NB-NO">
...
</Catalog>

I've tried to define the attribute "xml:lang", but it doesn't allow me to use ":" in the schema.

This is the error message I get:

Invalid 'name' attribute value 'xml:lang': The ':' character, hexadecimal value 0x3A, at position 3 within the name, cannot be included in a name.

Is there another way to insert a ':' as part of the attribute name in Biztalk?

Can anyone tell me how to do this?

I'm using Biztalk 2006 and no orchestartion.


Regards

JimboMan

+1  A: 

Try to add the xml namespace declaration to the schema

xmlns:xml="http://www.w3.org/XML/1998/namespace"

Beware that this addition will be removed when the schema file is recreated.

Tomalak
A: 

Thanks Tomalak.

Some following up question:
How do I add the xml namespace declaration to the schema in Biztalk Schema Editor?
Or must I add it directly in the xsd file?

Regards
JimboMan

You will need to do that in an external editor. Somewhat lame, I know.
Tomalak
A: 

Hi,

I really can't figure out how to solve this issue. I also need the namespace "xmlns:xsi" in addition to the "xml:lang".

This is the outbound xml i would like to end up with:

<Catalog xml:lang="NB-NO" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    <Articles>
     ...
    </Articles>
</Catalog>

Hopefylly I can solve this in a way to avoid the addittion to be removed when schema is modified (within Biztalk Schema Editor). I not very experienced with BizTalk Schema editor and namespaces, so I appreciate all response!

Please help!

regards JimboMan

A: 

Can anyone help me with this?

A: 

In your schema, in the definition of the type for Catalog, you should have

<xsd:attribute ref="xml:lang" fixed="NB-NO"/>