My experience with the ampersand was that it needed the   entity to work. 
Otherwise, & translates the & to & and then the parser complains about 
the "amp" part.

Finally, I used the above entity, but also enclosed each line of javascript 
with <xsl:text> paired tags.

..\Wendy
Wendy Bossons
Senior Software Engineer
MIT Libraries
Software Analysis & Development
Building E25-131
77 Massachusetts Ave.
Cambridge, MA 02141-4307
Phone 617-253-0770
Fax     617-253-4462
[email protected]<mailto:[email protected]>
http://libraries.mit.edu


On Feb 10, 2011, at 4:32 AM, helix84 wrote:

On Wed, Feb 9, 2011 at 00:13, stuart yeates 
<[email protected]<mailto:[email protected]>> wrote:
On 09/02/11 08:36, helix84 wrote:
On Tue, Feb 8, 2011 at 16:43, Wendy J 
Bossons<[email protected]<mailto:[email protected]>>  wrote:
The 10,000 dollar question - Is it possible to allow CDATA output in the
head of a DSpace document? I want to add some javascript that contains an&
and cannot get the source output to include CDATA tags. I am writing it in
the structural.xsl this way . . . Everytime I view the html source, all I
get are the //, no cdata tags. They have been stripped.
<script type="text/javascript>
//<![CDATA[
....
// ]]>

Well, I'm not sure that's even possible. But there's a simple
workaround, just have your CDATA in a separate javascript file and
include it in head.

The alternative is to XML-encode the javascript. this involves replacing:

& with &amp;
< with &lt;
 > with &gt;

I tried several variations of that but it never worked. E.g. this one:
<script type="text/javascript>
&lt;![CDATA[
....
]]&gt;

will just output the entities literally to HTML.

Can you provide a working snippet?

Regards,
~~helix84

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to