parsing XML column to dataset

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
rockgul88
Participant
Posts: 3
Joined: Thu Mar 10, 2011 1:58 am

parsing XML column to dataset

Post by rockgul88 »

I tried to parse an XMLtype input column from an Oracle table to a datset....
The input column name is XML_STRING_TEXT which contains the following XML content...

"<?xml version="1.0" encoding="UTF-8" ?>
- <application>
<registrationCategory>Account for Child</registrationCategory>
<code>55</code>
<description>Coverdell</description>
- </application>"


I use the following flow:
Oracle stage->XML input->Dataset

The job is running fine...But no data is moving from XML input to Dataset..
A warning message is coming as below,

XML_Input_29,0: Warning: dsj_ProSurv_Dat_WIP1.XML_Input_29: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 2): Expected an element name

please help on this issue....
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

First...make sure you can just retrieve the xml column and put it in a sequential file. Once you are certain that works effectively, correctly retreiving the entire document, move forward.

Sounds like you are doing validation (check box). Don't. Not for initial testing anyway. Get things working first.

How did you do the import of your metadata? Did you have an xsd? If not, but best alternative is to import the metadata from the document you wrote to disk in step 1 up above [import...table definitions....xml definitions...and then specifically check only the lowest/deepest "inside" check box for the elements and attributes that you care about in the tree].

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rockgul88
Participant
Posts: 3
Joined: Thu Mar 10, 2011 1:58 am

Post by rockgul88 »

Ya i checked that also...i am able to tetrieve the full XML doc in a sequential file directly....

I have also imported the metadata of the XML through the import->table definitions->XML table definitions and then i have given 'Auto Check' then saved it....

But still i am getting the same error.... :(
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Note that Ernie did not mention anything about 'Auto Check'... suggest you re-import the metadata as he suggested to see if that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Reading it again, it might also be that there is some odd characters or other data causing issues.

Make absolutely sure that you can open the resulting document (from step 1) perfectly inside of IE or firefox without error, and/or consider checking it's well-formed-ness on the web at the w3.org site for xml or any other web based validator (just search google for something like "xml well formed test" or "xml validation")....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rockgul88
Participant
Posts: 3
Joined: Thu Mar 10, 2011 1:58 am

Post by rockgul88 »

Ya i checked in IE..there is no exception in XML file...

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

Post by eostic »

Just to be sure...eliminate Oracle from the picture. Simplest is to just write a quick test Server Job using Folder to send the xml to your xmlInput Stage. See if it gets the same error as your Oracle-to-XML EE Job.

Ernie

...if you haven't used Server Jobs for XML, create a Server job that has Folder---XML---Transformer----Sequential. Load the "Folder" Stage Table def (it is in the Built-in category of table definitions) into the link from the Folder Stage, and point the folder stage properties to the directory (Stage Level) and Filename (link level) for your test xml document. Then your xmlInput Stage will look just about the same, gteting the content from the Folder Stage instead of Oracle....

Let us know what happens. I find that Server sometimes yields more informative errors.

Ernie
Ernie Ostic

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