XML Output - Repetitive Tags
Posted: Mon Dec 04, 2017 12:11 pm
First of hi to all the members here since this is my 1st post.
While learning dstage stuff I have been visiting this site very often and always managed to find the answers I was looking for, except this time .
I hope I am not repetitive in my question as I saw many similar ones but couldn't make it work for my case:
I have the following data in the xml input file that I need to load: ( I am pasting only 1 group of tags...
<?xml version="1.0" encoding="UTF-8" ?>
<envelope>
<invoice>
<POID>0.0.0.1 /bill 36987435346 4</POID>
<INV_PAGE elem="0">
<PAGE_TYPE>VAT INVOICE</PAGE_TYPE>
<CHARGES elem="0">
<VAT_PERCENT>TAX20</VAT_PERCENT>
<NON_USAGE>500</NON_USAGE>
<USAGE>0</USAGE>
<MONTHLY_DISCOUNT>0</MONTHLY_DISCOUNT>
<TOTAL>500</TOTAL>
</CHARGES>
<TAXES elem="0">
<TAX_RATE>TAX20</TAX_RATE>
<TAX>100</TAX>
<TAX_BASE>500</TAX_BASE>
</TAXES>
<CHARGES elem="1">
<VAT_PERCENT>TAXNN</VAT_PERCENT>
<NON_USAGE>0</NON_USAGE>
<USAGE>100</USAGE>
<MONTHLY_DISCOUNT>0</MONTHLY_DISCOUNT>
<TOTAL>100</TOTAL>
</CHARGES>
<TAXES elem="1">
<TAX_RATE>TAXNN</TAX_RATE>
<TAX>0</TAX>
<TAX_BASE>100</TAX_BASE>
</TAXES>
<NET_TOTAL>600</NET_TOTAL>
<TOTAL_AMOUNT>700</TOTAL_AMOUNT>
<TOTAL_AMOUNT_DUE>699.998</TOTAL_AMOUNT_DUE>
</INV_PAGE>
<DELIVERY>paper</DELIVERY>
<PAGE_TYPE>CUSTOMER</PAGE_TYPE>
blablabla
<PAGE_TYPE>SUBSCRIBER</PAGE_TYPE>
blablabla
My job used to run fine until the bolded part was added in the source.
The initial trigger element before the bolded part was added was: /envelope/invoice/INV_PAGE (since INV_PAGE was the lowest level repetitive tag) I used to output different PAGE_TYPE tags in different output links.
What I need now is to get the bolded part from the PAGE_TYPE = VAT INVOICE but I cant make it to produce 2 different lines (with each repetitive tag of the bolded and italic part)
With the old configuration I receive now the following output:
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAXNN","0","100","600","700","699.998","VAT INVOICE","217054152", (it seems like only TAXNN is being exported and I don't even understand why it is picking elem=1 and not elem=0 for example)
Since the bolded part is added, I decided to play with the trigger element and chose a lower level (CHARGES or TAXES) but in neither case I receive what I want:
What I get as output after changing trigger to /envelope/invoice/TAXES or /envelope/invoice/CHARGES is the following:
What is it:
"0.0.0.1 /bill 36987435346 4","TAX20","500","0","0","500",,,,,,,"VAT INVOICE","217054152",
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAX20","100","500",,,,"VAT INVOICE","217054152",
While what I need is this :
What i need:
"0.0.0.1 /bill 36987435346 4","TAX20","500","0","0","500",TAX20,100,500,600,700,699.998,"VAT INVOICE","217054152",
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAXNN","0","100",600,700,699.998,"VAT INVOICE","217054152",
So It looks like after going in a lower level I can produce the 2 rows that I need (although still not correctly as data seems to be merged somehow) but also losing the data of the last 3 tags <NET_TOTAL> , <TOTAL_AMOUNT> and <TOTAL_AMOUNT_DUE>
I hope my question is clear and has enough data. If not please let me know.
Your help Is really welcomed
While learning dstage stuff I have been visiting this site very often and always managed to find the answers I was looking for, except this time .
I hope I am not repetitive in my question as I saw many similar ones but couldn't make it work for my case:
I have the following data in the xml input file that I need to load: ( I am pasting only 1 group of tags...
<?xml version="1.0" encoding="UTF-8" ?>
<envelope>
<invoice>
<POID>0.0.0.1 /bill 36987435346 4</POID>
<INV_PAGE elem="0">
<PAGE_TYPE>VAT INVOICE</PAGE_TYPE>
<CHARGES elem="0">
<VAT_PERCENT>TAX20</VAT_PERCENT>
<NON_USAGE>500</NON_USAGE>
<USAGE>0</USAGE>
<MONTHLY_DISCOUNT>0</MONTHLY_DISCOUNT>
<TOTAL>500</TOTAL>
</CHARGES>
<TAXES elem="0">
<TAX_RATE>TAX20</TAX_RATE>
<TAX>100</TAX>
<TAX_BASE>500</TAX_BASE>
</TAXES>
<CHARGES elem="1">
<VAT_PERCENT>TAXNN</VAT_PERCENT>
<NON_USAGE>0</NON_USAGE>
<USAGE>100</USAGE>
<MONTHLY_DISCOUNT>0</MONTHLY_DISCOUNT>
<TOTAL>100</TOTAL>
</CHARGES>
<TAXES elem="1">
<TAX_RATE>TAXNN</TAX_RATE>
<TAX>0</TAX>
<TAX_BASE>100</TAX_BASE>
</TAXES>
<NET_TOTAL>600</NET_TOTAL>
<TOTAL_AMOUNT>700</TOTAL_AMOUNT>
<TOTAL_AMOUNT_DUE>699.998</TOTAL_AMOUNT_DUE>
</INV_PAGE>
<DELIVERY>paper</DELIVERY>
<PAGE_TYPE>CUSTOMER</PAGE_TYPE>
blablabla
<PAGE_TYPE>SUBSCRIBER</PAGE_TYPE>
blablabla
My job used to run fine until the bolded part was added in the source.
The initial trigger element before the bolded part was added was: /envelope/invoice/INV_PAGE (since INV_PAGE was the lowest level repetitive tag) I used to output different PAGE_TYPE tags in different output links.
What I need now is to get the bolded part from the PAGE_TYPE = VAT INVOICE but I cant make it to produce 2 different lines (with each repetitive tag of the bolded and italic part)
With the old configuration I receive now the following output:
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAXNN","0","100","600","700","699.998","VAT INVOICE","217054152", (it seems like only TAXNN is being exported and I don't even understand why it is picking elem=1 and not elem=0 for example)
Since the bolded part is added, I decided to play with the trigger element and chose a lower level (CHARGES or TAXES) but in neither case I receive what I want:
What I get as output after changing trigger to /envelope/invoice/TAXES or /envelope/invoice/CHARGES is the following:
What is it:
"0.0.0.1 /bill 36987435346 4","TAX20","500","0","0","500",,,,,,,"VAT INVOICE","217054152",
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAX20","100","500",,,,"VAT INVOICE","217054152",
While what I need is this :
What i need:
"0.0.0.1 /bill 36987435346 4","TAX20","500","0","0","500",TAX20,100,500,600,700,699.998,"VAT INVOICE","217054152",
"0.0.0.1 /bill 36987435346 4","TAXNN","0","100","0","100","TAXNN","0","100",600,700,699.998,"VAT INVOICE","217054152",
So It looks like after going in a lower level I can produce the 2 rows that I need (although still not correctly as data seems to be merged somehow) but also losing the data of the last 3 tags <NET_TOTAL> , <TOTAL_AMOUNT> and <TOTAL_AMOUNT_DUE>
I hope my question is clear and has enough data. If not please let me know.
Your help Is really welcomed