Handling special character in XML

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Handling special character in XML

Post by sourabhverma »

Hi all,

I am having a server job which is reading XML file using Folder & XML Input stage and finally i create sequential files.
Folder => XML Input => Tfm => Seq. file

the folder stage contains multiple XML files. My problem is that, sometimes the XML files have some special characters instead of actual attribute value.Then in that case the XML Input stage neglects reading that particular XML.
For eg. the NAME field contains NAME="[" value .

I want to know is there any way to handle these type of special characters while reading the file so that XML input stage either skip or manage that record.
Thanks,
Sourabh Verma
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

That's tricky. I wonder if those characters makes it badly formed XML. You could try preprocessing the file using XLS. Do a forum search on XLS for previous threads, I don't know a lot about it myself. You could also try stripping out these characters using an operating system script such as search and replace commands.
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post by sourabhverma »

Thanks WoMaWil for the reply & suggestion but the problem still persist because the routine you suggested will work before loading into target.
Actually the XML Input stage is not able to read the XML file having special character, so i think anything that could be done should be apply either at XML Input stage or at file level.
Thanks,
Sourabh Verma
Post Reply