You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@gmail.com> on 2020/06/17 07:14:05 UTC

split with tokenizeXML in complex XML

Hi

We have a XML file to split on tag <Tx>. 
However this tag is also present in a node further down the tree as well. 

tokenizeXML is used in our application but now this won’t work because it ends prematurely.

Here’s the XML

<?xml version="1.0" encoding="UTF-8"?>
<UVMiFIRDocument xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
    <UVHeader>
        <UVHeader xmlns="unavista.header.001.001.001">
            <SubmittingEntityID>1312312</SubmittingEntityID>
        </UVHeader>
    </UVHeader>
    <Document>
        <Document xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
            <FinInstrmRptgTxRpt>
                <Tx>
                    <New>
                        <TxId>197X85138XMT</TxId>
                        <ExctgPty>1231231</ExctgPty>
                        <InvstmtPtyInd>true</InvstmtPtyInd>
                        <SubmitgPty>312312</SubmitgPty>
                        <Buyr>
                            <AcctOwnr>
                                <Id>
                                    <LEI>123123</LEI>
                                </Id>
                                <CtryOfBrnch>NL</CtryOfBrnch>
                            </AcctOwnr>
                            <DcsnMakr>
                                <LEI>549300DLR3UX38D4Z689</LEI>
                            </DcsnMakr>
                        </Buyr>
                        <Sellr>
                            <AcctOwnr>
                                <Id>
                                    <LEI>123123123</LEI>
                                </Id>
                            </AcctOwnr>
                        </Sellr>
                        <OrdrTrnsmssn>
                            <TrnsmssnInd>true</TrnsmssnInd>
                        </OrdrTrnsmssn>
                        <Tx>
                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
                            <TradgCpcty>AOTC</TradgCpcty>
                            <Qty>
                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
                            </Qty>
                            <Pric>
                                <Pric>
                                    <MntryVal>
                                        <Amt Ccy="USD">1.131818</Amt>
                                    </MntryVal>
                                </Pric>
                            </Pric>
                            <TradVn>XOFF</TradVn>
                        </Tx>
                        <FinInstrm>
                            <Othr>
                                <FinInstrmGnlAttrbts>
                                    <FullNm>USD/EUR</FullNm>
                                    <ClssfctnTp>JFTXFP</ClssfctnTp>
                                    <NtnlCcy>USD</NtnlCcy>
                                </FinInstrmGnlAttrbts>
                                <DerivInstrmAttrbts>
                                    <XpryDt>2020-06-09</XpryDt>
                                    <PricMltplr>1</PricMltplr>
                                    <UndrlygInstrm>
                                        <Othr>
                                            <Sngl>
                                                <Indx>
                                                    <Nm>
                                                        <RefRate>
                                                            <Nm>USD/EUR</Nm>
                                                        </RefRate>
                                                    </Nm>
                                                </Indx>
                                            </Sngl>
                                        </Othr>
                                    </UndrlygInstrm>
                                    <DlvryTp>PHYS</DlvryTp>
                                </DerivInstrmAttrbts>
                            </Othr>
                        </FinInstrm>
                        <ExctgPrsn>
                            <Clnt>NORE</Clnt>
                        </ExctgPrsn>
                        <AddtlAttrbts>
                            <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
                    </New>
                </Tx>
            </FinInstrmRptgTxRpt>
        </Document>
    </Document>
</UVMiFIRDocument>

In the debugger it reveals that it is “broken”

<Tx>
                    <New>
                        <TxId>197X85138XMT</TxId>
                        <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
                        <InvstmtPtyInd>true</InvstmtPtyInd>
                        <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
                        <Buyr>
                            <AcctOwnr>
                                <Id>
                                    <LEI>5493000WZY3YLO3WB727</LEI>
                                </Id>
                                <CtryOfBrnch>NL</CtryOfBrnch>
                            </AcctOwnr>
                            <DcsnMakr>
                                <LEI>549300DLR3UX38D4Z689</LEI>
                            </DcsnMakr>
                        </Buyr>
                        <Sellr>
                            <AcctOwnr>
                                <Id>
                                    <LEI>5493006KMX1VFTPYPW14</LEI>
                                </Id>
                            </AcctOwnr>
                        </Sellr>
                        <OrdrTrnsmssn>
                            <TrnsmssnInd>true</TrnsmssnInd>
                        </OrdrTrnsmssn>
                        <Tx>
                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
                            <TradgCpcty>AOTC</TradgCpcty>
                            <Qty>
                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
                            </Qty>
                            <Pric>
                                <Pric>
                                    <MntryVal>
                                        <Amt Ccy="USD">1.131818</Amt>
                                    </MntryVal>
                                </Pric>
                            </Pric>
                            <TradVn>XOFF</TradVn>
                        </Tx>


Can this be done using tokenizeXML or?



Thx

Re: split with tokenizeXML in complex XML

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Well now my original problem has turned to a split/xpath problem. 

Trying to split on either the tag as Tx or using //Tx or using //FinInstrmRptgTxRpt/Tx returns nothing. 

Tried online xpath parsers and they return the correct xml for the last two (as mentioned above). 

Tried 2.25.1 and 3.3.0 of camel with the same result. 
File is xml and body converted to String and then 

