cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Bayer <ba...@oio.de>
Subject [C2] bug in xsp.xsl get-nested-content
Date Tue, 01 May 2001 21:57:39 GMT
Hi,

i've encountered serveral problems with prepared statements in
esql.xsl and with xsp:element. The problems have to do with the
get-nested-content and the template with the match="text() pattern in
xsp.xsl. The test: $content/* in get-nested-content is also true if
there is only one text child. To fix the problem we have to look if
there are a child other than text nodes. If you do an apply-templates on
a text node the match="text()" template is instanziated and 


this.characters("parameter for java")


is placed in a java Method like


someMethod(this.characters("parameter for java");)


An addional predicate will fix the problem:


  <xsl:template name="get-nested-content">
    <xsl:param name="content"/>
    <xsl:choose>
      <!-- look if there is a non text child -->
      <xsl:when test="$content/*[not(text())]">
        <xsl:apply-templates select="$content/*"/>
      </xsl:when>
      <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
    </xsl:choose>
  </xsl:template>





Thomas Bayer




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


Mime
View raw message