Here's an XML snippet:
<ORDER>
<ORDER_LINE>
<ORDER_NOTE>
...
</ORDER_NOTE>
<PeopleSoftMessage>
...
...
</PeopleSoftMessage>
<ORDER_NOTE>
...
...
</ORDER_NOTE>
<PeopleSoftMessage>
...
...
</PeopleSoftMessage>
<ORDER_SomethingElse>
...
</ORDER_SomethingElse>
<PeopleSoftMessage>
...
</PeopleSoftMessage>
<ORDER_LINE>
</PeopleSoftMessage>
<ORDER>
</PeopleSoftMessage>
Effectively there's a <PeopleSoftMessage> tag after every record. The
records themselves may be optional, which would imply that the PeopleSoft
message isn't required as well. The PeopleSoftMessage is exactly the same
throughout.
What I have been able to do it get a schema to validate the legacy files.
However I'm not sure it's the proper way to go, since I have been unable to
properly map the results I'm looking for. This schema is in the destation
part of the map.
I've created a schema which has a sequence group under the ORDER_LINE
record. Within the sequence group, I've created a Choice group and the
PeopleSoftMessage record at the same level (siblings). Within the Choice
Group I've placed the ORDER_NOTE and ORDER_SomethingElse records.
It looks like this:
<ORDER>
<ORDER_LINE>
<Sequence>
<Choice>
. (elements)
.
.
<ORDER_NOTE> (Choice record)
<ORDER_SomethingElse> (Choice record)
<PeopleSoftMessage> (Sequence Record)
I'm able to properly get output for records that aren't optional/choice, so
I don't see that part as an issue.
I've set the Max Occurs for Sequence set to unbounded, Choice is set to 1.
So what I'm trying to convey is "for each record/choice, make sure you have a
sibling PeopleSoftMessage tag 'attached' to it." This piece, in particular,
is where my difficulty lies.
I hope I've set the scenario well enough to get to the map. The source
schema is an inbound EDI 850 purchase order. The first part is that I need
to loop on all N1Loop segments. The N1 segment is tied to the ORDER_NOTE
destination. I also have to loop on the PO1Loop, which would be tied to the
SomethingElse part.
I realize I'm being lengthy about this, I want to make sure this is
explained well enough.
ANY help/suggestions would be so greatly appreciated!
However, BizTalk 2006 R2 does tackle this partly by introducing a new
attribute in the <mapsource> element of the map. Check out this article
http://msdn.microsoft.com/en-us/library/aa561485.aspx, the section titled
"Preserving the Order When Mapping a Repeating Sequence Group ".
Cheers.
McGeeky
"Bruce" <Br...@discussions.microsoft.com> wrote in message
news:1B540121-5416-4E32...@microsoft.com...
In the end I wrote an external c# component to forcibly add the neccessary
tags. Thanks to all who actively share their BizTalk thoughts and ideas.
Bruce
>I did see a post by eliasen (his posts has helped me in so many ways) dealing
>with adding a node to the output of a BizTalk map
>(http://blog.eliasen.dk/2006/10/13/AddingANodeToTheOutputOfABizTalkMap.aspx).
Glad my posts are usefull :-)
--
eliasen, representing himself and not the company he works for.
Private blog: http://blog.eliasen.dk
Private email: j...@eliasen.dk