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!

Using XML and ampersands 1

Status
Not open for further replies.

markdt

Technical User
Feb 15, 2006
63
GB
Hi People,

Ive got a slight problem. Im trying to display an xml document but some of the fields relate to customers. Of which some have "&" in their name.

It doesnt seem to like this and errors e.g.

A semi colon character was expected. Error processing resource 'file:///M:/Inetpub/ Line 1054...

<CUSTOMER>H&H</CUSTOMER>
-------------^
PAN> <A1>06/10/2004</A1>
<QUOTED />
</PROJECT>
- <PROJECT>
<PNUM>420</PNUM>
<SALESMANNAME>N/A</SALESMANNAME>
<MANAGER>N/A</MANAGER>

Any help on this problem would be grately appreciated.

Thanks
 
The ampersand must be escaped as [tt]&amp;[/tt] (ampersand a m p semicolon), so the creator of the XML-like document is not quite doing it correctly. The ampersand is used to start an entity reference and the semicolon terminates the name of the entity. The parser, seeing the ampersand, was looking for a semicolon so that it could then evaluate the entity reference.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top