xsl-list
[Top] [All Lists]

RE: HOWTO: Internet Explorer conditional comments in XSLT 1.0

2005-11-01 01:57:01
I'm not sure you emphasize strongly enough the key limitation in this
approach: in the data model, comments cannot contains elements, they can
only contain strings; so you need to construct your content as a string in
which the markup is hand-generated. If the stuff between IE's conditional
comments gets complicated then this is going to become a pain, especially
if
you have to produce it by modifying existing stylesheets that were
designed
to produce the content as real element trees.


Yes, it's true that the approach could be messy for anything too complex.
I probably didn't emphasise enough that I was thinking of this primarily
in the context of generating a straightforward <link> as in the example,
as that seems to address the original problem of applying CSS hacks in a
clean manner.

The stuff on result-tree-fragments is a bit tangential. The content could
just as well be a string. There's no special RTF "magic" here. All that's
happening is that when a string contains the "<" character, and the string
is used to form the body of a comment, the "<" is left as a "<" and isn't
escaped to "&lt;".


Good point; I'll have to rework that bit. Thanks :-)

Incidentally, you also have to worry about the fact that the comment can't
contain "--" (and therefore, can't contain nested comments).


To be honest, I haven't ever experimented with including comments inside a
conditional comment; I wonder if it would break...

Thanks for your comments; I'll update the article to reflect these points
(as soon as I get some time free from work).

Cheers,

Nick.

Michael Kay
http://www.saxonica.com/


-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/

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



<Prev in Thread] Current Thread [Next in Thread>