Re: How to split XML file based on data in BizTalk



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

.



Relevant Pages

  • ExportXML File Format Problem
    ... I'm generating an XML file to be imported into an accounting program using a ... Payment and Tax sections inside of the Transaction section where they belong. ...
    (microsoft.public.access.externaldata)
  • Re: speeding up a file conversion from text file to XML format
    ... to try and improve the importing of files into SQL for old legacy ... I have written a module to convert this file into an XML file which ... 4000 data records (data recorded marked for with *** for ... It seems like most of the activity is adding the Transaction XmlElement 4000 ...
    (microsoft.public.dotnet.languages.vb)
  • Catching duplicate inserts into SQL Server Database Table
    ... I am currently in the process of developing a transaction loading ... service which parses an xml file and loads these transactions to a ... The problem i am having is if i try to process the same file twice ... The method being used to execute the SP is the ExecuteNonQuery method ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ExportXML File Format Problem
    ... Try exporting the Transaction table using the menu functionality. ... Is the XML file the way you expect it to be? ... > show up after the Detail, Payment, and Tax sections but appears before the ...
    (microsoft.public.access.externaldata)
  • dataset xml
    ... dataset.writexmlto append to an existing xml file. ... know how i can load an xml file and delete records from it. ... need to load the xml transaction file and drop records that are n days old. ...
    (microsoft.public.dotnet.languages.vb)