Page 1 of 1

Prcessing XML files

Posted: Fri Jan 04, 2008 12:49 am
by Das
Hi
I am very new to " XML stages " in data stage.I have a requirement to convert an XML data file to a text file .i have to create the job in server and parrelel jobs

In server job:I have done the design as follows

folder stage----->XML input-------->Flatfile

But while running it is giving an error that Derivations are missing in XML input..Plaese Help

How i can impliment the same in PX

Thanks in advance..

Posted: Fri Jan 04, 2008 2:48 am
by vinbhate
Hi
please check the output tab in XML input stage..there metadata of file is missing with grammer .Incase any more help need just let me know

Posted: Fri Jan 04, 2008 3:55 am
by Das
vinbhate wrote:Hi
please check the output tab in XML input stage..there metadata of file is missing with grammer .Incase any more help need just let me know
Thanks..Could you explain the things in detail:How the whole process
My EMP.XML file will look like as follows.


<EMP>
<EMPNO>23</EMPNO>
<NAME>ABC</NAME>
<DEPTNO>123</DEPTNO>
</EMP>


I dont have any documents related to the xml stages..

Posted: Fri Jan 04, 2008 3:56 am
by Das
vinbhate wrote:Hi
please check the output tab in XML input stage..there metadata of file is missing with grammer .Incase any more help need just let me know
Thanks..Could you explain the things in detail:How the whole process
My EMP.XML file will look like as follows.


<EMP>
<EMPNO>23</EMPNO>
<NAME>ABC</NAME>
<DEPTNO>123</DEPTNO>
</EMP>


I dont have any documents related to the xml stages..

Posted: Fri Jan 04, 2008 4:35 am
by ray.wurlod
If you have the XML stages then you have the documents.

Posted: Fri Jan 04, 2008 7:22 am
by chulett
Exactly. Look for the 'XML PACK' pdf documentation in your Docs directory. Also go to Kim Duke's website and download the XML Best Practices document that is in his Tips section.

Sounds like what you are missing are the XPath Expressions that drive the XML parsing. Read the docs.

Posted: Fri Jan 04, 2008 7:39 am
by WoMaWil
Craig is right. To install the samples and look at their details helps very well to understand the way XML and DataStage work.

Posted: Fri Jan 04, 2008 11:05 am
by eostic
The XML stages are fairly well documented, and the Best Practices is a DO NOT MISS document.

In addition, many of us also frequent the IBM DeveloperWorks site....I recently put an entry there that also might help you...check out the XBRL thread at http://www.ibm.com/developerworks/forum ... orumID=825

Ernie

Posted: Mon Jan 14, 2008 5:39 am
by Das
Hi Thanks for your help.I have gone through the link mentioned below and did exatlt wht they mentioned
but still I am facing some more issues realted to xml stages.

Following is my job design ,to convert XML Doc to SEQUNCILAL file,

Folder stage------XML input-----SEQfile stage.

Folder stage properties which i a have set as follows


Folder path name c:\xml\*.xml

and column defenisions as follows

FileName Varchar 255
Record Longvarchar 999999

XML input stage where i have set the properties as below

In out put tab transformation sttings i have enabled " repetation Required " and also loaded the name space declaration

Then i tried to run the job it is giving the following error

waring:unable to open the folder c:\xml_data\*.xml
fatel xml_input_1:/new_xml_job.folder.DSLiknk3.DSD.UVOpen Unable to open the folder c:\xml_data\*.xml.l

Please help me out

Posted: Mon Jan 14, 2008 8:33 am
by chulett
Ok, it can't find your files because you've entered the values wrong. The Folder pathname should just be "C:\xml" and then your Wildcard pattern should be "*.xml".

Give that a shot.

Posted: Mon Jan 14, 2008 8:41 am
by Das
chulett wrote:Ok, it can't find your files because you've entered the values wrong. The Folder pathname should just be "C:\xml" and then your Wildcard pattern should be "*.xml".

Give that a shot. ...
Thanks.I didnt get your comment exatly.

Actually all my XML files are keeping at the loction C:\xml_data\

So that i given C:\xml_data\*.xml [Folder path ]\[wild card to fetch the xml file]Any thing wrong with this path.Please help me out.

Posted: Mon Jan 14, 2008 8:50 am
by chulett
You said both paths, I picked one.

Stage / Properties / Folder pathname: C:\xml_data

Outputs / Properties / Wildcard: *.xml