Ignoring XML tags

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
Harini
Premium Member
Premium Member
Posts: 80
Joined: Tue Mar 16, 2010 1:32 am

Ignoring XML tags

Post by Harini »

Hello everybody..

I have a job which has a xml file as input that loads data into multiple tables. Now, the file we receive comes with few other tags also which we have to ignore.

eg:

<ns10:myAssetDetails xmlns:ns11="xxxx:xxx-xxxxx:vs.2001-10-01" xmlns:ns14="xxxx:xxx-xxxxx:vs.2001-10-01" xmlns:ns13="xxxx:xxx-xxxxx:asset.2009-04-09" xmlns:ns15="xxxx:xxx-xxxxx:vs.2001-10-01:np.network.2005-02-18">

I have tags simillar to this.. These are repetitive ... Now when i import the metadata i get the below error.

The xml declaration is unexpecte.Line1,Postion 2333. How do i quitely ignore these tags,and the data underlying in it? I do not need these values and i also don't have xsd.

If i run the file with my exixting job i get the below error:

XML_Input_1,0: Warning: xmlload.XML_Input_1: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: /chap/rdr/Data/outputfiles/xmlload.xml, line: 1, column: 2336): No processing instruction starts with 'xml'



Thanks.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Well...that depends. If they are just "additional tags" in an xml document (meaning, new "elements" that were added), and you aren't doing formal validation, then nothing will happen. That's the nice thing about XML. Who cares if there are new elements if you don't need them or don't want them? (I am assuming that you are not doing validation).

...but if it's saying things about seeing new xml declarations, look at it carefully......

...it sounds almost like there is another xml document buried in the file?

Can you open it in IE with these additional "tags"?

Not sure, but it doesn't sound like it is a valid xml document anymore, or something else that is awry at the high level of the document.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Harini
Premium Member
Premium Member
Posts: 80
Joined: Tue Mar 16, 2010 1:32 am

Post by Harini »

Thank you .. As you rightly pointed out, believe something is wrong with the xml document..looks like it is edited manually... Am able to open it in IE... But I was not able to import the metadata of it.. I have sent it to review it again..

If am able to import the metadata, then retrieving the columns of my interest shouldn't be a problem... will get back to you if i have any concerns..

Thank you.
Post Reply