Page 1 of 1

Couldn't able to read xml file

Posted: Fri Aug 17, 2012 8:02 am
by rsunny
Hi ,

I am trying to read xml file and load it into text file .
I used External Source->xml input->transformer->sequential file
In External Source , i Have specified
Source Method as Specific Program
Source program as ls /abc/ghe/books.xml
Record Type as implicit
Record delimiter as none
In Xml input stage , i have specified url/filepath in input tab
When i ran the job i got the below error

XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 0, column: 0): An exception occurred! Type:RuntimeException, Message:The primary document entity could not be opened. Id=/abc/ghe/books.xml

The sample xml is as follows
<x:books xmlns:x="urn:books">
<book id="bk001">
<author>Writer</author>
<title>The First Book</title>
<genre>Fiction</genre>
<price>44.95</price>
<pub_date>2000-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>

<book id="bk002">
<author>Poet</author>
<title>The Poet's First Poem</title>
<genre>Poem</genre>
<price>24.95</price>
<review>Least poetic poems.</review>
</book>
</x:books>


Could anyone please help me out in resolving this issue

Posted: Fri Aug 17, 2012 1:10 pm
by svga
Can you share the Xpath you have defined in the XML input stage?

/Sankar

Posted: Fri Aug 17, 2012 1:40 pm
by rsunny
Hi ,

I have included the namespace declaration in xml input stage

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:defns="urn:books"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"

I am not sure about the xpath.

Can you let me know where do we need to define the xpath.
I have defined the path for each column in the output tab of the xml input stage

Posted: Sat Aug 18, 2012 12:02 pm
by rsunny
Any help for the above issue is really appreciated

Posted: Sun Aug 19, 2012 1:26 pm
by rsunny
Is there any other alternative solution to read the xml files besides using with External Source or Sequential file stage?

Posted: Sun Aug 19, 2012 6:46 pm
by eostic
Have you done any searches? There are hundreds of threads with a similar subject....you need to use the xml metadata importer and define your columns ---- when you do, your xpath will be in the description property of your table def.

Ernie

Posted: Sun Aug 19, 2012 8:27 pm
by rsunny
Hi Ernie,

I have used xml metadata importer and defined in the columns and the xpath is also defined in the description for each column but still couldn't able to read the xml file.

I have done searches but couldn't able to find the solution.

Any help is really appreciated

Posted: Mon Aug 20, 2012 1:09 pm
by rsunny
Any idea of what would be the issue?

Posted: Mon Aug 20, 2012 1:16 pm
by chulett
Your file "could not be opened". First two things that come to mind are that it either doesn't exist (which seems unlikely given the 'ls' worked) or you have a permissions issue.