Bug in Cocoon2 ?

We are about to migrate our Cocoon 1.8 application to Cocoon2.0.3. We are experiencing some problems with <xsp:page> and <get-nested-contet> template. Can anyone provide us a reasonable solution ? Why do we get different results, when we do the transformation steps manually ?

the xsp file, original(Cocoon 1.8):

<?xml version="1.0" encoding="UTF-8"?>

<xsp:page

language="java"

xmlns:xinclude="http://www.w3.org/1999/XML/xinclude"

xmlns:xsp="http://apache.org/xsp"

xmlns:session="http://apache.org/xsp/session/2.0"

xmlns:ecommerce="http://www.asset.sk/1999/XSP/ecommerce"

xmlns:utils="http://www.asset.sk/1999/XSP/utils"

xmlns:request="http://apache.org/xsp/request/2.0"

xmlns:response="http://apache.org/xsp/response/2.0"

xmlns:esql="http://apache.org/cocoon/SQL/v2"

<result>

<ecommerce:store-items>

<item name="mid">

<value>main</value>

</item>

<item name="internal_link_count">

<value>

<ecommerce:get-link-count/>

</value>

</item>

</ecommerce:store-items>

</result>

</xsp:page>

the ecommerce logicsheet:

<xsl:template match="ecommerce:store-items">

<xsp:logic>

<xsl:for-each select="item">

<xsl:variable name="val">

<xsl:call-template name="get-nested-content">

<xsl:with-param name="content" select="value"/>

</xsl:call-template>

</xsl:variable>

EcommerceTaglib.storeItem("<xsl:value-of select="@name"/>",

<xsl:copy-of select="$val"/>, false, store);

</xsl:for-each>

</xsp:logic>

</xsl:template>

results Java file main_xml.java

EcommerceTaglib.storeItem("mid",

this.characters("main"); <---------- this is the problem!!!

, false, store);

EcommerceTaglib.storeItem("internal_link_count",

this.characters("\n ");

<---------- where do the empty lines come from?!

(

/* begin of ecommerce:get-link-count */

String.valueOf(EcommerceTaglib.getLinkCount())

/* end of ecommerce:get-link-count */

)

this.characters("\n ");

, false, store);

When we transform it (using our ecommerce.xsl and Cocoon2.0.3 xsp.xsl) manually using the Saxon transformer, we get:

EcommerceTaglib.storeItem("mid", "main", false, store);

EcommerceTaglib.storeItem("internal_link_count",

(

/* begin of ecommerce:get-link-count */

String.valueOf(EcommerceTaglib.getLinkCount())

/* end of ecommerce:get-link-count */

)

,false, store);

what is exactly what we expected. This pages used to work well in Cocoon1.8.

Does anyone know, why do we get ... this.characters() ... on argument to the logicsheet function EcommerceTaglib.storeItem when compiled by Cocoon 2.0.3 and we do NOT get that problem when we use Cocoon 1.8 or perform the transformation manualy with ecommerce.xsl and then with xsp.xsl.

Thank you,

Roman

Reply via email to