xsl-list
[Top] [All Lists]

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

2009-12-24 05:22:04
So, if I am forced to generate XHTML, but also forced to serve it as
HTML then I am faced with this problem. This seems fair enough.

However, if I am generating XHTML, serving it as XHTML but wish to
begin a CDATA section half way through a passage of text then I am
doing everything correctly but also face a problem that cannot be
solved by XSLT 2. Is that correct?



On Wed, Dec 23, 2009 at 3:48 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:


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)

companies may have all kinds of guidelines, and sometimes thay have to
be followed, the guidelines can be wrong though.



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


the quoted page is misleading, it says:


This fixes the validator. The problem is that some older web browsers
don't understand the CDATA tag

That implies that understanding <!CDATA[ markup is something fixed in
newer browsers, but that is misrepresenting the situation. You can not
have a CDATA section (or any markup) in a script element in HTML. The
age of the browser is immaterial. Conversely if you generate XHTML and
serve it as XHTML then CDATA quoting is understood by the browser.  So
problems only occur if you generate XHTML and serve it as HTML. That
generates syntax errors but commenting out odd lines only masks some of
the problems, basically the whole document is then in error.

Probably I haven't convinced you and you'll want to do this anyway, in
which case, I'd use Martin's suggestion of writing the script to an
external file.

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>
--~--