[xsl] cdata output and different xslt processors

Subject: [xsl] cdata output and different xslt processors
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Sun, 28 Oct 2001 14:28:05 -0800
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?

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:

<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
Site&lt;/myMenu:menu&gt;
         &lt;myMenu:menu id="mnItem_PromoteSite"&gt;Promote
Site&lt;/myMenu:menu&gt;
      	&lt;myMenu:menu
id="mnItem_EditProps_Site"&gt;Properties&lt;/myMenu:menu&gt;
         &lt;myMenu:menu id="mnItem_SiteMap"&gt;View
Sitemap&lt;/myMenu:menu&gt;
         &lt;myMenu:menu id="mnItem_New_Site"&gt;Edit Another
Site&lt;/myMenu:menu&gt;
      &lt;/myMenu:menu&gt;

....snip.....

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,
-Rob


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


Current Thread