Parsing XML Tags with Dot

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
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Parsing XML Tags with Dot

Post by visvacfirvin »

Hi,
I'm trying to convert XML to CSV.
Is it possible to parse XML tag names with dots. For eg, we have the following structure.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>
<books.shiporder>
<books.item>
<books.title>Empire Burlesque</books.title>
<books.note>Special Edition</books.note>
<books.quantity>1</books.quantity>
<books.price>10.90</books.price>
</books.item>
</books.shiporder>
I imported the table definintion using XML Table import utility. Now when i tried to read the XML file to convert into CSv, it throws the following error.

Code: Select all

 Syntax error: Error in "export"  operator: Error in operator arg: In field "books": Expected ";", got: ".", line 78
If i remove the dots from the tag and load the metadata & parse, its working fine.

Please let me know the solution, if you have solved this before.

Thanks,
Firvin
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Removing the dots is the solution. Tags with dots do not count as "well-formed XML" and DataStage expects well-formed XML.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Post by visvacfirvin »

Oh..thts bad...We recieve bigger XML files with this format. I already have a solution in Java. I was exploring possibilities.

Anyways Thanks Ray!!!
Post Reply