[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-xml
Subject:    Re: [Fwd: RE: XSLT with CDATA tag]
From:       Carsten Milling <cmil () hashtable ! de>
Date:       2004-05-14 0:29:41
Message-ID: 20040514002941.GM13939 () hashtable ! de
[Download RAW message or body]

On Thu, May 13, 2004 at 07:32:15PM -0400, Larry Siden wrote:
> You know, Carsten, I think the CDATA sections in output were correct.  I
> believe that I read somewhere that XSLT will throw CDATA delimiters
> around anything that is "special", including ';' and other things likely
> to be found in a Javascript section.  HTML browsers are supposed to
> recognize Javascript that is enclosed in CDATA delimiters.  This is
> according to http://www.w3.org/TR/xhtml1/#h-4.8.  But I read somewhere
> else that in practice, browsers don't recognize the CDATA delimiters, so
> they need to be stripped.  I know this is beginning to sound like
> folklore!

Or you may mask the delimiters as javascript comments like so:

<script>
  //<![CDATA[
  if (0 < 1) alert('Achtung!');
  //]]>
</script>

But this would be even more tricky on the XSLT side. That's why I
suggested to use an external file in the first place.


> Instead, I tried using XML::Twig to strip off the CDATA.  This worked. 
> I still have problems with my output, but I think they're no longer
> related to this issue, but to my own programming issues.

Damn, Michel prevailed ... ;)

> For the record, I have libxml2 2.6.7, XML::LibXML 1.5.8 and XML::LibXSLT
> 1.57 and libxslt 1.1.4.  If you want my credit card number I ain't
> giving it to no one!

No need to be snappish here. It was you who asked for help after all.

> -ls

Carsten
_______________________________________________
Perl-XML mailing list
Perl-XML@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic