You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Hello
Could some one could help me with this issue, please
Env Windows Xp , TOS 3.0 generate to Java
Because tAdavanceFileOutpuXML does not support multiple loops I created two xml files that I need to insert one into another one.
xml 1
<CustomerInvoices>
<CustomerInvoice>
<InvoiceHeader>
<RefNumber>6004</RefNumber>
<Date>25-08-2009</Date>
<CreationDateTime>25-08-2009</CreationDateTime>
<Currency>EUR</Currency>
<Booking>
<BookingID>2004</BookingID>
<TotalAmount>100</TotalAmount>
</Booking>
</InvoiceHeader>
<invoiceItems>
<invoiceItem>
<SeqNumber>6007</SeqNumber>
<BookingFinancialTransaction>
<BookingFinancTransRef>107</BookingFinancTransRef>
<NbPassenger>0</NbPassenger>
</BookingFinancialTransaction>
</invoiceItem>
</invoiceItems>
</CustomerInvoice>
</CustomerInvoices>
xml 2
<CustomerInvoice>
<RefNumber>6001</RefNumber>
<Booking>
<BookingID>2004</BookingID>
<BookingContextAxisList>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>CASSURA</Value>
</Context>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>FR</Value>
</Context>
</BookingContextAxisList>
</Booking>
<Booking>
</CustomerInvoice>
The expected result will be like this
<CustomerInvoices>
<CustomerInvoice>
<InvoiceHeader>
<RefNumber>6004</RefNumber>
<Date>25-08-2009</Date>
<CreationDateTime>25-08-2009</CreationDateTime>
<Currency>EUR</Currency>
<Booking>
<BookingID>2004</BookingID>
<TotalAmount>100</TotalAmount>
<BookingContextAxisList>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>CASSURA</Value>
</Context>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>FR</Value>
</Context>
</BookingContextAxisList>
</Booking>
</InvoiceHeader>
<invoiceItems>
<invoiceItem>
<SeqNumber>6007</SeqNumber>
<BookingFinancialTransaction>
<BookingFinancTransRef>107</BookingFinancTransRef>
<NbPassenger>0</NbPassenger>
</BookingFinancialTransaction>
</invoiceItem>
</invoiceItems>
</CustomerInvoice>
</CustomerInvoices>
Thanks in advance
Last edited by mbernaza (2009-08-27 04:48:09)
Offline
Hello
You can use the 'Append the source xml file' feature on tAdvancedFileoutputXML, here I extract records fron xml 2 and insert them into xml 1. Please see my screenshots.
result:
<?xml version="1.0" encoding="ISO-8859-15"?>
<CustomerInvoices>
<CustomerInvoice>
<InvoiceHeader>
<RefNumber>6004</RefNumber>
<Date>25-08-2009</Date>
<CreationDateTime>25-08-2009</CreationDateTime>
<Currency>EUR</Currency>
<Booking>
<BookingID>2004</BookingID>
<TotalAmount>100</TotalAmount>
<BookingContextAxisList>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>CASSURA</Value>
</Context>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>FR</Value>
</Context>
</BookingContextAxisList>
</Booking>
</InvoiceHeader>
<invoiceItems>
<invoiceItem>
<SeqNumber>6007</SeqNumber>
<BookingFinancialTransaction>
<BookingFinancTransRef>107</BookingFinancTransRef>
<NbPassenger>0</NbPassenger>
</BookingFinancialTransaction>
</invoiceItem>
</invoiceItems>
</CustomerInvoice>
</CustomerInvoices>
Best regards
shong
Offline
Hello Shong
Sorry , maybe I didnt mentioned properly.
the xml 2 is like this
<CustomerInvoice>
<Booking>
<BookingID>2004</BookingID>
<BookingContextAxisList>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>CASSURA</Value>
</Context>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>FR</Value>
</Context>
</BookingContextAxisList>
</Booking>
<Booking>
<Booking>
<BookingID>2008</BookingID>
<BookingContextAxisList>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>VALUE FOR BOOK 2008</Value>
</Context>
<Context>
<ContextName>CUSTOMER_MARKET</ContextName>
<Value>EN</Value>
</Context>
</BookingContextAxisList>
</Booking>
</CustomerInvoice>
I tried your recomendation, but the result is that the xml 2 was inserted completly in the first appear . What I need is to insert the BookingContextAxisList of each booking to his corresponding Booking in XML 1
Offline
Hello
Aslo extract the booking id from xlm2, and then set booking element as group element.
Best regards
shong
Offline

shong wrote:
Hello
Aslo extract the booking id from xlm2, and then set booking element as group element.
Best regards
shong
mbernaza: Did this solution work? The ability to construct a complex, hierarchical XML document from a DB flow is critical for us. Would another approach be more robust, such as using tJavaRow, and leveraging either the DOM or, easier still, a Java XML data binding tool (Castor, JAXB, Liquid Tech's, etc.).
Offline
Pages: 1