Node order after mapping
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Node order after mapping




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Node order after mapping  
MCE


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-05-05 01:48 AM

Hi folks,

I have a source schema with repeating nodes which I am mapping to an
output schema.  I require that the output XML has it's nodes in the
same order as the corresponding incoming nodes but the output nodes
always end up grouped together, eg.

Incoming XML

<InputNode1/>
<InputNode2/>
<InputNode1/>
<InputNode2/>

Output XML

<OutputNode1/>
<OutputNode1/>
<OutputNode2/>
<OutputNode2/>

whereas I require

<OutputNode1/>
<OutputNode2/>
<OutputNode1/>
<OutputNode2/>

I've tried with and without a looping functoid, using and not using a
sequence node in both the source and output schema but nothing I do
has worked.  If anyone has any ideas I would appreciate the help.
Thankyou.






[ Post a follow-up to this message ]



    re:Node order after mapping  
MCE


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-06-05 01:51 AM

Is anybody able to help me out here?  Even if I could just be pointed
towards some relevant documentation I would appreciate it.






[ Post a follow-up to this message ]



    RE: Node order after mapping  
Samuel L


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-06-05 07:52 AM

Hi MCE!

Could you please provide with a more detailed description of your scenarrio?
That would be helpful in trying to help you.

What I want to know is some details about your schemas.
Are the input nodes (InputNode1 & InputNode2) of the same type in some
records? Could there be erbitrary many of those?

Please descibe your problem scenario a bit further and I will try to help yo
u!

// Samuel L






[ Post a follow-up to this message ]



    Re: Node order after mapping  
Pabba


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-06-05 10:54 PM

Do you have OutputNode1 & OutputNode2 grouped under a parent node in
the target schema? If no, send me the whole source & target schema's.
If yes, this grouping should be of <sequence> type that enables the
schema to present the output xml nodes in a group sequential format
provided a Looping funtoid is linked between the source <parentNode>
and target <ParentNode>, that results in output similar to:

<ParentNode> [which is of sequence type in the target schema]
<OutputNode1>
<OutputNode2>
</ParentNode>
<ParentNode>
<OutputNode1>
<OutputNode2>
</ParentNode>

Let me know if this helps, else I can provide you a sample.

Regards,
Kiran Pabba






[ Post a follow-up to this message ]



    re:Node order after mapping  
MCE


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-13-05 12:54 PM

Thankyou for your replies Samuel L and Pabba.  I apologise that it has
taken me a week to respond but some other production issues came up
that required my urgent attention.

My incoming XML will look like this:

<RequestTest
SendingApplication=""
SendingFacility=""
..more attributes...
AccountID=""
>
<OrderCommon
OrderControl=""
..further attributes...
/>
<ObservationRequest
TestOrdered=""
..further attributes...
/>
<OrderCommon
OrderControl=""
..further attributes...
/>
<ObservationRequest
TestOrdered=""
..further attributes...
/>
..more OrderCommon and ObservationRequest elements as required...
</RequestTest>


The output XML, which is provided by the HL7 Accelerator, looks like
this:

<ORM_O01_231_GLO_DEF>
<PID_PatientIdentificationSegment>
..a number of elements...
</PID_PatientIdentificationSegment>
<PV1_PatientVisitSegment>
..a number of elements...
</PV1_PatientVisitSegment>
<GT1_GuarantorSegment>
..a number of elements...
</GT1_GuarantorSegment>
<BLG_BillingSegment>
..a number of elements...
</BLG_BillingSegment>
<Sequence>
<ORC_CommonOrderSegment>
..a number of elements...
</ORC_CommonOrderSegment>
<OBR_ObservationRequestSegment>
..a number of elements...
</OBR_ObservationRequestSegment>
<ORC_CommonOrderSegment>
..a number of elements...
</ORC_CommonOrderSegment>
<OBR_ObservationRequestSegment>
..a number of elements...
</OBR_ObservationRequestSegment>
..further ORC and OBR nodes corresponding to incoming message...
</Sequence>
</ORM_O01_231_GLO_DEF>

The attributes under the RequestTest node map to elements in the PID,
PV1, GT1 and BLG nodes.  There is no problem with this part of the
mapping.  The problem comes when trying to map the ORC and OBR
sections.  In the ouput they are required to be in the order of

