cancel
Showing results for 
Search instead for 
Did you mean: 

Any way to use an attribute "xml:lang" in XI ?

arunneerolil
Contributor
0 Kudos

Hi,

We imported one XSD to XI which contains an attribute

as shown below

<b>xml:lang</b>

After importing the XSD into XI, the name got changed automatically to "lang". Output we are getting as

example:

<cXML version="1.2.008" <b>lang</b>="en-GB">

Now our XI is SP15.

Before upgradation(SP9)

It was coming as it is in the XSD.

Example: <cXML version="1.2.008" <b>xml:lang</b>="en-GB">

Why "xml:lang" attribute not coming in SP15?

Can anyone help.

Thanks in Advance

Regards

Chemmanz

Message was edited by: Chemmanz

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chemmanz,

There is a type "xsd:language" and not xsd:lang...

We are on sp14...it should be similar on SP15...

Thanks,

Renjith

arunneerolil
Contributor
0 Kudos

Hi Renjith,

To be simple.

While using SP9 our output was

<cXML version="1.2.008" <b>xml:lang</b>="en-GB">

After upgrading to SP15 it is coming as

<cXML version="1.2.008" <b>lang</b>="en-GB">

I want attribute name back as "xml:lang" .

Regards

Chemmanz

Message was edited by: Chemmanz

arunneerolil
Contributor
0 Kudos

Hi all,

Any way to create an attribute like xml:lang in XI?

When I import the following DTD

<?xml version="1.0"?>

<!ELEMENT note (to,from,heading,body)>

<!ELEMENT to (#PCDATA)>

<!ELEMENT from (#PCDATA)>

<!ELEMENT heading (#PCDATA)>

<!ELEMENT body (#PCDATA)>

<!ATTLIST note xml:lang CDATA #REQUIRED>

XI is automatically renaming attribute "xml:lang" to

"lang".

Any way to prevent this??

Can anyone help.

Thanks in Advance.

Chemmanz

Former Member
0 Kudos

Hi Chemmanz,

I also imported that DTD as External Definition into an SP15 repository. When I looked at the WSDL generated for that External Definition I could indeed see the declaration <xsd:attribute ref="lang" />.

Please note that at this location the default namespace has been set to http://www.w3.org/XML/1998/namespace. Hence, according to the XSD rules this reference goes to attribute lang in that namespace.

This is indeed some strange way of expressing it, as (according to the namespace specification) that namespace is automatically bound to the prefix xml. Hence it is uncommon to define it as default namespace in addition. Anyway, though uncommon it is correct.

Moreover, I imported the External Message derived from that External Definition into a Message Mapping (as source and target message) and defined the identity mapping.

When I tested this identity mapping the attribute 'lang' was handled correctly. Indeed, in this case it was made use of the automatically existing prefix 'xml' and no default namespace was declared.

Thus, I can not see what your problem really is. Maybe you can define it in more details.

Greetings

Stephan

arunneerolil
Contributor
0 Kudos

Hi Stephan,

Thanks for your reply.

When I uploaded the above DTD I got WSDL, it was not showing any root node.

So I edited the WSDL by adding (bolded lines)

</wsdl:types>

<b><wsdl:message name="note">

<wsdl:part name="note" element="note" />

</wsdl:message></b>

</wsdl:definitions>

to make "note" as the root node.

I did an identity message mapping and got result as shown below

<?xml version="1.0" encoding="UTF-8"?>

<note <b>lang="en-GB"</b>>

<to>James</to>

<from>Tom</from>

<heading>Hello</heading>

<body>Nothing Special</body>

</note>

Again here you can see only "lang" is coming in output not "xml:lang".

Regards

Chemmanz

Former Member
0 Kudos

Hi Chemmanz,

Can you post the whole final wsdl that you have as input for the message mapping?

Best regards

Dmitry Yankovsky

arunneerolil
Contributor
0 Kudos

Hi Dmitry,

Final WSDL I used for message mapping

======================================

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/XML/1998/namespace">

<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />

<xsd:element name="note" type="note" />

<xsd:complexType name="note">

<xsd:sequence>

<xsd:element name="to" type="xsd:string" />

<xsd:element name="from" type="xsd:string" />

<xsd:element name="heading" type="xsd:string" />

<xsd:element name="body" type="xsd:string" />

</xsd:sequence>

<xsd:attribute ref="lang" />

</xsd:complexType>

</xsd:schema>

</wsdl:types>

<wsdl:message name="note">

<wsdl:part name="note" element="note" />

</wsdl:message>

</wsdl:definitions>

Regards

Chemmanz

Former Member
0 Kudos

Hi Chemmanz

I can reproduce it now.

The problem is not yet clear for me.

You can manually change your wsdl this way

 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.w3.org/XML/1998/namespace">
....
<xsd:attribute ref="ns0:lang" />

And it works.

Your way is also correct but it doesn't work.

It needs some time to find out the problem.

Best regards

Dmitry

Former Member
0 Kudos

Hi Chemmanz,

one additional remark to Dmitry's note.

I think the reason why you had to add the message manually was, that you used 'From the DOCTYPE' instead of 'From the First ELEMENT' in the 'Messages'-field in the External Definition.

Anyway the namespace-handling issue is strange and will be investigated.

Greetings

Stephan

arunneerolil
Contributor
0 Kudos

Hi Dmitry,

Please send me the changed WSDL.

Regards

Chemmanz

arunneerolil
Contributor
0 Kudos

Hi Stephan,

Yes, the problem was what you mentioned.

I choose the option

"From the First ELEMENT" and now things are fine.

Thanks a lot

Chemmanz

Former Member
0 Kudos

Hi

You only need to change the lines I wrote


<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.w3.org/XML/1998/namespace"><xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
<xsd:element name="note" type="note" />
<xsd:complexType name="note">
<xsd:sequence>
<xsd:element name="to" type="xsd:string" />
<xsd:element name="from" type="xsd:string" />
<xsd:element name="heading" type="xsd:string" />
<xsd:element name="body" type="xsd:string" />
</xsd:sequence>
<xsd:attribute ref="ns0:lang" />
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="note">
<wsdl:part name="note" element="note" />
</wsdl:message>
</wsdl:definitions>

Former Member
0 Kudos

Hi Chemmanz,

just to make the story complete:

The problem is with the WSDL which is incorrect (in both cases 'form first ELEMENT' and 'from DOCTYPE'). Fortunately, the WSDL is generated correctly internally. But there is an error when rendering it for display.

Hence, everything works fine when you use the External Definition as is (although the displayed WSDL is incorrect). But when you download the displayed WSDL and modify it (without correcting the error) and upload this WSDL as another External Definition, then the error gets productive.

The display error will be corrected in one of the next SPs.

Greetings

Stephan

Answers (0)