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

Re: cdata output and different xslt processors

Subject: Re: cdata output and different xslt processors
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 29 Oct 2001 00:14:34 GMT
xslt cdata output

   I have been porting my presentation layer to use different backend
   processors.  So far using saxon-java has been the easiest except for it's
   handling of cdata.  I was wondering if the was a standard way of handling
   it, specifically "<" and ">"?

   To me, it would seem that the xslt processor should supply the markup
   without escaping it. I have seen a response on this from Mike Kay in a post
   on Oct 2000 saying:

   "Because the angle brackets are in a CDATA section, they are ordinary
   characters, not markup, so they have to be output as ordinary characters."

   My understanding is that whatever is between cdata brackets should be passed
   "as-is". Wouldn't this be easiest for people to understand?  I realize there
   must be some reason for Saxon not doing this. What is it? WHy do the other
   processors I have used not do this?

To any XSLT system (and any XML application) input of
<![CDATA[<aaa>]]> should be the same as input of &lt;aaa&gt;
an XSLT system just can't tell which form the source file had.
That is the whole point of CDATAS marked sections it's a convenience
feature for an author to save quoting each < and & individually
but the whole point is taht it should be equivalent to the quoted form.

   In a situation I have the workaround (xsl:text
   disable-out-put-escaping="yes") is ugly and does not produce the same
   results as cdata (that does not escape "<" or ">"). I have to (???) use
   cdata because i am trying to output some non-standard browser stuff, here is
   a snippet using xsl:text:

Why are you outputting this as text rather than as an element with

   <xsl:text disable-output-escaping="yes">

      &lt;DIV STYLE="position:absolute; padding:5px; background:menu;
   border:2px outset #cccccc;"&gt;

	 &lt;myMenu:menu id="Site" onsubmenu_click="doFunction()" &gt;Site
	   &lt;myMenu:menu id="mnItem_GenSite"&gt;Generate
	    &lt;myMenu:menu id="mnItem_PromoteSite"&gt;Promote
	    &lt;myMenu:menu id="mnItem_SiteMap"&gt;View
	    &lt;myMenu:menu id="mnItem_New_Site"&gt;Edit Another


maybe the answer to my question above is in the paragraph below, but
if so I don't understand. Given that your stylesheet is using the myMenu
namespace why do you want to avoid declaring it?

   Is there another way I can handle this?  I don't want to declare the
   namespace for the transformation on the server. I want it to be used only on
   the client.

   thanks for any help/insight,


This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.