Answered by:
Duplicate node name in schema

Question
-
Hello,
I am supposed to write transformation map, to map one XML file to another one. I am obliged to use Biztalk Server 2002.
The problem is, that my source XML file has some elements that have exactly same name. Something like this:
<root>
<special.code>
<code.id>12</code.id>
<date.start>20090101</date.start>
<date.end>20100101</date.end>
<special.code>QQQ999</special.code>
<useCode>0</useCode>
</special.code>
...
</root>
The problem is within the element "special.code". When I try to make a document specification in biztalk, for the second "nested" element <special.code>, the Biztalk reports an error message, that there is already an element with that name.
So it gives me 2 options:
1. Create cycle element - that would not correspond to the reality
2. Rename element - that is not an option, because I can`t change the schema.
How can I solve this, please?
Thank you
FerdolyzerTuesday, April 21, 2009 8:07 PM
Answers
-
Hi
I am afraid that you don't solve that. In BizTalk 2002, Microsoft used XDR (Xml Data Reduced) schemas instead of XSDs. This is simply a limitation of the XDR format.
The only way I can think of right now (there might be other ways around it - BizTalk 2002 isn't all that fresh in memory :-) ) is to write a preprocessor that will read in the XML and change the node name of one of them. Then let your schema relect this other node name.
eliasen, representing himself and not the company he works for.
MVP and three times MCTS in BizTalk.
Blog: http://blog.eliasen.dk- Proposed as answer by Leonid GanelineModerator Tuesday, April 21, 2009 10:40 PM
- Marked as answer by Ferdolyzer Wednesday, April 22, 2009 6:07 AM
Tuesday, April 21, 2009 8:18 PM -
Actually, I would just load the XML into an XmlDocument and do stuff without XSLT. And for preprocesors you are limited to .NET 1.1 bye the way :-/
Maybe I would use an XmlReader and an XmlWriter.
eliasen, representing himself and not the company he works for.
MVP and three times MCTS in BizTalk.
Blog: http://blog.eliasen.dk- Marked as answer by Ferdolyzer Wednesday, April 22, 2009 6:07 AM
Tuesday, April 21, 2009 10:46 PM
All replies
-
Hi
I am afraid that you don't solve that. In BizTalk 2002, Microsoft used XDR (Xml Data Reduced) schemas instead of XSDs. This is simply a limitation of the XDR format.
The only way I can think of right now (there might be other ways around it - BizTalk 2002 isn't all that fresh in memory :-) ) is to write a preprocessor that will read in the XML and change the node name of one of them. Then let your schema relect this other node name.
eliasen, representing himself and not the company he works for.
MVP and three times MCTS in BizTalk.
Blog: http://blog.eliasen.dk- Proposed as answer by Leonid GanelineModerator Tuesday, April 21, 2009 10:40 PM
- Marked as answer by Ferdolyzer Wednesday, April 22, 2009 6:07 AM
Tuesday, April 21, 2009 8:18 PM -
You can try the same way as Jan proposed with the preprocessor.
But this preprocessor would make the whole transformation with XslTransform (and using xsd schema inside).
Leonid Ganeline [BizTalk MVP] http://geekswithblogs.net/leonidganelineTuesday, April 21, 2009 10:42 PMModerator -
Actually, I would just load the XML into an XmlDocument and do stuff without XSLT. And for preprocesors you are limited to .NET 1.1 bye the way :-/
Maybe I would use an XmlReader and an XmlWriter.
eliasen, representing himself and not the company he works for.
MVP and three times MCTS in BizTalk.
Blog: http://blog.eliasen.dk- Marked as answer by Ferdolyzer Wednesday, April 22, 2009 6:07 AM
Tuesday, April 21, 2009 10:46 PM -
Thank you eliasen,XmlReader/Writer was one of my options, but i wanted to avoid coding as much as possible. We have som solution that is already in production, but the schema change appeared, and now i need to recreate it from the base :).Basically, doing this, i don`t really need to implement biztalk.Maybe I can persuade our business head`s to use Biztalk 2006 :)Thanks once again.Wednesday, April 22, 2009 6:11 AM
-
Quick note: BizTalk 2009 is already available, so go with that instead of 2006 :-)
eliasen, representing himself and not the company he works for.
MVP and three times MCTS in BizTalk.
Blog: http://blog.eliasen.dkWednesday, April 22, 2009 7:31 AM