Re: How to split XML file based on data in BizTalk
- From: kitchenam@xxxxxxxxxxx
- Date: 13 Mar 2007 14:22:48 -0700
On Mar 13, 3:04 pm, linesh.gaj...@xxxxxxxxx wrote:
Hi All,
I am trying to split the xml file based on the value. Somehow, i do
not have the success yet. There are lots of example of splitting flat
file but not the XML file. Here is a sample XML file
<DB2QueryResult xmlns="DB2Query">
<F57EDID Idenfitier="H" QADATA="Hdata1" QAUKID="10.0"/>
<F57EDID Idenfitier="N" QADATA="Ndata1" QAUKID="10.0"/>
<F57EDID Idenfitier="D" QADATA="Ddata1" QAUKID="10.0"/>
<F57EDID Idenfitier="H" QADATA="Hdata2" QAUKID="10.0"/>
<F57EDID Idenfitier="N" QADATA="Ndata2" QAUKID="10.0"/>
<F57EDID Idenfitier="D" QADATA="Ddata2" QAUKID="10.0"/>
</DB2QueryResult>
I want to split the file whenever Identifier="H" occurs. Identifier
='H' is a to determine a new transaction. My output should be 2 XML
files as in above XML there are 2 transactions.
I can't find the the way to split the file.
Thanks in advance
Linesh
Linesh, this sounds like a multi-part process. The overview would be:
first, look into parsing the original document interchange (see Jan
Tielen's blog http://weblogs.asp.net/jan/archive/2004/03/07/85259.aspx).
Second, I'd use an orchestration to add messages back together based
on the identifier "H".
However, To make your life easier (if possible) I'd look into
modifying the source data ouput so that the xml can be formed
something like...
<DB2QueryResult xmlns="DB2Query">
<transaction Idenfitier="H" QADATA="Hdata1" QAUKID="10.0">
<F57EDID Idenfitier="N" QADATA="Ndata1" QAUKID="10.0"/>
<F57EDID Idenfitier="D" QADATA="Ddata1" QAUKID="10.0"/>
</transaction>
<transaction Idenfitier="H" QADATA="Hdata2" QAUKID="10.0">
<F57EDID Idenfitier="N" QADATA="Ndata2" QAUKID="10.0"/>
<F57EDID Idenfitier="D" QADATA="Ddata2" QAUKID="10.0"/>
</transaction>
</DB2QueryResult>
Hope some of this helps.
-ak
.
- Follow-Ups:
- Re: How to split XML file based on data in BizTalk
- From: linesh . gajera
- Re: How to split XML file based on data in BizTalk
- References:
- How to split XML file based on data in BizTalk
- From: linesh . gajera
- How to split XML file based on data in BizTalk
- Prev by Date: Re: BizTalk 2006 Flat File Parse Produces Garbage Characters at the Beginning of Xml Message Document
- Next by Date: BizTalk 2006 :: Unexpected behavior in rules engine
- Previous by thread: How to split XML file based on data in BizTalk
- Next by thread: Re: How to split XML file based on data in BizTalk
- Index(es):
Relevant Pages
|