Page 1 of 1

Consuming xml

Posted: Thu Feb 04, 2010 6:09 pm
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]

Posted: Thu Feb 04, 2010 6:27 pm
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: