You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Amend, Hanspeter {PDN~Tokyo}" <HA...@Roche.COM> on 2001/09/21 12:20:49 UTC

no output escaping with cocoon

I would like to have an xsl file generate an HTML containing Javascript.
Cocoon rejects output-escaping. 

<xsl:template match="SCRIPT">
  <script language="javascript">
    <xsl:text disable-output-escaping="yes">
      &lt;!-- if (
         location.host.tolowercase().indexof("ibiblio")
         &lt; 0) {
           location.href="http://www.ibiblio.org/xml/";
        }
      } // --&gt;
    </xsl:text>
  </script>
</xsl:template>


thanks,
 		Hanspeter Amend 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: no output escaping with cocoon

Posted by Mario Muja <ma...@delaval.com>.
Hi Hanspeter,
The XSL stylesheet is processed by the XSLT processor used (probably 
Xalan) and not by Cocoon. Anyway, if you like to include some 
JavaScript, you should use <xsl:comment> around the Script code. Then 
output-escaping will not be an issue. For example, write:

    <xsl:comment>
      <!-- if (
         location.host.tolowercase().indexof("ibiblio")
         &lt; 0) {
           location.href="http://www.ibiblio.org/xml/";
        }
      } // -->
    </xsl:comment>

Best Regards,
Mario Muja



Amend, Hanspeter {PDN~Tokyo} wrote:

>I would like to have an xsl file generate an HTML containing Javascript.
>Cocoon rejects output-escaping. 
>
><xsl:template match="SCRIPT">
>  <script language="javascript">
>    <xsl:text disable-output-escaping="yes">
>      &lt;!-- if (
>         location.host.tolowercase().indexof("ibiblio")
>         &lt; 0) {
>           location.href="http://www.ibiblio.org/xml/";
>        }
>      } // --&gt;
>    </xsl:text>
>  </script>
></xsl:template>
>
>
>thanks,
> 		Hanspeter Amend 
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>