cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaufman Ng" <kaufman...@viant.com>
Subject RE: permit quoting
Date Mon, 31 Jul 2000 10:57:38 GMT

I have a similar problem.  I wanna to include some Javascript code into my
XSP page.  My XSP page does not use XSLT at all.  Since cocoon 1.7.x has a
bug in disable output escaping, is there any workaround to do this?

Thanks.


> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Wednesday, July 26, 2000 3:42 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: permit quoting
>
>
> On Wed, 26 Jul 2000 tcurdt@dff.st wrote:
>
> > > > What about javascript inside the HTML page. Well, you can pass it
> > > > as long it is inside the xsl:comment tag. Which should be ok for
> > > > most reasons. But as far as I know javascript can and sometimes
> > > > even is supposed to live outside a comment tag. What's up then?
> > > > How do I get the '<' character?
> > >
> > > Easy, like this:
> > > <script language="javascript" type="text/javascript">
> > > 	<![CDATA[
> > > 	<!--//
> > > 	javascriptcode
> > > 	//-->
> > > 	]]>
> > > </script>
> >
> > Hm... so why does my <![CDATA[ </tr> <tr> ]]> not get passed
> > then? All I get is &lt/tr&gt etc.
>
> Because of context. This fragment:
>
> <script>
> <![CDATA[
> if (i > 0) { alert("hi"); }
> ]]>
> </script>
>
> will be serialized by the HTMLFormatter as
>
> <script>
> if (i > 0) { alert("hi"); }
> </script>
>
> the HTMLFormatter knows that the angle bracket entities should be printed
> as characters, not entities, when they appear inside a script element.
>
> This fragment:
>
> <table>
> <tr>
> <![CDATA[
> </tr><tr>
> ]]>
> </tr>
> </table>
>
> will be serialized by the HTMLFormatter as
>
> <table>
> <tr>
> &lt;/tr&gt;&lt;tr&gt;
> </tr>
> </table>
>
> because, essentially, your CDATA section is telling the parser to treat
> "</tr><tr>" as text, not elements. XSLT doesn't work well when you try to
> use it to construct trees in an unbalanced fashion.
>
> cocoon _should_ support the disable-output-escaping flag, you're
> absolutely correct, but i don't think anyone's actively working on fixing
> that. most of the developers seem to feel that it's a dangerous shortcut
> and it's not worth fixing in cocoon1 when there's so much else to be done.
> if you want submit a patch for cocoon1 to add support for the XSLT output
> indicator elements, i'd be delighted to incorporate it.
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


Mime
View raw message