Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Forcing the sequence of Output Tags
- This topic has 2 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
October 15, 2009 at 9:24 AM #23465
Currently I have a problem forcing my output tags to be in sequence since my partner’s schema does not have the tags under a parent repeating loop. I am at a loss as to how to accomplish my desired output using BizTalk Mapper 2006 R2.
I have tried many many combinations of looping, I have tried modifying my partner’s schema and put the two tags under a sequence group (which did not work), table looping, etc. Nothing I do seems to work.
Please help.
Source doc
<Lines>
<LineItem>
<LineNumber>1</LineNumber>
<LineNotes>TestLineNote1</LineNotes>
</LineItem>
<LineItem>
<LineNumber>2</LineNumber>
<LineNotes>TestLineNote2</LineNotes>
</LineItem>
</Lines>
Desired output
<OrderInfo> (min1,max1)
<ProductInfo>
<LineNumber>1</LineNumber>
</ProductInfo>
<CommentLine>
<CommentText>TestLineNote1</CommentText>
</CommentLine>
<ProductInfo>
<LineNumber>2</LineNumber>
</ProductInfo>
<CommentLine>
<CommentText>TestLineNote2</CommentText>
</CommentLine>
</OrderInfo>
Current Output
<OrderInfo>
<ProductInfo>
<LineNumber>1</LineNumber>
</ProductInfo>
<ProductInfo>
<LineNumber>2</LineNumber>
</ProductInfo>
<CommentLine>
<CommentText>TestLineNote1</CommentText>
</CommentLine>
<CommentLine>
<CommentText>TestLineNote2</CommentText>
</CommentLine>
</OrderInfo>
Thanks
mike
-
October 16, 2009 at 2:38 PM #23473
Hi Mike,
Your target schema should be something like this:
<?xml version=”1.0″ encoding=”utf-16″ ?>
<xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003” xmlns=”http://Test_Project.Schema2” targetNamespace=”http://Test_Project.Schema2” xmlns:xs=”http://www.w3.org/2001/XMLSchema“>
<xs:element name=”OrderInfo”>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs=”1″ maxOccurs=”unbounded” name=”SeqNode”>
<xs:complexType>
<xs:sequence>
<xs:element name=”ProductInfo”>
<xs:complexType>
<xs:sequence>
<xs:element name=”LineNumber” type=”xs:string” />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=”CommentLine”>
<xs:complexType>
<xs:sequence>
<xs:element name=”CommentText” type=”xs:string” />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>Then, in your map, link the element fields in your source schema to the element fields in the destination schema, put a Looping functoid in the map, and connect the left-hand side to the Lines node in your source schema, and connect the right-hand side to the SeqNode node in the destination schema, and you should be all set…
Daniel.
-
October 19, 2009 at 6:32 AM #23477
Daniel,
Thanks for the response. I actually played with adding in a SeqNode type Record, and stripping it out in a pipeline component. I have to strip it out, as the destination is not my schema. I did not care for this, as I was actually modifying their provided schema, I wanted to have BT confirm to their requirements.
Then on another forum some guys had me try some xslt in a Scripting Functiod within my map. Here is a link to what I have been playing with over the last few days trying to tweak it to get the correct sequence of notes.
I appreciate the input.
mike
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.