split(xpath(“//FinInstrmRptgTxRpt/Tx”))

Also tried an XPathBuilder with the same result. 

Pls advice

// Mikael Andersson Wigander


> 17 juni 2020 kl. 13:22 skrev Claus Ibsen <cl...@gmail.com>:
> 
> Hi
> 
> It can be both, hower its a little better as an argument
> 
> split(xpath(xxxx), xxxx)
> 
> 
> 
>> On Wed, Jun 17, 2020 at 1:10 PM Mikael Andersson Wigander
>> <mi...@gmail.com> wrote:
>> 
>> Hi
>> 
>> Makes sense.
>> 
>> Tried splitting using xpath but it didn’t work either.
>> Should xpath be as argument of split or own statement (.xpath())?
>> 
>> // Mikael Andersson Wigander
>> 
>> 
>>>> 17 juni 2020 kl. 10:14 skrev Claus Ibsen <cl...@gmail.com>:
>>> 
>>> Hi
>>> 
>>> No tokenizeXml is for not complex XML with tags that are nested. It
>>> uses regexp parsing etc.
>>> 
>>> Instead using camel-stax or camel-jaxb or something like that.
>>> 
>>> 
>>>> On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
>>>> <mi...@gmail.com> wrote:
>>>> 
>>>> Hi
>>>> 
>>>> We have a XML file to split on tag <Tx>.
>>>> However this tag is also present in a node further down the tree as well.
>>>> 
>>>> tokenizeXML is used in our application but now this won’t work because it ends prematurely.
>>>> 
>>>> Here’s the XML
>>>> 
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <UVMiFIRDocument xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
>>>>   <UVHeader>
>>>>       <UVHeader xmlns="unavista.header.001.001.001">
>>>>           <SubmittingEntityID>1312312</SubmittingEntityID>
>>>>       </UVHeader>
>>>>   </UVHeader>
>>>>   <Document>
>>>>       <Document xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
>>>>           <FinInstrmRptgTxRpt>
>>>>               <Tx>
>>>>                   <New>
>>>>                       <TxId>197X85138XMT</TxId>
>>>>                       <ExctgPty>1231231</ExctgPty>
>>>>                       <InvstmtPtyInd>true</InvstmtPtyInd>
>>>>                       <SubmitgPty>312312</SubmitgPty>
>>>>                       <Buyr>
>>>>                           <AcctOwnr>
>>>>                               <Id>
>>>>                                   <LEI>123123</LEI>
>>>>                               </Id>
>>>>                               <CtryOfBrnch>NL</CtryOfBrnch>
>>>>                           </AcctOwnr>
>>>>                           <DcsnMakr>
>>>>                               <LEI>549300DLR3UX38D4Z689</LEI>
>>>>                           </DcsnMakr>
>>>>                       </Buyr>
>>>>                       <Sellr>
>>>>                           <AcctOwnr>
>>>>                               <Id>
>>>>                                   <LEI>123123123</LEI>
>>>>                               </Id>
>>>>                           </AcctOwnr>
>>>>                       </Sellr>
>>>>                       <OrdrTrnsmssn>
>>>>                           <TrnsmssnInd>true</TrnsmssnInd>
>>>>                       </OrdrTrnsmssn>
>>>>                       <Tx>
>>>>                           <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>>>>                           <TradgCpcty>AOTC</TradgCpcty>
>>>>                           <Qty>
>>>>                               <NmnlVal Ccy="EUR">3.57</NmnlVal>
>>>>                           </Qty>
>>>>                           <Pric>
>>>>                               <Pric>
>>>>                                   <MntryVal>
>>>>                                       <Amt Ccy="USD">1.131818</Amt>
>>>>                                   </MntryVal>
>>>>                               </Pric>
>>>>                           </Pric>
>>>>                           <TradVn>XOFF</TradVn>
>>>>                       </Tx>
>>>>                       <FinInstrm>
>>>>                           <Othr>
>>>>                               <FinInstrmGnlAttrbts>
>>>>                                   <FullNm>USD/EUR</FullNm>
>>>>                                   <ClssfctnTp>JFTXFP</ClssfctnTp>
>>>>                                   <NtnlCcy>USD</NtnlCcy>
>>>>                               </FinInstrmGnlAttrbts>
>>>>                               <DerivInstrmAttrbts>
>>>>                                   <XpryDt>2020-06-09</XpryDt>
>>>>                                   <PricMltplr>1</PricMltplr>
>>>>                                   <UndrlygInstrm>
>>>>                                       <Othr>
>>>>                                           <Sngl>
>>>>                                               <Indx>
>>>>                                                   <Nm>
>>>>                                                       <RefRate>
>>>>                                                           <Nm>USD/EUR</Nm>
>>>>                                                       </RefRate>
>>>>                                                   </Nm>
>>>>                                               </Indx>
>>>>                                           </Sngl>
>>>>                                       </Othr>
>>>>                                   </UndrlygInstrm>
>>>>                                   <DlvryTp>PHYS</DlvryTp>
>>>>                               </DerivInstrmAttrbts>
>>>>                           </Othr>
>>>>                       </FinInstrm>
>>>>                       <ExctgPrsn>
>>>>                           <Clnt>NORE</Clnt>
>>>>                       </ExctgPrsn>
>>>>                       <AddtlAttrbts>
>>>>                           <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
>>>>                   </New>
>>>>               </Tx>
>>>>           </FinInstrmRptgTxRpt>
>>>>       </Document>
>>>>   </Document>
>>>> </UVMiFIRDocument>
>>>> 
>>>> In the debugger it reveals that it is “broken”
>>>> 
>>>> <Tx>
>>>>                   <New>
>>>>                       <TxId>197X85138XMT</TxId>
>>>>                       <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
>>>>                       <InvstmtPtyInd>true</InvstmtPtyInd>
>>>>                       <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
>>>>                       <Buyr>
>>>>                           <AcctOwnr>
>>>>                               <Id>
>>>>                                   <LEI>5493000WZY3YLO3WB727</LEI>
>>>>                               </Id>
>>>>                               <CtryOfBrnch>NL</CtryOfBrnch>
>>>>                           </AcctOwnr>
>>>>                           <DcsnMakr>
>>>>                               <LEI>549300DLR3UX38D4Z689</LEI>
>>>>                           </DcsnMakr>
>>>>                       </Buyr>
>>>>                       <Sellr>
>>>>                           <AcctOwnr>
>>>>                               <Id>
>>>>                                   <LEI>5493006KMX1VFTPYPW14</LEI>
>>>>                               </Id>
>>>>                           </AcctOwnr>
>>>>                       </Sellr>
>>>>                       <OrdrTrnsmssn>
>>>>                           <TrnsmssnInd>true</TrnsmssnInd>
>>>>                       </OrdrTrnsmssn>
>>>>                       <Tx>
>>>>                           <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>>>>                           <TradgCpcty>AOTC</TradgCpcty>
>>>>                           <Qty>
>>>>                               <NmnlVal Ccy="EUR">3.57</NmnlVal>
>>>>                           </Qty>
>>>>                           <Pric>
>>>>                               <Pric>
>>>>                                   <MntryVal>
>>>>                                       <Amt Ccy="USD">1.131818</Amt>
>>>>                                   </MntryVal>
>>>>                               </Pric>
>>>>                           </Pric>
>>>>                           <TradVn>XOFF</TradVn>
>>>>                       </Tx>
>>>> 
>>>> 
>>>> Can this be done using tokenizeXML or?
>>>> 
>>>> 
>>>> 
>>>> Thx
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Re: split with tokenizeXML in complex XML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah there is the problem with some xml libraries not working in
streaming mode where they can process the data in chunks, so they have
to load all content into memory.
The tokenizer from Camel does not have that problem, but it can have
others like not being able to match the right ending tag.

Btw have you tried the non xml tokenizer, the older one was more
basic. Not sure if we had some way to configure a parent tag for the
matching, or if we could add such functionality.

So if you look for <foo> and </foo> pairs and configure a parent tag
as <myorder> then it will attempt to match <myorder><foo> and
</foo></myorder>

Anyway yeah it can get a bit more complex. Also sometimes if you not
the content of the data will always be like X, then some regexp
matcher may do the trick, which is what the general tokenizer can work
with.

But on the other hand if you solve a problem with regexp, then they
say you introduce a new problem.



On Wed, Jun 17, 2020 at 4:20 PM bob anderson <bo...@gmail.com> wrote:
>
> HI
>
> Some time back (couple of years) I  used split xtokenize on a large XML
> file at three levels which has worked very well. Two of the three elements
> had the same tags, however I needed elements from each level so did the
> split tokenize in separate routes i.e. split/tokenize (get an element) call
> the next route which split tokenized the next section(s) and then finally
> the third level. I use the XML DSL (and this was using Camel  2.15.1 - so
> I'm sure it will work still)
> The file had 500000 rows to 1000000 rows and I tried different
> approaches to handle both the size and speed of processing (Claus had a
> good article on processing large xml files which I followed)
>
> Cheers
>
> Bob
>
>
>
>
> On Wed, Jun 17, 2020 at 1:22 PM Claus Ibsen <cl...@gmail.com> wrote:
>
> > Hi
> >
> > It can be both, hower its a little better as an argument
> >
> > split(xpath(xxxx), xxxx)
> >
> >
> >
> > On Wed, Jun 17, 2020 at 1:10 PM Mikael Andersson Wigander
> > <mi...@gmail.com> wrote:
> > >
> > > Hi
> > >
> > > Makes sense.
> > >
> > > Tried splitting using xpath but it didn’t work either.
> > > Should xpath be as argument of split or own statement (.xpath())?
> > >
> > > // Mikael Andersson Wigander
> > >
> > >
> > > > 17 juni 2020 kl. 10:14 skrev Claus Ibsen <cl...@gmail.com>:
> > > >
> > > > Hi
> > > >
> > > > No tokenizeXml is for not complex XML with tags that are nested. It
> > > > uses regexp parsing etc.
> > > >
> > > > Instead using camel-stax or camel-jaxb or something like that.
> > > >
> > > >
> > > >> On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
> > > >> <mi...@gmail.com> wrote:
> > > >>
> > > >> Hi
> > > >>
> > > >> We have a XML file to split on tag <Tx>.
> > > >> However this tag is also present in a node further down the tree as
> > well.
> > > >>
> > > >> tokenizeXML is used in our application but now this won’t work
> > because it ends prematurely.
> > > >>
> > > >> Here’s the XML
> > > >>
> > > >> <?xml version="1.0" encoding="UTF-8"?>
> > > >> <UVMiFIRDocument
> > xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
> > > >>    <UVHeader>
> > > >>        <UVHeader xmlns="unavista.header.001.001.001">
> > > >>            <SubmittingEntityID>1312312</SubmittingEntityID>
> > > >>        </UVHeader>
> > > >>    </UVHeader>
> > > >>    <Document>
> > > >>        <Document
> > xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
> > > >>            <FinInstrmRptgTxRpt>
> > > >>                <Tx>
> > > >>                    <New>
> > > >>                        <TxId>197X85138XMT</TxId>
> > > >>                        <ExctgPty>1231231</ExctgPty>
> > > >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> > > >>                        <SubmitgPty>312312</SubmitgPty>
> > > >>                        <Buyr>
> > > >>                            <AcctOwnr>
> > > >>                                <Id>
> > > >>                                    <LEI>123123</LEI>
> > > >>                                </Id>
> > > >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> > > >>                            </AcctOwnr>
> > > >>                            <DcsnMakr>
> > > >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> > > >>                            </DcsnMakr>
> > > >>                        </Buyr>
> > > >>                        <Sellr>
> > > >>                            <AcctOwnr>
> > > >>                                <Id>
> > > >>                                    <LEI>123123123</LEI>
> > > >>                                </Id>
> > > >>                            </AcctOwnr>
> > > >>                        </Sellr>
> > > >>                        <OrdrTrnsmssn>
> > > >>                            <TrnsmssnInd>true</TrnsmssnInd>
> > > >>                        </OrdrTrnsmssn>
> > > >>                        <Tx>
> > > >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> > > >>                            <TradgCpcty>AOTC</TradgCpcty>
> > > >>                            <Qty>
> > > >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> > > >>                            </Qty>
> > > >>                            <Pric>
> > > >>                                <Pric>
> > > >>                                    <MntryVal>
> > > >>                                        <Amt Ccy="USD">1.131818</Amt>
> > > >>                                    </MntryVal>
> > > >>                                </Pric>
> > > >>                            </Pric>
> > > >>                            <TradVn>XOFF</TradVn>
> > > >>                        </Tx>
> > > >>                        <FinInstrm>
> > > >>                            <Othr>
> > > >>                                <FinInstrmGnlAttrbts>
> > > >>                                    <FullNm>USD/EUR</FullNm>
> > > >>                                    <ClssfctnTp>JFTXFP</ClssfctnTp>
> > > >>                                    <NtnlCcy>USD</NtnlCcy>
> > > >>                                </FinInstrmGnlAttrbts>
> > > >>                                <DerivInstrmAttrbts>
> > > >>                                    <XpryDt>2020-06-09</XpryDt>
> > > >>                                    <PricMltplr>1</PricMltplr>
> > > >>                                    <UndrlygInstrm>
> > > >>                                        <Othr>
> > > >>                                            <Sngl>
> > > >>                                                <Indx>
> > > >>                                                    <Nm>
> > > >>                                                        <RefRate>
> > > >>
> > <Nm>USD/EUR</Nm>
> > > >>                                                        </RefRate>
> > > >>                                                    </Nm>
> > > >>                                                </Indx>
> > > >>                                            </Sngl>
> > > >>                                        </Othr>
> > > >>                                    </UndrlygInstrm>
> > > >>                                    <DlvryTp>PHYS</DlvryTp>
> > > >>                                </DerivInstrmAttrbts>
> > > >>                            </Othr>
> > > >>                        </FinInstrm>
> > > >>                        <ExctgPrsn>
> > > >>                            <Clnt>NORE</Clnt>
> > > >>                        </ExctgPrsn>
> > > >>                        <AddtlAttrbts>
> > > >>
> > <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
> > > >>                    </New>
> > > >>                </Tx>
> > > >>            </FinInstrmRptgTxRpt>
> > > >>        </Document>
> > > >>    </Document>
> > > >> </UVMiFIRDocument>
> > > >>
> > > >> In the debugger it reveals that it is “broken”
> > > >>
> > > >> <Tx>
> > > >>                    <New>
> > > >>                        <TxId>197X85138XMT</TxId>
> > > >>                        <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
> > > >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> > > >>                        <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
> > > >>                        <Buyr>
> > > >>                            <AcctOwnr>
> > > >>                                <Id>
> > > >>                                    <LEI>5493000WZY3YLO3WB727</LEI>
> > > >>                                </Id>
> > > >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> > > >>                            </AcctOwnr>
> > > >>                            <DcsnMakr>
> > > >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> > > >>                            </DcsnMakr>
> > > >>                        </Buyr>
> > > >>                        <Sellr>
> > > >>                            <AcctOwnr>
> > > >>                                <Id>
> > > >>                                    <LEI>5493006KMX1VFTPYPW14</LEI>
> > > >>                                </Id>
> > > >>                            </AcctOwnr>
> > > >>                        </Sellr>
> > > >>                        <OrdrTrnsmssn>
> > > >>                            <TrnsmssnInd>true</TrnsmssnInd>
> > > >>                        </OrdrTrnsmssn>
> > > >>                        <Tx>
> > > >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> > > >>                            <TradgCpcty>AOTC</TradgCpcty>
> > > >>                            <Qty>
> > > >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> > > >>                            </Qty>
> > > >>                            <Pric>
> > > >>                                <Pric>
> > > >>                                    <MntryVal>
> > > >>                                        <Amt Ccy="USD">1.131818</Amt>
> > > >>                                    </MntryVal>
> > > >>                                </Pric>
> > > >>                            </Pric>
> > > >>                            <TradVn>XOFF</TradVn>
> > > >>                        </Tx>
> > > >>
> > > >>
> > > >> Can this be done using tokenizeXML or?
> > > >>
> > > >>
> > > >>
> > > >> Thx
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > http://davsclaus.com @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Bob Anderson
> +27 (0) 82 389 0335
> [image: View my profile on LinkedIn]
> <http://ng.linkedin.com/pub/bob-anderson/2/25/9b5>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: split with tokenizeXML in complex XML

Posted by bob anderson <bo...@gmail.com>.
HI

Some time back (couple of years) I  used split xtokenize on a large XML
file at three levels which has worked very well. Two of the three elements
had the same tags, however I needed elements from each level so did the
split tokenize in separate routes i.e. split/tokenize (get an element) call
the next route which split tokenized the next section(s) and then finally
the third level. I use the XML DSL (and this was using Camel  2.15.1 - so
I'm sure it will work still)
The file had 500000 rows to 1000000 rows and I tried different
approaches to handle both the size and speed of processing (Claus had a
good article on processing large xml files which I followed)

Cheers

Bob




On Wed, Jun 17, 2020 at 1:22 PM Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> It can be both, hower its a little better as an argument
>
> split(xpath(xxxx), xxxx)
>
>
>
> On Wed, Jun 17, 2020 at 1:10 PM Mikael Andersson Wigander
> <mi...@gmail.com> wrote:
> >
> > Hi
> >
> > Makes sense.
> >
> > Tried splitting using xpath but it didn’t work either.
> > Should xpath be as argument of split or own statement (.xpath())?
> >
> > // Mikael Andersson Wigander
> >
> >
> > > 17 juni 2020 kl. 10:14 skrev Claus Ibsen <cl...@gmail.com>:
> > >
> > > Hi
> > >
> > > No tokenizeXml is for not complex XML with tags that are nested. It
> > > uses regexp parsing etc.
> > >
> > > Instead using camel-stax or camel-jaxb or something like that.
> > >
> > >
> > >> On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
> > >> <mi...@gmail.com> wrote:
> > >>
> > >> Hi
> > >>
> > >> We have a XML file to split on tag <Tx>.
> > >> However this tag is also present in a node further down the tree as
> well.
> > >>
> > >> tokenizeXML is used in our application but now this won’t work
> because it ends prematurely.
> > >>
> > >> Here’s the XML
> > >>
> > >> <?xml version="1.0" encoding="UTF-8"?>
> > >> <UVMiFIRDocument
> xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
> > >>    <UVHeader>
> > >>        <UVHeader xmlns="unavista.header.001.001.001">
> > >>            <SubmittingEntityID>1312312</SubmittingEntityID>
> > >>        </UVHeader>
> > >>    </UVHeader>
> > >>    <Document>
> > >>        <Document
> xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
> > >>            <FinInstrmRptgTxRpt>
> > >>                <Tx>
> > >>                    <New>
> > >>                        <TxId>197X85138XMT</TxId>
> > >>                        <ExctgPty>1231231</ExctgPty>
> > >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> > >>                        <SubmitgPty>312312</SubmitgPty>
> > >>                        <Buyr>
> > >>                            <AcctOwnr>
> > >>                                <Id>
> > >>                                    <LEI>123123</LEI>
> > >>                                </Id>
> > >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> > >>                            </AcctOwnr>
> > >>                            <DcsnMakr>
> > >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> > >>                            </DcsnMakr>
> > >>                        </Buyr>
> > >>                        <Sellr>
> > >>                            <AcctOwnr>
> > >>                                <Id>
> > >>                                    <LEI>123123123</LEI>
> > >>                                </Id>
> > >>                            </AcctOwnr>
> > >>                        </Sellr>
> > >>                        <OrdrTrnsmssn>
> > >>                            <TrnsmssnInd>true</TrnsmssnInd>
> > >>                        </OrdrTrnsmssn>
> > >>                        <Tx>
> > >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> > >>                            <TradgCpcty>AOTC</TradgCpcty>
> > >>                            <Qty>
> > >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> > >>                            </Qty>
> > >>                            <Pric>
> > >>                                <Pric>
> > >>                                    <MntryVal>
> > >>                                        <Amt Ccy="USD">1.131818</Amt>
> > >>                                    </MntryVal>
> > >>                                </Pric>
> > >>                            </Pric>
> > >>                            <TradVn>XOFF</TradVn>
> > >>                        </Tx>
> > >>                        <FinInstrm>
> > >>                            <Othr>
> > >>                                <FinInstrmGnlAttrbts>
> > >>                                    <FullNm>USD/EUR</FullNm>
> > >>                                    <ClssfctnTp>JFTXFP</ClssfctnTp>
> > >>                                    <NtnlCcy>USD</NtnlCcy>
> > >>                                </FinInstrmGnlAttrbts>
> > >>                                <DerivInstrmAttrbts>
> > >>                                    <XpryDt>2020-06-09</XpryDt>
> > >>                                    <PricMltplr>1</PricMltplr>
> > >>                                    <UndrlygInstrm>
> > >>                                        <Othr>
> > >>                                            <Sngl>
> > >>                                                <Indx>
> > >>                                                    <Nm>
> > >>                                                        <RefRate>
> > >>
> <Nm>USD/EUR</Nm>
> > >>                                                        </RefRate>
> > >>                                                    </Nm>
> > >>                                                </Indx>
> > >>                                            </Sngl>
> > >>                                        </Othr>
> > >>                                    </UndrlygInstrm>
> > >>                                    <DlvryTp>PHYS</DlvryTp>
> > >>                                </DerivInstrmAttrbts>
> > >>                            </Othr>
> > >>                        </FinInstrm>
> > >>                        <ExctgPrsn>
> > >>                            <Clnt>NORE</Clnt>
> > >>                        </ExctgPrsn>
> > >>                        <AddtlAttrbts>
> > >>
> <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
> > >>                    </New>
> > >>                </Tx>
> > >>            </FinInstrmRptgTxRpt>
> > >>        </Document>
> > >>    </Document>
> > >> </UVMiFIRDocument>
> > >>
> > >> In the debugger it reveals that it is “broken”
> > >>
> > >> <Tx>
> > >>                    <New>
> > >>                        <TxId>197X85138XMT</TxId>
> > >>                        <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
> > >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> > >>                        <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
> > >>                        <Buyr>
> > >>                            <AcctOwnr>
> > >>                                <Id>
> > >>                                    <LEI>5493000WZY3YLO3WB727</LEI>
> > >>                                </Id>
> > >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> > >>                            </AcctOwnr>
> > >>                            <DcsnMakr>
> > >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> > >>                            </DcsnMakr>
> > >>                        </Buyr>
> > >>                        <Sellr>
> > >>                            <AcctOwnr>
> > >>                                <Id>
> > >>                                    <LEI>5493006KMX1VFTPYPW14</LEI>
> > >>                                </Id>
> > >>                            </AcctOwnr>
> > >>                        </Sellr>
> > >>                        <OrdrTrnsmssn>
> > >>                            <TrnsmssnInd>true</TrnsmssnInd>
> > >>                        </OrdrTrnsmssn>
> > >>                        <Tx>
> > >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> > >>                            <TradgCpcty>AOTC</TradgCpcty>
> > >>                            <Qty>
> > >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> > >>                            </Qty>
> > >>                            <Pric>
> > >>                                <Pric>
> > >>                                    <MntryVal>
> > >>                                        <Amt Ccy="USD">1.131818</Amt>
> > >>                                    </MntryVal>
> > >>                                </Pric>
> > >>                            </Pric>
> > >>                            <TradVn>XOFF</TradVn>
> > >>                        </Tx>
> > >>
> > >>
> > >> Can this be done using tokenizeXML or?
> > >>
> > >>
> > >>
> > >> Thx
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > http://davsclaus.com @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Bob Anderson
+27 (0) 82 389 0335
[image: View my profile on LinkedIn]
<http://ng.linkedin.com/pub/bob-anderson/2/25/9b5>

Re: split with tokenizeXML in complex XML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

It can be both, hower its a little better as an argument

split(xpath(xxxx), xxxx)



On Wed, Jun 17, 2020 at 1:10 PM Mikael Andersson Wigander
<mi...@gmail.com> wrote:
>
> Hi
>
> Makes sense.
>
> Tried splitting using xpath but it didn’t work either.
> Should xpath be as argument of split or own statement (.xpath())?
>
> // Mikael Andersson Wigander
>
>
> > 17 juni 2020 kl. 10:14 skrev Claus Ibsen <cl...@gmail.com>:
> >
> > Hi
> >
> > No tokenizeXml is for not complex XML with tags that are nested. It
> > uses regexp parsing etc.
> >
> > Instead using camel-stax or camel-jaxb or something like that.
> >
> >
> >> On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
> >> <mi...@gmail.com> wrote:
> >>
> >> Hi
> >>
> >> We have a XML file to split on tag <Tx>.
> >> However this tag is also present in a node further down the tree as well.
> >>
> >> tokenizeXML is used in our application but now this won’t work because it ends prematurely.
> >>
> >> Here’s the XML
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <UVMiFIRDocument xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
> >>    <UVHeader>
> >>        <UVHeader xmlns="unavista.header.001.001.001">
> >>            <SubmittingEntityID>1312312</SubmittingEntityID>
> >>        </UVHeader>
> >>    </UVHeader>
> >>    <Document>
> >>        <Document xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
> >>            <FinInstrmRptgTxRpt>
> >>                <Tx>
> >>                    <New>
> >>                        <TxId>197X85138XMT</TxId>
> >>                        <ExctgPty>1231231</ExctgPty>
> >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> >>                        <SubmitgPty>312312</SubmitgPty>
> >>                        <Buyr>
> >>                            <AcctOwnr>
> >>                                <Id>
> >>                                    <LEI>123123</LEI>
> >>                                </Id>
> >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> >>                            </AcctOwnr>
> >>                            <DcsnMakr>
> >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> >>                            </DcsnMakr>
> >>                        </Buyr>
> >>                        <Sellr>
> >>                            <AcctOwnr>
> >>                                <Id>
> >>                                    <LEI>123123123</LEI>
> >>                                </Id>
> >>                            </AcctOwnr>
> >>                        </Sellr>
> >>                        <OrdrTrnsmssn>
> >>                            <TrnsmssnInd>true</TrnsmssnInd>
> >>                        </OrdrTrnsmssn>
> >>                        <Tx>
> >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> >>                            <TradgCpcty>AOTC</TradgCpcty>
> >>                            <Qty>
> >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> >>                            </Qty>
> >>                            <Pric>
> >>                                <Pric>
> >>                                    <MntryVal>
> >>                                        <Amt Ccy="USD">1.131818</Amt>
> >>                                    </MntryVal>
> >>                                </Pric>
> >>                            </Pric>
> >>                            <TradVn>XOFF</TradVn>
> >>                        </Tx>
> >>                        <FinInstrm>
> >>                            <Othr>
> >>                                <FinInstrmGnlAttrbts>
> >>                                    <FullNm>USD/EUR</FullNm>
> >>                                    <ClssfctnTp>JFTXFP</ClssfctnTp>
> >>                                    <NtnlCcy>USD</NtnlCcy>
> >>                                </FinInstrmGnlAttrbts>
> >>                                <DerivInstrmAttrbts>
> >>                                    <XpryDt>2020-06-09</XpryDt>
> >>                                    <PricMltplr>1</PricMltplr>
> >>                                    <UndrlygInstrm>
> >>                                        <Othr>
> >>                                            <Sngl>
> >>                                                <Indx>
> >>                                                    <Nm>
> >>                                                        <RefRate>
> >>                                                            <Nm>USD/EUR</Nm>
> >>                                                        </RefRate>
> >>                                                    </Nm>
> >>                                                </Indx>
> >>                                            </Sngl>
> >>                                        </Othr>
> >>                                    </UndrlygInstrm>
> >>                                    <DlvryTp>PHYS</DlvryTp>
> >>                                </DerivInstrmAttrbts>
> >>                            </Othr>
> >>                        </FinInstrm>
> >>                        <ExctgPrsn>
> >>                            <Clnt>NORE</Clnt>
> >>                        </ExctgPrsn>
> >>                        <AddtlAttrbts>
> >>                            <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
> >>                    </New>
> >>                </Tx>
> >>            </FinInstrmRptgTxRpt>
> >>        </Document>
> >>    </Document>
> >> </UVMiFIRDocument>
> >>
> >> In the debugger it reveals that it is “broken”
> >>
> >> <Tx>
> >>                    <New>
> >>                        <TxId>197X85138XMT</TxId>
> >>                        <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
> >>                        <InvstmtPtyInd>true</InvstmtPtyInd>
> >>                        <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
> >>                        <Buyr>
> >>                            <AcctOwnr>
> >>                                <Id>
> >>                                    <LEI>5493000WZY3YLO3WB727</LEI>
> >>                                </Id>
> >>                                <CtryOfBrnch>NL</CtryOfBrnch>
> >>                            </AcctOwnr>
> >>                            <DcsnMakr>
> >>                                <LEI>549300DLR3UX38D4Z689</LEI>
> >>                            </DcsnMakr>
> >>                        </Buyr>
> >>                        <Sellr>
> >>                            <AcctOwnr>
> >>                                <Id>
> >>                                    <LEI>5493006KMX1VFTPYPW14</LEI>
> >>                                </Id>
> >>                            </AcctOwnr>
> >>                        </Sellr>
> >>                        <OrdrTrnsmssn>
> >>                            <TrnsmssnInd>true</TrnsmssnInd>
> >>                        </OrdrTrnsmssn>
> >>                        <Tx>
> >>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
> >>                            <TradgCpcty>AOTC</TradgCpcty>
> >>                            <Qty>
> >>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
> >>                            </Qty>
> >>                            <Pric>
> >>                                <Pric>
> >>                                    <MntryVal>
> >>                                        <Amt Ccy="USD">1.131818</Amt>
> >>                                    </MntryVal>
> >>                                </Pric>
> >>                            </Pric>
> >>                            <TradVn>XOFF</TradVn>
> >>                        </Tx>
> >>
> >>
> >> Can this be done using tokenizeXML or?
> >>
> >>
> >>
> >> Thx
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: split with tokenizeXML in complex XML

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Hi

Makes sense.

Tried splitting using xpath but it didn’t work either. 
Should xpath be as argument of split or own statement (.xpath())?

// Mikael Andersson Wigander


> 17 juni 2020 kl. 10:14 skrev Claus Ibsen <cl...@gmail.com>:
> 
> Hi
> 
> No tokenizeXml is for not complex XML with tags that are nested. It
> uses regexp parsing etc.
> 
> Instead using camel-stax or camel-jaxb or something like that.
> 
> 
>> On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
>> <mi...@gmail.com> wrote:
>> 
>> Hi
>> 
>> We have a XML file to split on tag <Tx>.
>> However this tag is also present in a node further down the tree as well.
>> 
>> tokenizeXML is used in our application but now this won’t work because it ends prematurely.
>> 
>> Here’s the XML
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <UVMiFIRDocument xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
>>    <UVHeader>
>>        <UVHeader xmlns="unavista.header.001.001.001">
>>            <SubmittingEntityID>1312312</SubmittingEntityID>
>>        </UVHeader>
>>    </UVHeader>
>>    <Document>
>>        <Document xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
>>            <FinInstrmRptgTxRpt>
>>                <Tx>
>>                    <New>
>>                        <TxId>197X85138XMT</TxId>
>>                        <ExctgPty>1231231</ExctgPty>
>>                        <InvstmtPtyInd>true</InvstmtPtyInd>
>>                        <SubmitgPty>312312</SubmitgPty>
>>                        <Buyr>
>>                            <AcctOwnr>
>>                                <Id>
>>                                    <LEI>123123</LEI>
>>                                </Id>
>>                                <CtryOfBrnch>NL</CtryOfBrnch>
>>                            </AcctOwnr>
>>                            <DcsnMakr>
>>                                <LEI>549300DLR3UX38D4Z689</LEI>
>>                            </DcsnMakr>
>>                        </Buyr>
>>                        <Sellr>
>>                            <AcctOwnr>
>>                                <Id>
>>                                    <LEI>123123123</LEI>
>>                                </Id>
>>                            </AcctOwnr>
>>                        </Sellr>
>>                        <OrdrTrnsmssn>
>>                            <TrnsmssnInd>true</TrnsmssnInd>
>>                        </OrdrTrnsmssn>
>>                        <Tx>
>>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>>                            <TradgCpcty>AOTC</TradgCpcty>
>>                            <Qty>
>>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
>>                            </Qty>
>>                            <Pric>
>>                                <Pric>
>>                                    <MntryVal>
>>                                        <Amt Ccy="USD">1.131818</Amt>
>>                                    </MntryVal>
>>                                </Pric>
>>                            </Pric>
>>                            <TradVn>XOFF</TradVn>
>>                        </Tx>
>>                        <FinInstrm>
>>                            <Othr>
>>                                <FinInstrmGnlAttrbts>
>>                                    <FullNm>USD/EUR</FullNm>
>>                                    <ClssfctnTp>JFTXFP</ClssfctnTp>
>>                                    <NtnlCcy>USD</NtnlCcy>
>>                                </FinInstrmGnlAttrbts>
>>                                <DerivInstrmAttrbts>
>>                                    <XpryDt>2020-06-09</XpryDt>
>>                                    <PricMltplr>1</PricMltplr>
>>                                    <UndrlygInstrm>
>>                                        <Othr>
>>                                            <Sngl>
>>                                                <Indx>
>>                                                    <Nm>
>>                                                        <RefRate>
>>                                                            <Nm>USD/EUR</Nm>
>>                                                        </RefRate>
>>                                                    </Nm>
>>                                                </Indx>
>>                                            </Sngl>
>>                                        </Othr>
>>                                    </UndrlygInstrm>
>>                                    <DlvryTp>PHYS</DlvryTp>
>>                                </DerivInstrmAttrbts>
>>                            </Othr>
>>                        </FinInstrm>
>>                        <ExctgPrsn>
>>                            <Clnt>NORE</Clnt>
>>                        </ExctgPrsn>
>>                        <AddtlAttrbts>
>>                            <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
>>                    </New>
>>                </Tx>
>>            </FinInstrmRptgTxRpt>
>>        </Document>
>>    </Document>
>> </UVMiFIRDocument>
>> 
>> In the debugger it reveals that it is “broken”
>> 
>> <Tx>
>>                    <New>
>>                        <TxId>197X85138XMT</TxId>
>>                        <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
>>                        <InvstmtPtyInd>true</InvstmtPtyInd>
>>                        <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
>>                        <Buyr>
>>                            <AcctOwnr>
>>                                <Id>
>>                                    <LEI>5493000WZY3YLO3WB727</LEI>
>>                                </Id>
>>                                <CtryOfBrnch>NL</CtryOfBrnch>
>>                            </AcctOwnr>
>>                            <DcsnMakr>
>>                                <LEI>549300DLR3UX38D4Z689</LEI>
>>                            </DcsnMakr>
>>                        </Buyr>
>>                        <Sellr>
>>                            <AcctOwnr>
>>                                <Id>
>>                                    <LEI>5493006KMX1VFTPYPW14</LEI>
>>                                </Id>
>>                            </AcctOwnr>
>>                        </Sellr>
>>                        <OrdrTrnsmssn>
>>                            <TrnsmssnInd>true</TrnsmssnInd>
>>                        </OrdrTrnsmssn>
>>                        <Tx>
>>                            <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>>                            <TradgCpcty>AOTC</TradgCpcty>
>>                            <Qty>
>>                                <NmnlVal Ccy="EUR">3.57</NmnlVal>
>>                            </Qty>
>>                            <Pric>
>>                                <Pric>
>>                                    <MntryVal>
>>                                        <Amt Ccy="USD">1.131818</Amt>
>>                                    </MntryVal>
>>                                </Pric>
>>                            </Pric>
>>                            <TradVn>XOFF</TradVn>
>>                        </Tx>
>> 
>> 
>> Can this be done using tokenizeXML or?
>> 
>> 
>> 
>> Thx
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Re: split with tokenizeXML in complex XML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

No tokenizeXml is for not complex XML with tags that are nested. It
uses regexp parsing etc.

Instead using camel-stax or camel-jaxb or something like that.


On Wed, Jun 17, 2020 at 9:14 AM Mikael Andersson Wigander
<mi...@gmail.com> wrote:
>
> Hi
>
> We have a XML file to split on tag <Tx>.
> However this tag is also present in a node further down the tree as well.
>
> tokenizeXML is used in our application but now this won’t work because it ends prematurely.
>
> Here’s the XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <UVMiFIRDocument xmlns="urn:uv:xsd:unavista.mifir.iso20022.001.001.001">
>     <UVHeader>
>         <UVHeader xmlns="unavista.header.001.001.001">
>             <SubmittingEntityID>1312312</SubmittingEntityID>
>         </UVHeader>
>     </UVHeader>
>     <Document>
>         <Document xmlns="urn:iso:std:iso:20022:tech:xsd:DRAFT15auth.016.001.01">
>             <FinInstrmRptgTxRpt>
>                 <Tx>
>                     <New>
>                         <TxId>197X85138XMT</TxId>
>                         <ExctgPty>1231231</ExctgPty>
>                         <InvstmtPtyInd>true</InvstmtPtyInd>
>                         <SubmitgPty>312312</SubmitgPty>
>                         <Buyr>
>                             <AcctOwnr>
>                                 <Id>
>                                     <LEI>123123</LEI>
>                                 </Id>
>                                 <CtryOfBrnch>NL</CtryOfBrnch>
>                             </AcctOwnr>
>                             <DcsnMakr>
>                                 <LEI>549300DLR3UX38D4Z689</LEI>
>                             </DcsnMakr>
>                         </Buyr>
>                         <Sellr>
>                             <AcctOwnr>
>                                 <Id>
>                                     <LEI>123123123</LEI>
>                                 </Id>
>                             </AcctOwnr>
>                         </Sellr>
>                         <OrdrTrnsmssn>
>                             <TrnsmssnInd>true</TrnsmssnInd>
>                         </OrdrTrnsmssn>
>                         <Tx>
>                             <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>                             <TradgCpcty>AOTC</TradgCpcty>
>                             <Qty>
>                                 <NmnlVal Ccy="EUR">3.57</NmnlVal>
>                             </Qty>
>                             <Pric>
>                                 <Pric>
>                                     <MntryVal>
>                                         <Amt Ccy="USD">1.131818</Amt>
>                                     </MntryVal>
>                                 </Pric>
>                             </Pric>
>                             <TradVn>XOFF</TradVn>
>                         </Tx>
>                         <FinInstrm>
>                             <Othr>
>                                 <FinInstrmGnlAttrbts>
>                                     <FullNm>USD/EUR</FullNm>
>                                     <ClssfctnTp>JFTXFP</ClssfctnTp>
>                                     <NtnlCcy>USD</NtnlCcy>
>                                 </FinInstrmGnlAttrbts>
>                                 <DerivInstrmAttrbts>
>                                     <XpryDt>2020-06-09</XpryDt>
>                                     <PricMltplr>1</PricMltplr>
>                                     <UndrlygInstrm>
>                                         <Othr>
>                                             <Sngl>
>                                                 <Indx>
>                                                     <Nm>
>                                                         <RefRate>
>                                                             <Nm>USD/EUR</Nm>
>                                                         </RefRate>
>                                                     </Nm>
>                                                 </Indx>
>                                             </Sngl>
>                                         </Othr>
>                                     </UndrlygInstrm>
>                                     <DlvryTp>PHYS</DlvryTp>
>                                 </DerivInstrmAttrbts>
>                             </Othr>
>                         </FinInstrm>
>                         <ExctgPrsn>
>                             <Clnt>NORE</Clnt>
>                         </ExctgPrsn>
>                         <AddtlAttrbts>
>                             <SctiesFincgTxInd>false</SctiesFincgTxInd></AddtlAttrbts>
>                     </New>
>                 </Tx>
>             </FinInstrmRptgTxRpt>
>         </Document>
>     </Document>
> </UVMiFIRDocument>
>
> In the debugger it reveals that it is “broken”
>
> <Tx>
>                     <New>
>                         <TxId>197X85138XMT</TxId>
>                         <ExctgPty>549300DLR3UX38D4Z689</ExctgPty>
>                         <InvstmtPtyInd>true</InvstmtPtyInd>
>                         <SubmitgPty>549300FVRWYPDFJTH118</SubmitgPty>
>                         <Buyr>
>                             <AcctOwnr>
>                                 <Id>
>                                     <LEI>5493000WZY3YLO3WB727</LEI>
>                                 </Id>
>                                 <CtryOfBrnch>NL</CtryOfBrnch>
>                             </AcctOwnr>
>                             <DcsnMakr>
>                                 <LEI>549300DLR3UX38D4Z689</LEI>
>                             </DcsnMakr>
>                         </Buyr>
>                         <Sellr>
>                             <AcctOwnr>
>                                 <Id>
>                                     <LEI>5493006KMX1VFTPYPW14</LEI>
>                                 </Id>
>                             </AcctOwnr>
>                         </Sellr>
>                         <OrdrTrnsmssn>
>                             <TrnsmssnInd>true</TrnsmssnInd>
>                         </OrdrTrnsmssn>
>                         <Tx>
>                             <TradDt>2020-06-05T21:18:32.000Z</TradDt>
>                             <TradgCpcty>AOTC</TradgCpcty>
>                             <Qty>
>                                 <NmnlVal Ccy="EUR">3.57</NmnlVal>
>                             </Qty>
>                             <Pric>
>                                 <Pric>
>                                     <MntryVal>
>                                         <Amt Ccy="USD">1.131818</Amt>
>                                     </MntryVal>
>                                 </Pric>
>                             </Pric>
>                             <TradVn>XOFF</TradVn>
>                         </Tx>
>
>
> Can this be done using tokenizeXML or?
>
>
>
> Thx



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2