Reg. XML Input

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

raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

Hi Kalpana,

I am also new to this XML thing.

But as far as my knowledge is concerned if you are selecting "XML Doc" in your input tab then while importing the XML file thru XML Metadata importer u need to select extra node(top of the column nodes) apart from the columns which stores xml document then u need to specific that column in source column and select XML Doc.

thanks
rajesh
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

Code: Select all

<?xml version="1.0" ?> 
- <catalog>
- <book id="bk101">
  <author>Gambardella, Matthew</author> 
  <title>XML Developer's Guide</title> 
  <genre>Computer</genre> 
  <price>44.95</price> 
  <publish_date>2000-10-01</publish_date> 
  <description>An in-depth look at creating applications with XML.</description> 
  </book>
- <book id="bk102">
  <author>Ralls, Kim</author> 
  <title>Midnight Rain</title> 
  <genre>Fantasy</genre> 
  <price>5.95</price> 
  <publish_date>2000-12-16</publish_date> 
  <description>A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.</description> 
  </book>
- <book id="bk103">
  <author>Corets, Eva</author> 
  <title>Maeve Ascendant</title> 
  <genre>Fantasy</genre> 
  <price>5.95</price> 
  <publish_date>2000-11-17</publish_date> 
  <description>After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.</description> 
  </book>
the above is part of my xml file.

thanks
rajesh
vijayindukuri
Participant
Posts: 66
Joined: Fri Nov 25, 2005 7:55 am

Post by vijayindukuri »

this is the way u did right
folder-----> xmlinput ---> out put stage or file

In the folder stage under the stagetab properties type the folder path for exmaple C:\raj\files\
and under the out put tab properties wild card must be specified as the file name for example file.xml
in the columns tab specify only two columns filename and content set file name as key both the columns will be varchar and u specify the length
Then comes teh xml input stage
under the general tab stage nothing has to be done and transformer check the repeted elements required include name space declaration and load the xml file from which ur trying to extract data there and under the input tab select content in xml source column and for the column content check xml documnet
then come the out put tab in general dont do any thing
trans formation setting inherit stage properties check that ....
in advanced dont do any thing
in the columns u load using the load tab here u need to be careful when loading.u load using the xml metadataimporter select the required fields
kalpna
Premium Member
Premium Member
Posts: 78
Joined: Thu Feb 02, 2006 3:56 am

Post by kalpna »

Hi! Vijay
I did exactly the same way..
it works fine..as long as i don't include the Schema location in the file.
if i do that , job aborts saying, 'it can't open the DTD or Schema.

Where can we place the Schema DTD on unix machine..
kalpna
Premium Member
Premium Member
Posts: 78
Joined: Thu Feb 02, 2006 3:56 am

Post by kalpna »

Oops!...another issue
Job works perfectly fine with one row of data...but, not with multiple rows...

What could be the reason?

Thanks
Kalpna
raj_konig
Participant
Posts: 67
Joined: Thu Dec 22, 2005 12:27 am

Post by raj_konig »

Hi Vijay

Thanks a lot dude. I never a expected such a detailed explanation. Finally it worked. really thanks a lot. :D

rajsh
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Re: Reg. XML Input

Post by parag.s.27 »

Hi,

Actually folder stage is not meant for defining the columns or fields of database. It is for defining 2 fixed columns, 1st is the input file name with entire path, and 2nd is the name given to the contents.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Post Reply