ORC
OBR
ORC
OBR
etc.

corresponding to the incoming XML.  However, no matter what I try they
come out as

ORC
ORC
OBR
OBR

They cannot be under a parent node in the output XML as this would not
allow them to be serialised to HL7.  I thought the sequence node was
supposed to force elements to be in a certain order but this has not
worked.  I'm quite happy to change my incoming XML if necessary.






[ Post a follow-up to this message ]



    re:Node order after mapping  
Samuel L


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-13-05 12:54 PM

MCE... You're right about that it is a hard part to get the desired order 1 
2
1 2 instead of 1 1 2 2... It seems impossible to me using the BizTalk mapper
!

On the other hand, this can be done using some custom XSLT.
The good: You can solve the problem
The bad: You have to make all mappings by writing code

I don't know how familiar you are with XSLT, so I will start by just giving
you a brief description. Then feel free to ask if you have any questions!

1) Insert a scripting functoid in the BizTalk mapper.
2) Connect it to the root node of the destination and modify this code so
that it fits your exact schemas:
-------------------------------------------------------
// first the main template which is applied to whole source doc
<xsl:template name="MyXsltTemplate">
<ORM_O01_231_GLO_DEF>
<xsl:for-each select="/child::*/child::*">
<xsl:apply-templates select="current()" />
</xsl:for-each>
</ORM_O01_231_GLO_DEF>
</xsl:template>

// then one template for the ORC's
<xsl:template match="OrderCommon">
<ORC_CommonOrderSegment>
..a number of elements...
</ORC_CommonOrderSegment>
</xsl:template>


// and at last one template for the OBR's
<xsl:template match="ObservationRequest">
<OBR_ObservationRequestSegment>
..a number of elements...
</OBR_ObservationRequestSegment>
</xsl:template>
-------------------------------------------------------

Hope this helps you in some way!

Good luck and please let me know if you have any strugglings.


"MCE" wrote:

> Thankyou for your replies Samuel L and Pabba.  I apologise that it has
> taken me a week to respond but some other production issues came up
> that required my urgent attention.
>
> My incoming XML will look like this:
>
> <RequestTest
>     SendingApplication=""
>     SendingFacility=""
>     ...more attributes...
>     AccountID="" 
>   <OrderCommon
>       OrderControl=""
>       ...further attributes...
>   />
>   <ObservationRequest
>       TestOrdered=""
>       ...further attributes...
>   />
>   <OrderCommon
>       OrderControl=""
>       ...further attributes...
>   />
>   <ObservationRequest
>       TestOrdered=""
>       ...further attributes...
>   />
>   ...more OrderCommon and ObservationRequest elements as required...
> </RequestTest>
>
>
> The output XML, which is provided by the HL7 Accelerator, looks like
> this:
>
> <ORM_O01_231_GLO_DEF>
>   <PID_PatientIdentificationSegment>
>     ...a number of elements...
>   </PID_PatientIdentificationSegment>
>   <PV1_PatientVisitSegment>
>     ...a number of elements...
>   </PV1_PatientVisitSegment>
>   <GT1_GuarantorSegment>
>     ...a number of elements...
>   </GT1_GuarantorSegment>
>   <BLG_BillingSegment>
>     ...a number of elements...
>   </BLG_BillingSegment>
>   <Sequence>
>     <ORC_CommonOrderSegment>
>       ...a number of elements...
>     </ORC_CommonOrderSegment>
>     <OBR_ObservationRequestSegment>
>       ...a number of elements...
>     </OBR_ObservationRequestSegment>
>         <ORC_CommonOrderSegment>
>       ...a number of elements...
>     </ORC_CommonOrderSegment>
>     <OBR_ObservationRequestSegment>
>       ...a number of elements...
>     </OBR_ObservationRequestSegment>
>     ...further ORC and OBR nodes corresponding to incoming message...
>   </Sequence>
> </ORM_O01_231_GLO_DEF>
>
> The attributes under the RequestTest node map to elements in the PID,
> PV1, GT1 and BLG nodes.  There is no problem with this part of the
> mapping.  The problem comes when trying to map the ORC and OBR
> sections.  In the ouput they are required to be in the order of
>
> ORC
> OBR
> ORC
> OBR
> etc.
>
> corresponding to the incoming XML.  However, no matter what I try they
> come out as
>
> ORC
> ORC
> OBR
> OBR
>
> They cannot be under a parent node in the output XML as this would not
> allow them to be serialised to HL7.  I thought the sequence node was
> supposed to force elements to be in a certain order but this has not
> worked.  I'm quite happy to change my incoming XML if necessary.
>
>





