xsl-list
[Top] [All Lists]

Re: [xsl] using xsl:output-character to render characters in 2 ways

2009-12-23 10:16:59
I think I do need to do it. I cannot serve html as this would break my
company's accessibility guidelines (eg unclosed img tags), I must use
the XHTML output method. Using this method I have provided 2 examples
of what I need to achieve:

1. I need to create a '<![CDATA[]]>' section in the output
(http://javascript.about.com/library/blxhtml.htm explains why)

2. I need the string 'Financial Times, "Erdoğan Grubu'na"' to be
rendered in an attribute.


As far as I can tell your suggestion doesn't allow me to implement
number 1 and using character maps doesn't allow me to implement number
2.


On Wed, Dec 23, 2009 at 11:40 AM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

Yes, that works, but I thought it was deprecated. Is there no better
way in XSLT 2?

Not really, but you should never need to do this anyway.

If you are serving the result as text/html, use the html output method
and then no quoting is necessary (or possible) in HTML script element.

If you are serving as application/xhtml+xml use the xhtml output method
and allow the system to quote using either CDATA section or & lt entity
references, and any browser that understands application/xhtml+xml
will understand this quoting and pass the correct characters to the
javascript engine.

David



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--