You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ch...@daimlerchrysler.com on 2003/07/16 14:13:02 UTC

logicsheet problem - cocoon bug in xsp-request ?

Hi -

I've got a problem using logicsheets and I'm not shure whether I do something 
wrong or whether it's a bug
(seems like a bug to me up to now)...:

I use the xsp page writeuser.xsp:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-logicsheet href="dblogic.xsl"?>
<xsp:page language="java" 
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
    xmlns:util="http://apache.org/xsp/util/2.0" 
    xmlns:xsp="http://apache.org/xsp" 
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:dblogic="http://christian.com/db"
    >
    <page>
          <dblogic:connection>
                    <dblogic:insert tablename="user" keyname="uid"  >
                        <dblogic:column name="name"/>
                        </dblogic:insert>
            </dblogic:connection>
    </page>
</xsp:page>



And the logicsheet dblogic.xsl:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xsp="http://apache.org/xsp"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
     xmlns:dblogic="http://christian.com/db"
    version="1.0">


<xsl:template match="xsp:page">
 <xsl:copy>
     <xsp-request:get-parameter name="user.name" default="r" as="string"/>
  <xsl:apply-templates select="@*"/>
  <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

<xsl:template match="dblogic:connection">
    <xsp:logic> String newid="";</xsp:logic>
        <esql:connection>
            <xsl:apply-templates select="@*|node()"/>
                    </esql:connection>
    </xsl:template>
    ...


Whe cutting out the line 
<xsp-request:get-parameter ...
everything is fine.

When trying to insert the xsp-request tag, I get an compiler error from the 
generated java file writeuser_xsp.java.
Looking at the java file, I see that the package line is not correct:

package ;

    import java.io.File;
    import java.io.IOException;
    import java.io.StringReader;
    //import java.net.*;

I use cocoon 2.1m2

Is this a bug ?

Thank you, regards -
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: logicsheet problem - cocoon bug in xsp-request ?

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Christian,

seems to be a standard XSLT error in your logicsheet:

> <xsl:template match="xsp:page">
>  <xsl:copy>
>      <xsp-request:get-parameter name="user.name" default="r" as="string"/>
>   <xsl:apply-templates select="@*"/>

You can't add attributes to an element that already has a child node. So 
simply change the two above lines and it maybe works.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org