Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid escaping of "<" in value of attribute nodes.

Status
Not open for further replies.

AnilKumar

Programmer
Dec 5, 2000
26
IN
Hi ,
I have char '<' in value of a attribute node , when I serialise this document it is escaped to &lt; . how can I avoid this.
thanks for the help.
Anil.
 
You can't. XML needs certain characters to work, and the '<' is one of them. It should get escaped to '&lt;', and hopefully unescaped back when you read the node's text value. Search the XML specs for &quot;entities&quot;.

Chip H.
 
I use < in place of the < in a value such as:

for (i = 0; i < itemArray.length; i++)

I put:

for (i = 0; i &-#-6-0; itemArray.length; i++)
TAKE OUT THE DASHES!

and it works just the same and doesn't error out the xml document.

Hope it helps!
It drove me NUTS at first. :)
 
Thanks for the tip, westcoaststyle.

When posting code in tek-tips, you can use the
Code:
 and
flags to post stuff that otherwise would be interpreted wrong.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top