Re: [xslt] handling of < in CDATA sections



On Tue, Feb 22, 2005 at 11:30:17AM +0100, Roel Vanhout wrote:
> Although it does seem like cheating, this could indeed work. According 
> to http://www.w3schools.com/xsl/el_processing-instruction.asp (and 
> various other pages I found on this element), if I'd write
> <xsl:processing-instruction name="php">
>   $var = 0;
> </xsl:processing-instruction>
> that should produce
> <?php
>   $var = 0;
> ?>
> 
> Unfortunately it seems that xsltproc makes that
> <?php
>   $var = 0;
> >
> (notice the missing ? in the close tag of the PI). I've also tried 
> putting in an xsl:text node around the $var = 0; but that didn't help. 
> Am I reading the examples wrong or maybe doing something else wrong?

  An XML PI does not end with ?> but with >
so ....

<xsl:processing-instruction name="php">
  $var = 0;
?</xsl:processing-instruction>

should do what you want !

Daniel

P.S.: all this is not xsltproc specific, it's just XML and XSLT specs !

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]