cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: bug into the xsp-java.xsl
Date Fri, 12 Jan 2001 20:35:37 GMT
On Fri, 12 Jan 2001, SoftLiban MOODAD Shadi wrote:

> When I tied to write the following code in an XSP file
>
>
> document.appendChild(document.createProcessingInstruction("cocoon-process","type=\"xslt\""));
>
>
> document.appendChild(document.createProcessingInstruction("xml-stylesheet","
> href=\"Magasin.fo.xsl\" type=\"text/xsl\" "));

you shouldn't be manipulating the DOM directly. that's not portable
between XSP implementations.

> An error 'undefined variable document  and undefined xspCurrentNode' was
> returned as a result of the request of the specified file
>
> I found that the problem was in the "xsp-java.xsl" file in the
> "src\org\apache\cocoon\processor\xsp" of the cocoon directory
>
> In fact:
>  in line 94 of the following code "of the xsp-java.xsl" file
>
>   public class <xsl:value-of select="@name"/> extends XSPPage {
>       /* User Class Declarations */
>       <!-- Here is the problem
>        <xsl:apply-templates select="xsp:logic" />
>       end of problem-->
>       public void populateDocument(
>         HttpServletRequest request,
>         HttpServletResponse response,
>         Document document
>       )
>         throws Exception
>       {
>  // Node stack logic variables
>         Node xspParentNode = null;
>         Node xspCurrentNode = document;
>         Stack xspNodeStack = new Stack();
>
> <xsl:apply-templates select="xsp:pi"/>
> <xsl:apply-templates select="xsp:logic" />
>
>  <xsl:variable name="create-session">
>    <xsl:choose>
>      <xsl:when test="@create-session = 'true'">true</xsl:when>
>      <xsl:otherwise>false</xsl:otherwise>
>
> the code that is written in the italic  form must be moved to into the
> populateDocument methode 'bold italic' line 106

i'm assuming you marked this up in HTML? most of us have plain text email
clients.

> Another problem:
>  When we add the following
>
>  <xsp:pi targe="..." >
>    ....
> </xsp:pi>
>
> the cocoon don't process it

the proper attribute name is target - hope this was just a copy problem.
i've never had any problems with xsp:pi.

i suspect your general problem is that you're trying to do xsp stuff
inside your own methods. that's very tricky to do right now.

- donald


Mime
View raw message