Generating Numeric Character Reference in HTML
Posted: Wed Mar 09, 2016 3:31 am
Hello.
I am trying to generate an HTML document with XSLT that can contain a numeric character reference in the output. I n many cases, the XSLT works with 'normal' characters, e.g., non-breaking space character (Š), etc., since all browsers can successfully interpret them when they are output as literal values.
However, my documents contain certain characters that lie outside the normal Basic Multilingual Plane. When XSLT transforms these as literal characters, many browsers have trouble interpreting them, even though the font called out in the CSS does contain a glyph for the applicable codepoint. Consequently, for these special characters, I need to generate a numeric character reference in order to ensure satisfactorily rendered HTML.
My current method for outputting the character is using <xsl:text>, e.g.,
XSLT however, resolves this entity to its literal value, which, as I said, is not a reliable means of rendering the desired character in HTML.
How do I guarantee that the numeric character reference is output instead of the literal value?
Thank you.
I am using OxygenXML 17.1 on Windows 7 (64-bit). My stylesheets are XSLT v2.0.
I am trying to generate an HTML document with XSLT that can contain a numeric character reference in the output. I n many cases, the XSLT works with 'normal' characters, e.g., non-breaking space character (Š), etc., since all browsers can successfully interpret them when they are output as literal values.
However, my documents contain certain characters that lie outside the normal Basic Multilingual Plane. When XSLT transforms these as literal characters, many browsers have trouble interpreting them, even though the font called out in the CSS does contain a glyph for the applicable codepoint. Consequently, for these special characters, I need to generate a numeric character reference in order to ensure satisfactorily rendered HTML.
My current method for outputting the character is using <xsl:text>, e.g.,
Code: Select all
<xsl:text>𐆘</xsl:text>
How do I guarantee that the numeric character reference is output instead of the literal value?
Thank you.
I am using OxygenXML 17.1 on Windows 7 (64-bit). My stylesheets are XSLT v2.0.