cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: xsl question
Date Mon, 26 Feb 2001 01:33:17 GMT
On Mon, 26 Feb 2001, Klaus Drechsler wrote:

> ><xsl:template match="mytag:content">
> >   <xsp:logic>
> >     if (true
> >     <xsl:for-each select="mytag:bool">
> >       &amp;&amp; <xsl:apply-templates select="."/>
> >     </xsl:for-each>
> >     ) {
> >       <xsl:apply-templates select="mytag:ok"/>
> >     } else {
> >       <xsl:apply-templates select="mytag:error"/>
> >     }
> >   </xsp:logic>
> ></xsl:template>
> >
> ><xsl:template match="mytag:bool | mytag:ok | mytag:error">
> >   <xsl:apply-templates/>
> ></xsl:template>
>
> Thank you for your very fast answer. But this does not work. The produced
> source code looks like this:
>
> ...
>          if (true
>              && this.characters("yourObj.isNew()");
>              && this.characters("myObj.isNew()");) {
>
>          } else
> ...
>
> In the browser window I got the following error message:
>
> Line 0, column 0:
> C:\jakarta-tomcat-4.0-b1\work\localhost\cocoon\_C_\_jakarta_tomcat_4_0_b1\_webapps\_cocoon\_dbprakhouse\_test_xsp.java:352:
> ')' expected. && this.characters("request.getSession(false).isNew()");
> ...
>
> Those semicolons (";") are wrong there ...
>
> It should produce the following sourcecode:
>
> ...
>          if (true
>              && this.characters("yourObj.isNew()")
>              && this.characters("myObj.isNew()")) {
>
>          } else

er, no, it shouldn't be producing the this.characters() method calls even.
looks like the default action for text in that context is to output
characeters - which is odd, i would have thought that since the text's
parent node is xsp:logic, it'd be assumed to be logic. oh well. try this
instead:

<xsl:template match="mytag:bool | mytag:ok | mytag:error">
  <xsp:expr><xsl:value-of select="."/></xsp:expr>
</xsl:template>

but you know, it rather looks like a bug in the c2 xsp engine. anyone want
to take a look? for the record, the xml he wants to use the logicsheet
upon was:

<mytag:content>
        <mytag:bool>myObject.isTrue()</mytag:bool>
        <mytag:bool>yourObject.isTrue()</mytag:bool>
        ...
        <mytag:ok>myObject.someMethod()</mytag:ok>
        <mytag:error>yourObject.someMethod()</mytag:error>
</mytag:content>

- donald


Mime
View raw message