Wednesday, September 22, 2004
Defining Entities in Xslt
I am always forgetting how to define entities in xslt stylesheets. Here is a simple sample.
This is particularly relevant when trying to insert a non-breaking space with xslt--a particularly esoteric task. I have heard that setting the output to ASCII instead of UTF-8 will ensure that the above non-breaking space is included in the output. I believe &#A0; is the unicode character.
Another option is this apparently, though I have heard it is not predictable.
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp ' '>
]>
This is particularly relevant when trying to insert a non-breaking space with xslt--a particularly esoteric task. I have heard that setting the output to ASCII instead of UTF-8 will ensure that the above non-breaking space is included in the output. I believe &#A0; is the unicode character.
<xsl:output method="html" encoding="ASCII" omit-xml-declaration="no" version="4.0" />
Another option is this apparently, though I have heard it is not predictable.
<xsl:text>&#160;</xsl:text>
Comments:
Post a Comment