How can I extract just the values from xml file???

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

How can I extract just the values from xml file???

Post by ICE »

Dear All,

May I know whether I can extract the values excluding the tags(column) name which I already imported in the xml table metadata definition as column name?
If can, may I know how to do it?
My current job design is as follows:
Folder -> XML reader -> sequential file.

Folder stage can read all the *.xml files from that specific folder.
But XML reader extract the xml file column value together with tag(column) name. For example: <lworkstationNmbr>1</lworkstationNmbr>
In that case, I want only the value which is 1. I don't want the tag name.
May I know whether I can do it or not and if yes, how to do it???
Anyone can help me please???

Thank you for your time,

Regards,
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

on your distribution CD there are same sample XML-files and jobs. Looking them through is very helpful. Thereafter you are surely able to do your job
Wolfgang Hürter
Amsterdam
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear WoMaWil,

I setup that example. There are 5 sample jobs. Right? I already checked all that sample jobs and powerpoint explanation but I wasn't got the solution from there. I also couldn't run those sample jobs :(
I got this my job design from that sample Ex4. But the required result wasn't that I wanted and I also don't know what are the actual output for that sample job. That's why I need your help. I also went through some help file from DSJ help but I still do not very clear :P

Thank you so much for your time.
Is there anyone can help me pls???

Thank you


WoMaWil wrote:on your distribution CD there are same sample XML-files and jobs. Looking them through is very helpful. Thereafter you are surely able to do your job
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Try modifying your X Path.
Arun
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear arunkumarmm,

May I know where can I find it and how to do it?
I saw the XPath in help but I don't see in my job :(
I don't see enough help info for XML input stage and XML Reader. Is there any other help file for XMLInput and XML Reader stages???
Thank you so much for your help.


Thanks,
ICE

arunkumarmm wrote:Try modifying your X Path.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The XML Reader stage is old and has been deprecated. Use the XML Input stage now instead.

For documentation there is an XML PACK pdf file in your 'Docs' directory. And an XML Best Practices writeup on Kim Duke's website.

ps. The XPath Expression is stored in the 'Description' field in the XML stages.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear chulett,

Ok. Let me find more help forXMLiinput stage.
Thank you so much for your information.

Thanks,

chulett wrote:The XML Reader stage is old and has been deprecated. Use the XML Input stage now instead.

For documentation there is an XML PACK pdf file in your 'Docs' directory. And an XML Best Practices writeup on Kim Duke's website.

ps. The XPath Expression is stored in the 'Description' field in the XML stages.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear Chulett,

I define the XPath as TAS/NEW_TA/FOOTER/@lTaNmbr to get the value of that column lTaNmbr but there is null value result. Actually those column has value. I also define the XPath in Derivation column but it doesn't work :(
Is there any idea for this problem???


Thanks,

chulett wrote:The XML Reader stage is old and has been deprecated. Use the XML Input stage now instead.

For documentation there is an XML PACK pdf file in your 'Docs' directory. And an XML Best Practices writeup on Kim Duke's website.

ps. The XPath Expression is stored in the 'Description' field in the XML stages.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

The XPath is the route that you would take, element by element, if you are "walking" thru the XML document to reach the desired value.... you should be starting it with the /, so /TAS would be the first part, and this means that <TAS> must also be the root element of your document....check this, and the spelling. Your actual column as specified below @ITaNmbr is an "attribute", which means in the xml document it should be found as ITaNmbr="some value".... if that is not the case, then you need alternate syntax (if ITaNmbr is an element, like <ITaNmbr> then you would need .../ITaNmbr/text() in your XPath syntax in the Description property of the column on your output link.

There is more to the XMLInput Stage....spelling errors, incorrect paths, wrong repetition element --- they can all result in retrieval issues. Do some searches in the forum, get the XML Best Practices document as noted in other threads, and use a simple example...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Can anyone send me XML Presentations which you have or any docs associated with that,
Actually i am starting a new project on XML, this would a great help
if anyone of you could send me these docs and pdfs.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

chulett wrote:For documentation there is an XML PACK pdf file in your 'Docs' directory. And an XML Best Practices writeup on Kim Duke's website.
There ya go.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Thanks for the information.
Post Reply