Page 1 of 1

Issue with XML input

Posted: Wed Feb 15, 2012 2:18 pm
by RAJARP
Hi all,
I am developing a simple parallel job which involves a xml input file

Sample input data
===========

<xml>
<ID>I7-1</ID>
<ID>I7-2</ID>
</xml>

Job design:
External source-->XML_Input--->SEq file

Settings:

External source:
==========
Properties:
source Method: Specific program(s)
Source program: ls /home/sample.xml

Format:
Record type :Implicit
Delimiter:None


Columns:
Defined one column 'Filename' of VarChar type, Non-Nullable and din't specified the length

XML INPUT STAGE:
=============

Stage->Transformation Settings

checked 'Repitition element required'

input-->XML Source

in XML Source Column selected 'Filename' column which i have defined in External source stage
&
checked 'XML document'

output -->columns

defined a column 'Id', derivation-left blank,Key-Yes,SQL type-Varchar,Nullable-->No, Description-->/xml/customer/text()

1.Checked whether the xml is opening properly in internet explorer
2.Able to see the filename with path, when i do view data in External source stage

when i ran the job, the job is finishing successfully but no records got loaded into the target file.
But got one warning as below

Code: Select all

XML_Input_3,0: Warning: Xml.XML_Input_3: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 1): Invalid document structure 
Then change one setting in XML input stage

input-->XML Source

checked 'URL/File Path'

Even now job finished successfully bot no rows in output and got the below warning

Code: Select all

XML_Input_3,0: Warning: Xml.XML_Input_3: 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=/home/sample.xml 
Sorry for the long post.But wanted to give you people a clear picture.

Your help would be appreciated and thanks in advance

Regards,
Raja R P

Posted: Wed Feb 15, 2012 4:34 pm
by eostic
one thought is to make sure you have permissions to that subdirectory.

Posted: Thu Feb 16, 2012 12:27 pm
by RAJARP
Thanks for the suggestion Ernie!!!!

I have checked the file permission and sub directory permision and have done 'chmod 777' for both the file and directory.But, no luck :(

Also,another paraller job is able to write another seq file in the sme location.

So belive, 'permission' is not the problem!!!!!

Any other suggestions?

Regards,
Raja RP

Posted: Thu Feb 16, 2012 12:44 pm
by mobashshar
Please use URL/File path instead of XML Document in Input tab - XML Source.

You are using ls command in external stage and giving the file path to your xml file... so you have to provide the file path to your sample.xml

And.. also check your output tab -> transformation setting: if you have included the namespace declaration or not.

Posted: Thu Feb 16, 2012 1:03 pm
by mandyli
Do onething

1st try to same out put into txt file and then see the data from txt file.

If evething looks good and then redirect to XML out put stage.


And also please use url path instead of XML document.


It looks like some metadata mismatch issue.


Thanks
Man

Posted: Thu Feb 16, 2012 1:26 pm
by eostic
all good ideas above.

Also look at the doc sample itself. See if it has a SchemaLocation or NoNameSpaceSchemaLocation attribute at the top. Perhaps it is really complaining about not being able to reach "that". You might get an error like that with or without "validation" checked.

Ernie