[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xslt breaks css with a <![CDATA[ <img/> ]]> tag!

Subject: Re: xslt breaks css with a <![CDATA[ <img/> ]]> tag!
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 9 Sep 2006 23:02:27 +0100
cdata img
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.