Re: Retaining '&' after transforming XML to HTML via XSL

Subject: Re: Retaining '&' after transforming XML to HTML via XSL
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 26 Jun 2000 13:58:41 -0600 (MDT)
> I would like to retain an ampersand ('&') in an HTML stream

I'd call it an almost-HTML stream, then.

'Authors should use "&amp;" (ASCII decimal 38) instead of "&" to avoid
confusion with the beginning of a character reference (entity reference
open delimiter). Authors should also use "&amp;" in attribute values
since character references are allowed within CDATA attribute values'

> The &amp; is unacceptable as the microbrowser interpreting the
> resultant HTML will not recognize the entity.

This microbrowser does not implement HTML very well at all, then. If it
doesn't purport to support HTML's character set (the full Unicode /
ISO/IEC 10646-1 / UCS), then I would hope it would at least recognize the
SGML entities for the U-00000000 to U-000000FF character range, so that
ISO-8859-1 encoded documents could be handled.

> MSXML parser.  The version of the
> parser in use also does not support <xsl:text> or <xsl:copy-of>.  

This means disable-output-escaping won't work either, which is what you
would need. It doesn't matter what is in the stylesheet; what matters is
what goes into the result tree. '&' will be in the result tree whether
you use &amp; or &#38; or <![CDATA[&]]>. Serialization of the result tree
via the html output method is what causes the &amp; to be output, and
there's nothing wrong with that.

Sorry to not be of much help, but it sounds like the real problem is your
microbrowser, whatever that may be.

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread