Re: Urgent !!! '&' being replaced by '&'

Subject: Re: Urgent !!! '&' being replaced by '&'
From: Mike Brown <mike@xxxxxxxx>
Date: Sun, 6 Aug 2000 12:16:25 -0600 (MDT)
Mahesh Nanavate wrote:
> I am facing a problem.The "&" in the 'headline' element value of "&apos;"
> is  being replaced by &amp;.

The code snippet you posted didn't seem to be the right one. 

Also note that all parsed general entity references in your original XML
and in your stylesheet are resolved during the parsing stage, before the
trees represented by those documents are exposed to the XSLT processor.
Any markup characters (& < > ' ") that survive parsing and make it into
the result tree are going to be non-markup character data that will be
serialized as entity references appropriately upon output.

You should step back and answer this question first:
Why do you feel you need &apos; in the output?

The XSLT processor should be smart enough to know when it &apos; is really
necessary. The only time it is necessary is when instances of "'" occur in
the value of an attribute that is going to be serialized with "'" as the
delimiter -- otherwise one wouldn't know where the attribute value ends.

Example:

	<foo title='Isn&apos;t that special?'>

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread