Naegeli,
Let me make sure if I understand this correctly. From your code I think you
have 2 files for doing this right? You have a XSP/XML file which is further
processed by a XSL file?
Or can this be done in one file?
Thanks for your help.
-kng
> -----Original Message-----
> From: Naegeli Margrit [mailto:margrit.naegeli@ecofin.ch]
> Sent: Monday, July 31, 2000 7:44 AM
> To: 'cocoon-users@xml.apache.org'
> Subject: RE: permit quoting
>
>
> I "outsource" all the JavaScript-code for one page in a file of
> type .js and
> include it like this:
>
> in the xml:
> <page name="foo" script="foo.js">
>
> in the xsl:
> <xsl:template match="page">
> <xsl:processing-instruction name="cocoon-format">
> type="text/html"
> </xsl:processing-instruction>
> <html>
> <head>
> <title>
> <xsl:value-of select="@name"/>
> </title>
> <script language="JavaScript" type="text/javascript"
> src="{@script}">
> ...
>
> The browser then fetches the .js-file just like it'd get a
> stylesheet or an
> image, and in the actual html all you have is the call to the
> javascript-function.
>
> I must admit that I have not yet tested this with older browsers,
> but I like
> this solution because it also separates content and logic on the client
> side. Maybe it helps you.
>
> regards
> maggie
>
> -----Original Message-----
> From: Kaufman Ng [mailto:kaufman.ng@viant.com]
> Sent: Monday, July 31, 2000 12:58 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: permit quoting
>
>
>
> 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 </tr> 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>
> > </tr><tr>
> > </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
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
|