You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by SoftLiban MOODAD Shadi <sh...@softsolutions.fr> on 2001/01/12 14:49:19 UTC

bug into the xsp-java.xsl

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

Re: bug into the xsp-java.xsl

Posted by Donald Ball <ba...@webslingerZ.com>.
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


Re: bug into the xsp-java.xsl

Posted by Donald Ball <ba...@webslingerZ.com>.
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