[ Post a follow-up to this message ]



    Re: re:Node order after mapping  
Donato Modugno


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-15-05 10:58 PM

Hi MCE,
i had the same problem to transform my order schema to outbound ORM message
with biztalk mapper.
In my opinion there are no ways to reach it with Btz mapper.
It can be done only with a custon xslt.
If you like, follow this link to microsoft.public.xsl to read the great help
that gave to me J. Gillis to learn and solve this issue.

"http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.xsl&m
id=622244e6-61c7-493f-9735-9d4dc084d939&sloc=en-us"

I hope it can help you in same way.


"MCE" <english@intecgroup.com-dot-au.no-spam.invalid> ha scritto nel
messaggio news:jt6dnZsUs9agCAPeRVn_vA@giganews.com...
> Thankyou for your replies Samuel L and Pabba.  I apologise that it has
> taken me a week to respond but some other production issues came up
> that required my urgent attention.
>
> My incoming XML will look like this:
>
> <RequestTest
>    SendingApplication=""
>    SendingFacility=""
>    ...more attributes...
>    AccountID="" 
>  <OrderCommon
>      OrderControl=""
>      ...further attributes...
>  />
>  <ObservationRequest
>      TestOrdered=""
>      ...further attributes...
>  />
>  <OrderCommon
>      OrderControl=""
>      ...further attributes...
>  />
>  <ObservationRequest
>      TestOrdered=""
>      ...further attributes...
>  />
>  ...more OrderCommon and ObservationRequest elements as required...
> </RequestTest>
>
>
> The output XML, which is provided by the HL7 Accelerator, looks like
> this:
>
> <ORM_O01_231_GLO_DEF>
>  <PID_PatientIdentificationSegment>
>    ...a number of elements...
>  </PID_PatientIdentificationSegment>
>  <PV1_PatientVisitSegment>
>    ...a number of elements...
>  </PV1_PatientVisitSegment>
>  <GT1_GuarantorSegment>
>    ...a number of elements...
>  </GT1_GuarantorSegment>
>  <BLG_BillingSegment>
>    ...a number of elements...
>  </BLG_BillingSegment>
>  <Sequence>
>    <ORC_CommonOrderSegment>
>      ...a number of elements...
>    </ORC_CommonOrderSegment>
>    <OBR_ObservationRequestSegment>
>      ...a number of elements...
>    </OBR_ObservationRequestSegment>
>        <ORC_CommonOrderSegment>
>      ...a number of elements...
>    </ORC_CommonOrderSegment>
>    <OBR_ObservationRequestSegment>
>      ...a number of elements...
>    </OBR_ObservationRequestSegment>
>    ...further ORC and OBR nodes corresponding to incoming message...
>  </Sequence>
> </ORM_O01_231_GLO_DEF>
>
> The attributes under the RequestTest node map to elements in the PID,
> PV1, GT1 and BLG nodes.  There is no problem with this part of the
> mapping.  The problem comes when trying to map the ORC and OBR
> sections.  In the ouput they are required to be in the order of
>
> ORC
> OBR
> ORC
> OBR
> etc.
>
> corresponding to the incoming XML.  However, no matter what I try they
> come out as
>
> ORC
> ORC
> OBR
> OBR
>
> They cannot be under a parent node in the output XML as this would not
> allow them to be serialised to HL7.  I thought the sequence node was
> supposed to force elements to be in a certain order but this has not
> worked.  I'm quite happy to change my incoming XML if necessary.
>







[ Post a follow-up to this message ]



    re:Node order after mapping  
gopal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-06 01:47 AM

Hi Samuel,
I  am having a simiar issue could you please guide me how to resolve this
issue
I am new to XSLT and i dont know if it is possible to write a custom XSLT to
map a flat file repeating structure to predefined xml structure.

