At 99/09/20 09:23 -0400, I wrote:
> From what I can tell, everything you need for HTML is already at hand,
>without needing to add a prefix:entity-ref at all.
I have stood all this time on my soapbox stating how XSLT already provides
all the recommended methods of getting you the reference in your
HTML file through proper markup techniques, and how you have no need to
hand-craft entity references in your output file.
What I haven't told you, but probably should, is that there *is* indeed a
way for you to do what you want *if* the XSLT engine has chosen to support
a feature of XSLT-19990813 that allows you to disable the output escaping
defined by the given output method.
But, and I repeat BUT(!!), this is not very portable since an XSLT engine
is not obliged to support the feature. Sitting in an ivory tower, it might
be considered not "right" since it gives a user enough rope to hang
themselves by allowing them to subvert the protections built in when using
the markup languages properly.
However, given that both XML and HTML escape the ampersand by putting out
"&" for what you need, this can be disabled such that the XSLT engine
actually emits "&" instead of "&". Note that when the output method is
text there isn't any escaping going on in the first place.
Attached below (with the HTML document element modified to not screw up my
mailer) is an example of how to subvert the protection of using entity
references. It happens that XT does implement this optional feature.
I hope this helps to understand the situation, but I also hope I've
convinced you earlier that the other ways I showed how to do this are the
"better" ways to do this.
X:\samp>sed s/html/hmtl/g disable.xsl
<xsl:output method="hmtl" indent="yes"/>
<xsl:template match="/"> <!--root rule-->
<xsl:text>This is an nbsp reference: '</xsl:text>
X:\samp>call xsl disable.xsl disable.xsl disable.htm
X:\samp>sed s/html/hmtl/g disable.htm
<!DOCTYPE hmtl PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<p>This is an nbsp reference: ' '.</p>
G. Ken Holman mailto:[log in to unmask]
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/l/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Website: XSL/XML/DSSSL/SGML services, training, libraries, products.
Practical Transformation Using XSLT and XPath ISBN 1-894049-01-2
Next instructor-led training: 1999-09-24, 1999-11-08, 1999-12-05/06,
1999-12-07, 2000-02-27/28, 2000-05-11/12