[Expat-discuss] Problem parsing a string with special character '&'
nickmacd at gmail.com
Mon Dec 5 16:59:34 CET 2005
Reading the XML 1.1 standard document (from
http://www.w3.org/TR/2004/REC-xml11-20040204/ ) in section 2.4 you find the
The ampersand character (&) and the left angle bracket (<) MUST NOT appear
in their literal form, except when used as markup delimiters, or within a
comment, a processing instruction, or a CDATA section. If they are needed
elsewhere, they MUST be escaped using either numeric character references or
the strings "&" and "<" respectively. The right angle bracket (>) MAY
be represented using the string ">", and MUST, for compatibility, be
escaped using either ">" or a character reference when it appears in the
string "]]>" in content, when that string is not marking the end of a CDATA
So, when you used & did you include the semicolon?
(Note, I personally have not tested this recommendation in Expat, but it
makes sense from my reading of the XML spec.)
On 12/5/05, shakeel.ahmed at wipro.com <shakeel.ahmed at wipro.com> wrote:
> I'm having problems parsing an XML document with a tag <audio
> I get a XML parsing error everytime I use the special character & in the
> string. Tried using & instead, but it does not help.
> Expat is able to parse other characters like '!' etc.
> Would greatly appreciate any suggestions/solutions for this problem.
NickMacD at gmail.com
More information about the Expat-discuss