cancel
Showing results for 
Search instead for 
Did you mean: 

ns0 prefix not attached in the xml structure generated using Content Master

Former Member
0 Kudos

Hello Everyone,

I am parsing a tabdelimited file using the Content Master Studio.

I am providing the message type xsd as the schema file.

After writing all the parsing logic the xml file which is getting generated is in the below mentioned format

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

<ReadExcel xmlns="urn:readexcel.com">

<ROW>

<NAME>Rahul</NAME>

<AGE>24</AGE>

<Location>Mumbai</Location>

</ROW>

<ROW>

<NAME>Vinit</NAME>

<AGE>25</AGE>

<Location>Mumbai</Location>

</ROW>

</ReadExcel>

but since the ns0 prefix is not getting attached the mapping program is failing in XI.

<ns0:ReadExcel xmlns:ns0="urn:readexcel.com">

I guess the people who have used Content master studio might have also faced the similar problem.

Please suggest me some solution

Thanks and Regards

Rahul Nawale

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rahul,

the namespace prefic ns0 is only a placeholder for the namespace urn:readexcel.com. This namespace can also be represented by another prefix or even by the empty prefix.

E.g. the document you have pasted is totally equivalent to the document

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

<ns0:ReadExcel xmlns:ns0="urn:readexcel.com">

<ns0:ROW>

<ns0:NAME>Rahul</ns0:NAME>

<ns0:AGE>24</ns0:AGE>

<ns0:Location>Mumbai</ns0:Location>

</ns0:ROW>

<ns0:ROW>

<ns0:NAME>Vinit</ns0:NAME>

<ns0:AGE>25</ns0:AGE>

<ns0:Location>Mumbai</ns0:Location>

</ns0:ROW>

</ns0:ReadExcel>

However, it is not possible to model this document via a Message type in the Integration Repository. The XML instance from a Message type will look like this:

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

<ns0:ReadExcel xmlns:ns0="urn:readexcel.com">

<ROW>

<NAME>Rahul</NAME>

<AGE>24</AGE>

<Location>Mumbai</Location>

</ROW>

<ROW>

<NAME>Vinit</NAME>

<AGE>25</AGE>

<Location>Mumbai</Location>

</ROW>

</ns0:ReadExcel>

Indeed, in the root tag all documents are equivalent (it has name ReadExcel and namespace urn:readexcel.com). But for the subelements (ROW, NAME,...) there is a fundemental difference. In your example (and my first example) these elements have namespace urn:readexcel.com, too. In my second example those elements have empty namespace. Indeed, all XML documents modelled as Message types have an empty namespace for all non-root elements.

Message types are simply not suitable to model a document as you have posted. However, there is simple help. Just download the schema for the Message type to your local file system. Add attribute elementFormDefault="qualified" to the root tag of that schema. Upload that schema as External Definition. This External Definition will have one External Message. Define your mapping using that schema.

For more background on that topic I recommend reading the specifications on XML namespaces and XML schema.

Greetings

Stephan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rahul,

try

http://www.list-editor.de/JAVASCRIPTS/JAVASCRIPTS/CSV2XSD-EDITOR%20%ad%20Mario%20Mueller.htm

<a href="http://www.list-editor.de/JAVASCRIPTS/JAVASCRIPTS/CSV2XSD-EDITOR%20%ad%20Mario%20Mueller.htm">XI Tool convert CSV to XSD</a>

Unfortunatey the language is german.

Regards Mario