cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SoftLiban MOODAD Shadi <shadi.moo...@softsolutions.fr>
Subject bug into the xsp-java.xsl
Date Fri, 12 Jan 2001 13:49:19 GMT
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\" "));

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

Another problem:
 When we add the following

 <xsp:pi targe="..." >
   ....
</xsp:pi>

the cocoon don't process it
so to solve that problem I have added into the "xsp-java.xsl" the
following tag

   <xsl:apply-templates select="xsp:pi"/>

just before the <xsl:apply-templates select="xsp:logic"/>
 

                                                                                                                       
Shadi Moodad
                                                                                                                               
SoftSolution-Liban

Mime
View raw message