Issue with XML input

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Issue with XML input

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

one thought is to make sure you have permissions to that subdirectory.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post 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
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post 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.
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply