Consuming xml

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
rob47329
Participant
Posts: 6
Joined: Fri Jan 23, 2009 10:47 am

Consuming xml

Post by rob47329 »

Hello All,

I am reading a couple of xml records from a sql server database(using a DRS database stage). I pass each xml rec(as a single field - longvarchar 99999) to an xml input stage. In my xml input stage(input tab), I select the xml source column and check the radio button XML_document(setting content as xml).

Additional Info: On both the stage and output tab of my xml input stage, I have selected 'Repetition element required'.

On the output tab of my xml input stage, I have defined two varchar columns with the appropriate xpaths. The output from my xml input stage goes to a sequential file. When I view the output, the xml values are correctly parsed from the xml, but both values end up in the first output column(not in each respective column).

Example of xml:

<customer>
<custid>123</custid>
<custname>robert</custname>
</customer>

output field definitions:

customer_id /customer/custid/text()
customer_name /customer/custname/text()


output data:

customer_id customer_name
--------------- ---------------------
123robert null

Any help is appreciated.

Thanks

Robert


[/img]
Robert
rob47329
Participant
Posts: 6
Joined: Fri Jan 23, 2009 10:47 am

Post by rob47329 »

Please disregard post. In my sequential file, I did not define a delimitter between fields. Putting in a pipe delimitter seperated columns appropriately. My bad. Thx :oops:
Robert
Post Reply