Page 1 of 1

datastage xml parsing

Posted: Fri Jun 05, 2009 11:34 am
by BradMiller
We are trying to parse an xml file into tabular form for database update.
The job looks similar to this:
a sequential file -->xml input --> tranformer stage-->sequential file
The xml source is written below. We are having problems with handling multiple languages in the nested tags(Languages).
<?xml version="1.0" encoding="UTF-8"?>
<OfficeLanguages xmlns:pi="http://was.vsp.com/enetwork_web/xml/">
<OLang>
<TXNID>PI18710258:47199993</TXNID>
<OldTax>204999999</OldTax>
<OldHash>991</OldHash>
<OldSeq>2</OldSeq>
<NewTax>20499999</NewTax>
<NewHash>931</NewHash>
<NewSeq>2</NewSeq>
<Active>A</Active>
<Languages>
<Language>Filipino</Language>
<Language>Spanish</Language>
</Languages>
</OLang>
</OfficeLanguages>

The input stage is able to read all the tags except the language tags within the Languages tag.

Thank you for your time.

Posted: Mon Jun 08, 2009 6:07 am
by throbinson
You canot parse the Language tag? Then your Xpath to the Language element has a typo or other fundamental problem. If you are getting a single language when you expect a row per Language then your Repeating element is probably mis-defined. Is the Repeating Element set to the Language element so that the row breaks when the Language changes?

Posted: Mon Jun 08, 2009 6:14 am
by chulett
Can you post your XPath Expressions, please?

xml parsing

Posted: Mon Jun 08, 2009 11:03 am
by BradMiller
throbinson wrote:You canot parse the Language tag? Then your Xpath to the Language element has a typo or other fundamental problem. If you are getting a single language when you expect a row per Language then your Repeating element is probably mis-defined. Is the Repeating Element set to the Language element so that the row breaks when the Language changes?
yes thank you. I figured it out. The repeating element was misdefined. You were right.

Re: datastage xml parsing

Posted: Tue Jun 09, 2009 8:01 am
by Prade
Is there a possibility to create the Job XML outside Data Stage. We are trying to create and automation tool which can generate popular mappings outside data stage. This will reduce the effort of creating multiple mappings of similar nature?

Posted: Tue Jun 09, 2009 8:07 am
by chulett
:!: This is the second time you've jumped on the end of someone else's barely related thread asking about this. If you really want to start a dialogue on this subject, please start your own post.