Bad XML exported?

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
metabill
Premium Member
Premium Member
Posts: 26
Joined: Wed Aug 27, 2003 9:55 am

Bad XML exported?

Post by metabill »

Greetings. I'm using DataStage 5.1. When I export a job to XML, the XML contains an unescaped ampersand, which is invalid as an XML character. This causes grief for whatever XML parser I try. The text sequence occurs twice within a TrxOutput element; once as the text for a RoutineTransforms property: "", and again (same string) as the text for a Transform property in a Columns collection. I don't see anything in the job definition that would cause these strings to be included. The offending elements look something like the following (with surrounding tags removed):

<Property Name="RoutineTransforms">&#x1B;</Property>
<Property Name="Transform">&#x1B;</Property>

The text should instead be: &#x1B;

Has anyone else seen something like this? I can write code to search/replace for unescaped ampersands in the exported XML to fix the problem, but I was hoping for some type of explanation.

Thanks in advance!

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

Post by ray.wurlod »

Isn't &#x1B; the correct way in HTML to represent Char(27) (Esc?).

The # indicates that what's following is a character number (ASCII code, if you will), and the x indicates that the number is in hexadecimal format.
metabill
Premium Member
Premium Member
Posts: 26
Joined: Wed Aug 27, 2003 9:55 am

Post by metabill »

Ray is correct about what the value represents (thanks for the
insight!).

Indeed, it is an escaped representation of the character
corresponding to hex 1B, or 27 decimal, which is the
Unicode "escape" control character.

But this is not a legal XML character. The XML spec states
that the only legal character numbers below x20 are:
#x9 (Tab), #xA (LF), and #xD (CR)

So it seems that the DataStage export mechanism shouldn't
have exported this character.

I think I'll try just removing this value from the XML, import the
job back into DS, and see what happens (will the job break?).

Bill
Post Reply