datastage xml parsing

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
BradMiller
Premium Member
Premium Member
Posts: 87
Joined: Mon Feb 18, 2008 3:58 pm
Location: Sacramento, CA

datastage xml parsing

Post 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.
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you post your XPath Expressions, please?
-craig

"You can never have too many knives" -- Logan Nine Fingers
BradMiller
Premium Member
Premium Member
Posts: 87
Joined: Mon Feb 18, 2008 3:58 pm
Location: Sacramento, CA

xml parsing

Post 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.
Prade
Participant
Posts: 3
Joined: Mon Jun 01, 2009 9:44 am

Re: datastage xml parsing

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply