XML Output stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
XML Output stage
Trying to compose XML file with records. I use XML output stage and imported the definition as well. To include the parent tags, I just added them in the transformer and other columns are imported.Also gave / in the declaration for the XML field name.
I do not see any error or warning but no XML file is created. Please suggest me if any changes are required.
Thank you!
I do not see any error or warning but no XML file is created. Please suggest me if any changes are required.
Thank you!
Regards,
Kenny
Kenny
Not enough detail to suggest what might be the issue. Check to make sure all the rows are getting into the xmlOutput Stage and aren't being dropped or otherwise filtered out earlier...
....also try putting a Sequential Stage AFTER the XML Stage and use the Sequential Stage to do the I/O. Put one large column on the output link with Delimiter NONE and quote character NONE. Put a single "/" in its Description.
Ernie
....also try putting a Sequential Stage AFTER the XML Stage and use the Sequential Stage to do the I/O. Put one large column on the output link with Delimiter NONE and quote character NONE. Put a single "/" in its Description.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
99.999 % of the time, you will want "aggregate" as that option --- which basically means "take all my rows and put them into a single xml document...with multiple nodes for multiple rows" (depending of course, on their organization and hierarchy).
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
I changed it to Aggregate button and all the data came into a Single XML file but all the tags came into one child tags like below
<Parent>
<child>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
</child>
</Parent>
These should be 5 different child tags but came into one child tag, just an FYI the key is same for all the tags.
Thank you
<Parent>
<child>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
</child>
</Parent>
These should be 5 different child tags but came into one child tag, just an FYI the key is same for all the tags.
Thank you
Regards,
Kenny
Kenny
Yes. Have seen that before with tiny nodes and no unique cols. Try adding another dummy column on the link, with its own dummy element name in the xpath, at the same level as this child. Make it the key instead, and give it a unique counter value in a transformer upstream.
First just to test if that's the issue.
If it works, see if the receiving application cares --- it may not unless it is validating. If so, edit out the dummy element downstream.
Ernie
First just to test if that's the issue.
If it works, see if the receiving application cares --- it may not unless it is validating. If so, edit out the dummy element downstream.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
I think I tried a different way, just included a new column.
Now I added an other column at the CHILD level giving it a sequence and I see the data in the below way which is not in correct format
<Parent>
<child>
<newchild>1
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
<child>
<newchild>2
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
<child>
<newchild>3
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
</Parent>
Now I added an other column at the CHILD level giving it a sequence and I see the data in the below way which is not in correct format
<Parent>
<child>
<newchild>1
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
<child>
<newchild>2
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
<child>
<newchild>3
<userID>123</userID>
<Phone>6436431347</Phone>
<Fax>5654345678</Fax>
<Addr>123<Addr>
<City>Sunnyvale</City>
<State>CA</State>
<newchild>
</child>
</Parent>
Regards,
Kenny
Kenny
Share the exact xpath for these columns. (What is in the Desc property of the output link)
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am
This is the original XML seen in my table which should be for 5 transactions
<?xml version="1.0" encoding="UTF-8"?>
<TRANSACTIONS>
<I_TRAN>
<TRANSACTION_ID>123 </TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<TRANSACTION_ID> 123</TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<ENTITY> 78 </ENTITY>
<IM_ACCOUNT> 132 </IM_ACCOUNT>
<DR_CR_AMT> 45.549999237060547 </DR_CR_AMT>
<CHECK_NO> 4533 </CHECK_NO>
</I_TRAN>
</TRANSACTIONS>
This is the column in the XML output stage output column
XML_OUTPUT stage output column TRAN_CLOB length:-99999999 DataType:-LongVarchar Description:- /
Xpath for the five columns
/TRANSACTIONS/I_TRAN/TRANSACTION_ID/text()
/TRANSACTIONS/I_TRAN/ENTITY/text()
/TRANSACTIONS/I_TRAN/IM_ACCOUNT/text()
/TRANSACTIONS/I_TRAN/DR_CR_AMT/text()
/TRANSACTIONS/I_TRAN/CHECK_NO/text()
Also just an FYI I had these 5 columns coming from my table before XML_Output stage but I need to add the parent and child so in the transformer I defined two new columns
one is TRANSACTIONS and other I_TRAN for which I gave ' ' in the column value and passes to the XML_output stage
Please let me know if anything above needs to be changed, thank you!
<?xml version="1.0" encoding="UTF-8"?>
<TRANSACTIONS>
<I_TRAN>
<TRANSACTION_ID>123 </TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<TRANSACTION_ID> 123</TRANSACTION_ID>
<TRANSACTION_ID> 123 </TRANSACTION_ID>
<ENTITY> 78 </ENTITY>
<IM_ACCOUNT> 132 </IM_ACCOUNT>
<DR_CR_AMT> 45.549999237060547 </DR_CR_AMT>
<CHECK_NO> 4533 </CHECK_NO>
</I_TRAN>
</TRANSACTIONS>
This is the column in the XML output stage output column
XML_OUTPUT stage output column TRAN_CLOB length:-99999999 DataType:-LongVarchar Description:- /
Xpath for the five columns
/TRANSACTIONS/I_TRAN/TRANSACTION_ID/text()
/TRANSACTIONS/I_TRAN/ENTITY/text()
/TRANSACTIONS/I_TRAN/IM_ACCOUNT/text()
/TRANSACTIONS/I_TRAN/DR_CR_AMT/text()
/TRANSACTIONS/I_TRAN/CHECK_NO/text()
Also just an FYI I had these 5 columns coming from my table before XML_Output stage but I need to add the parent and child so in the transformer I defined two new columns
one is TRANSACTIONS and other I_TRAN for which I gave ' ' in the column value and passes to the XML_output stage
Please let me know if anything above needs to be changed, thank you!
Regards,
Kenny
Kenny
Need to also see "newchild" and its xpath.
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 248
- Joined: Fri Jul 30, 2010 9:04 am