[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] xslt breaks css with a ]]> tag!
Subject: Re: [xsl] xslt breaks css with a <![CDATA[ <img/> ]]> tag! From: David Carlisle <davidc@xxxxxxxxx> Date: Sat, 9 Sep 2006 23:02:27 +0100 |
Remember that XSLT has no connection with CSS (or HTML or javascript or anything else used to render the page in the browser). The XSLT engine, whether iy is running on the server runs before the rendered document is processed by the page layout engine and that just renders what is there. <element><![CDATA[Name2 <img src="http://www.google.com/images/logo_sm.gif" height="20px" /> Name]]></element> If you have any control over your input it would be much better to have <element> src="http://www.google.com/images/logo_sm.gif" height="20px" /> </element> as the _only_ purpose f CDATA is to inform the processor that the <img is_not_ a tag, when clearly you want it to be processed as a tag. <div class="box"><xsl:value-of select="element" disable-output-escaping="yes"/></div> d-o-e is explictly an optional feature of xslt and a processor can igonre it. In particular most processors can not support it if they are outputting a result tree as a tree ratherthan a linearised document, as then the output escaping (if it ever happens at all is under the control f whatever application uses the tree. One notable system that always outputs as a DOM tree is the one in mozilla. > Well, what makes it all the more interesting is if you remove > the <img/> tag from the CDATA, oh look! it works like it > should!! If you rephrase that more acurately as "if you have an image tag rather tahn the character data < i m g then it includes an inage as expected. David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xslt breaks css with a <!, Steve | Thread | [xsl] Removing all line breaks in t, Mark Peters |
Re: [xsl] Sum in conjunction with s, David Carlisle | Date | [xsl] Removing all line breaks in t, Mark Peters |
Month |
Keywords