Page 1 of 1

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

Posted: Wed Oct 21, 2009 8:30 am
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

Posted: Wed Oct 21, 2009 9:16 am
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