I have a requirement from a client.They have given predefined xml structure
we can not add any extra level node in the destination xml for repeating
structure.

i have a flat file with the following structure
Document # Max Unbounded
Header
Vendor #1  Max unbounded
Accounting #1 Max 2 min 2
Accounting #2
Vendor# 2
Accounting #3
Accounting #4
......so on

each vendor record should be followed by two accounting records.

For the repeating sequence in the flat file i defined record which includes
Venodr record and Accounting record in the source side.
But In the desitination i can not add any Record for the repeating
sequence.The stucture is predefined for destination XML.

I tried several ways wiht out xslt but not able to generate the
order/sequence.

I have deadlines and i am stuck with this issue.

Thanks
gopal



"Samuel L" wrote:
[vbcol=seagreen]
> MCE... You're right about that it is a hard part to get the desired order 
1 2
> 1 2 instead of 1 1 2 2... It seems impossible to me using the BizTalk mapp
er!
>
> On the other hand, this can be done using some custom XSLT.
> The good: You can solve the problem
> The bad: You have to make all mappings by writing code
>
> I don't know how familiar you are with XSLT, so I will start by just givin
g
> you a brief description. Then feel free to ask if you have any questions!
>
> 1) Insert a scripting functoid in the BizTalk mapper.
> 2) Connect it to the root node of the destination and modify this code so
> that it fits your exact schemas:
> -------------------------------------------------------
> // first the main template which is applied to whole source doc
> <xsl:template name="MyXsltTemplate">
>    <ORM_O01_231_GLO_DEF>
>       <xsl:for-each select="/child::*/child::*">
>          <xsl:apply-templates select="current()" />
>       </xsl:for-each>
>    </ORM_O01_231_GLO_DEF>
> </xsl:template>
>
> // then one template for the ORC's
> <xsl:template match="OrderCommon">
>     <ORC_CommonOrderSegment>
>         ...a number of elements...
>     </ORC_CommonOrderSegment>
> </xsl:template>
>
>
> // and at last one template for the OBR's
> <xsl:template match="ObservationRequest">
>     <OBR_ObservationRequestSegment>
>         ...a number of elements...
>     </OBR_ObservationRequestSegment>
> </xsl:template>
> -------------------------------------------------------
>
> Hope this helps you in some way!
>
> Good luck and please let me know if you have any strugglings.
>
>
> "MCE" wrote:
> 





[ Post a follow-up to this message ]



    Re: Node order after mapping  
BTSWizard


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-06 10:51 PM

Hi Guys,

A few years back I found this site.

http://www.jenitennison.com/

She is THE master of XSLT, XML, etc.  I highly recommend her book on
XSLT, it discusses these issues and others, and is the only reference
you will need.

Good luck.

Curt






[ Post a follow-up to this message ]



    Re: re:Node order after mapping  
Greg Forsythe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-06 10:51 PM

gopal.

Can you email me an example flatfile, your two schemas and your map to
greg.forsythe at gmail.com

Greg

"gopal" <gopal@discussions.microsoft.com> wrote in message
news:F5C25F88-B118-4D74-8179-F499E5D89DF1@microsoft.com...[vbcol=seagreen]
> Hi Samuel,
> I  am having a simiar issue could you please guide me how to resolve this
> issue
> I am new to XSLT and i dont know if it is possible to write a custom XSLT
> to
> map a flat file repeating structure to predefined xml structure.
>
> I have a requirement from a client.They have given predefined xml
> structure
> we can not add any extra level node in the destination xml for repeating
> structure.
>
> i have a flat file with the following structure
> Document # Max Unbounded
> Header
> Vendor #1  Max unbounded
> Accounting #1 Max 2 min 2
> Accounting #2
> Vendor# 2
> Accounting #3
> Accounting #4
> ......so on
>
> each vendor record should be followed by two accounting records.
>
> For the repeating sequence in the flat file i defined record which
> includes
> Venodr record and Accounting record in the source side.
> But In the desitination i can not add any Record for the repeating
> sequence.The stucture is predefined for destination XML.
>
> I tried several ways wiht out xslt but not able to generate the
> order/sequence.
>
> I have deadlines and i am stuck with this issue.
>
> Thanks
> gopal
>
>
>
> "Samuel L" wrote:
> 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:23 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register