cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Friedrich Schuster" <>
Subject C2: Processing exception with logicsheet
Date Fri, 28 Dec 2001 08:05:06 GMT

Hi Cocoon Developers,

I get a ProcessingException: Language Exception
when passing parameters to a logicsheet (cocoon2.0, Tomcat 4.0.1, Win2k,

This happens _only_ when passing the parameter
within the content of a custom tag
<xxx:param name="start">0</xxx:param>
(not as an attribute).

The generated code does not compile:

    start = Strings.isDigit(this.characters("0");) ?
            Strings.toInt(this.characters("0");) : 0 ;

A transformation of the same xml / xsl with Xalan-J 2.2
(without cocoon) seems to work, but not with Cocoon 2.

Embedding the value with: <xxx:param
does not solve the problem: then I have different value types for the
same variable (String for an attribute, int for <xxx:param ...>, not
to mention the inconvenience for logicsheet-users.
Does not work either: <xxx:param
then I get "\n0".

Did anybody experience or solve this problem ?
Thanks in advance,

Friedrich Schuster
Heidelberg, Germany

-------- xml --------

  s="  hello old world  !!  "
  c=" helod"
  <vstring:param name="start">0</vstring:param>

------ xsl-logic ------

<xsl:template match="vstring:indexOfAnyBut">

<xsl:variable name="s">
  <xsl:call-template name="get-parameter">
    <xsl:with-param name="name">s</xsl:with-param>
    <xsl:with-param name="required">true</xsl:with-param>

<xsl:variable name="c">
  <xsl:call-template name="get-parameter">
    <xsl:with-param name="name">c</xsl:with-param>
    <xsl:with-param name="required">true</xsl:with-param>

<xsl:variable name="start">
  <xsl:call-template name="get-parameter">
    <xsl:with-param name="name">start</xsl:with-param>
    <xsl:with-param name="required">false</xsl:with-param>

<xsl:variable name="ignoreCase">
  <xsl:call-template name="get-parameter">
    <xsl:with-param name="name">ignoreCase</xsl:with-param>
    <xsl:with-param name="required">false</xsl:with-param>

  s = <xsl:copy-of select="$s" />;
  c = <xsl:copy-of select="$c" />;
  start = Strings.isDigit(<xsl:copy-of select="$start"/>) ?
Strings.toInt(<xsl:copy-of select="$start"/>) : 0 ;
  ignoreCase = Strings.equals(<xsl:copy-of
select="$ignoreCase"/>,"true",true) ;
  indexOfAnyBut=String.valueOf(ViolinStrings.Strings.indexOfAnyBut(s, c,
start, ignoreCase));

.... deleted ...

<!-- Utility templates -->
<!--                   -->
<!-- DO NOT TOUCH      -->
<!--                   -->

<!-- Keep all unknown tags -->
<xsl:template match="@*|node()" priority="-1">
    <xsl:apply-templates select="@*|node()"/>

<!-- START: util templates from Apache Cocoon Logicsheet Concepts -->

<xsl:template name="get-parameter">
<xsl:param name="name"/>
<xsl:param name="default"/>
<xsl:param name="required">false</xsl:param>
<xsl:variable name="prefix">vstring</xsl:variable>

<xsl:variable name="qname">
  <xsl:value-of select="concat($prefix, ':param')"/>

  <xsl:when test="@*[name(.) = $name]">
    "<xsl:value-of select="@*[name(.) = $name]"/>"
  <xsl:when test="(*[name(.) = $qname])[@name = $name]">
    <xsl:call-template name="get-nested-content">
      <xsl:with-param name="content"
        select="(*[name(.) = $qname])[@name = $name]"/>

<xsl:template name="get-nested-content">
<xsl:param name="content"/>
  <xsl:when test="$content/*">
    <xsl:apply-templates select="$content/*"/>
  <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>

<!-- END: util templates from Apache Cocoon Logicsheet Concepts -->

To unsubscribe, e-mail:
For additional commands, email:

View raw message