Re: [xsl] disable-output-escaping don't work with CDATA spl chars (XSL)

Subject: Re: [xsl] disable-output-escaping don't work with CDATA spl chars (XSL)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 29 Mar 2005 17:45:55 +0100
Ah now your input got through!


that wasn't how it appeared the first time (the character was there
directly not the character reference)

that is very strange input, CDATA only has one function, to say that <
and & are normal characters within the marked region.

So that is explictly saying that the input is equivaent to   <AccomUnitName

and that the & # 2 4 6 is _not_ a character reference.

XSLT will see identical input from either of the above two forms.
which is almost certainly not the intended unput.

  results in: Aparthotel G&#246;tzens 
  in the javascript array (and so in html) 

  instead of the correct value: Aparthotel Gvtzens

Yes of course, that is the sole function of a CDATA marked section, to
have that effect.

  (2) But while generating javascript like:
  var accList=new Array(
  <for-each ...> 
  ><xsl:value-of select="AccomUnitName"
  The array results like:
  var accList=new Array("xyz,123,Aparthotel

which means that the d-o-e worked, otherwsie it would have come out as

   var accList=new Array("xyz,123,Aparthotel
If you were generating XHTML that would be the right thing, but in HTML
a script element is a CDATA element (an element category that does not
exist in XML) which means that it works as if an implied CDATA section
is around the content and so within an HTML script element & #246;
does not refer to the character with number 246 but rather to the
6 character & h 2 4 6 ;

If you have any control over the input at all, just not having the CDATA
section there is the correct solution.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread