How to use Stage XML
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 176
- Joined: Wed Nov 15, 2006 5:48 am
How to use Stage XML
Hi
there is any doc where teache how to use the XML stage to read and write XML files ?
there is any doc where teache how to use the XML stage to read and write XML files ?
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
RAI,
Check your client installation directory.
E.g. C:\Program Files\Ascential\DataStage\Docs\XMLPACK_20_Designer.pdf
Note that you don't read/write XML file specifically, you just read/write sequential files, which may or may not contain XML data. The XML stages operate on input and output streams and (generally) provide abilities to convert from/to XML, or between different XML schemas.
HTH,
J.
Check your client installation directory.
E.g. C:\Program Files\Ascential\DataStage\Docs\XMLPACK_20_Designer.pdf
Note that you don't read/write XML file specifically, you just read/write sequential files, which may or may not contain XML data. The XML stages operate on input and output streams and (generally) provide abilities to convert from/to XML, or between different XML schemas.
HTH,
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Participant
- Posts: 176
- Joined: Wed Nov 15, 2006 5:48 am
Your XPath expressions don't match up to what it found in the file, so nothing made it through. More specific than that, I cannot be.RAI ROUSES wrote:ds job can open the xml file, but didn't read any data, it pass 0 records from the stage input xml. The process finished with sucess, but didnt do anything.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 176
- Joined: Wed Nov 15, 2006 5:48 am
Your XPath expressions don't match up to what it found in the file. Not sure how much plainer to say it. Don't forget that namespace plays a role here as well, but problems there would typically (but not always) generate errors during the run.
You haven't given us any information that we can use to help you solve this problem. Perhaps if you post the xsd, an xml snippet and some example XPath expressions? That would be a start.
You haven't given us any information that we can use to help you solve this problem. Perhaps if you post the xsd, an xml snippet and some example XPath expressions? That would be a start.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 176
- Joined: Wed Nov 15, 2006 5:48 am
I used a folder stage to get the name of xml file, then pass 2 records (FileName and Record) to the XMLInput stage.
In the XMLInput Stage, in the Input tab, i defined the FileName as a XML source column, in the column tabs i have the 2 columns that i take from folder stage.
in the XMLInput Stage, Output tab, i definned the columns of my xml file and the derivation for each column.
Column -> derivation
id -> /Compagnie/Client/@id
Nomme -> /Compagnie/Client/Nomme/text()
Ville -> /Compagnie/Client/adresse/Ville/text()
Anne -> /Compagnie/Client/adresse/Anee/text()
An example of my xml file is
<?xml version="1.0"?>
<Compagnie>
<Client id="1001">
<Nomme>Charter Group</Nomme>
<adresse>
<Ville>VfT Paris</Ville>
<Anee>1998</Anee>
</adresse>
</Client>
</Compagnie>
What is wrong ?
In the XMLInput Stage, in the Input tab, i defined the FileName as a XML source column, in the column tabs i have the 2 columns that i take from folder stage.
in the XMLInput Stage, Output tab, i definned the columns of my xml file and the derivation for each column.
Column -> derivation
id -> /Compagnie/Client/@id
Nomme -> /Compagnie/Client/Nomme/text()
Ville -> /Compagnie/Client/adresse/Ville/text()
Anne -> /Compagnie/Client/adresse/Anee/text()
An example of my xml file is
<?xml version="1.0"?>
<Compagnie>
<Client id="1001">
<Nomme>Charter Group</Nomme>
<adresse>
<Ville>VfT Paris</Ville>
<Anee>1998</Anee>
</adresse>
</Client>
</Compagnie>
What is wrong ?