How to handle xml data of following type '&lt'

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
anusha
Premium Member
Premium Member
Posts: 37
Joined: Wed Nov 28, 2007 1:29 am
Location: pune

How to handle xml data of following type '&lt'

Post by anusha »

Hi,

I am getting a tag in xml file that contains following data.

<Operator>&lt=;</Operator>

My seting for the colmn are Varchar. But iam getting the data in database as &lt=;

Actually the data amp; is missing.

Could anyone help in resolving the issue..it could be a great help
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

That's because it is likely that's the actual value (meaning -- it is correct). When xml is created, certain characters are "escaped"..this means that they are changed so that they can be represented in the content and not confuse some other parser.... so..... the '&' becomes '&amp' .....

When parsed by a standard xml parser (as in DataStage), the escaping is reversed, yielding back the original string, or &lt=;

A useful test in such circumstances is to create your own little test document with the string, and then open it up in IE, which uses industry standard parsing technology also. You will see your &lt=;, as you should.

<?xml version="1.0" ?>
<mydoc>
<Operator>&lt=;</Operator>
</mydoc>


Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply