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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncated text with entity references

Status
Not open for further replies.

cardy

Technical User
Sep 5, 2000
33
GB
Anybody know why, when I parse the following -

Code:
<foo>fred & amp; barney</foo>

I get
Code:
barney
instead of
Code:
fred & barney

i.e. the ampersand and the text to it's left are lost. The same happens with &quot; and I suspect will happen with other entity references.

Please note - I had to put a space between the & and amp; to get the post to display properly. In my real code there is no space.
 
You're probably going to have to give us more context than that. If you put the following code in a file and display the file in IE, it displays as expected.
Code:
<?xml version=&quot;1.0&quot;?>
<root>
  <foo>Fred & amp; Barney</foo>
</root>
So what, exactly, are you doing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top