This is due to a bug: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15841.

In the code (cocoon-2.1\src\java\org\apache\cocoon\components\language\markup\xsp\java\xsp.xsl):

<xsl:template match="*[not(namespace-uri(.) = 'http://apache.org/xsp')]">
  <!-- matching on your label element -->

<xsl:apply-templates select="@*"/>

<!-- catching all xsp:attributes
they are added to xspAttr -->
<xsl:apply-templates select="xsp:attribute | xsp:logic[xsp:attribute]"/>


  <!-- create the element -->
    this.contentHandler.startElement(...);
    xspAttr.clear();

<!-- catching the rest of the elements -->
<xsl:apply-templates select="node()[not(
(namespace-uri(.) = $xsp-uri and local-name(.) = 'attribute') or
(namespace-uri(.) = $xsp-uri and local-name(.) = 'logic' and ./xsp:attribute)
)]"/>


  <!-- end element -->
    this.contentHandler.endElement(...);

</xsl:template>

So first templates are applied for all your <xsp:attribute/>s. And second the rest including <xsp:logic/>. This is of course completely buggy, but I don't know how to fix it without breaking existing stuff. The problem is, that you are creating the attributes in XSL and XSP *after* the element, in SAX you must already have collected them when the element is created.

Joerg

Christian Haul wrote:
On 11.Jun.2003 -- 08:43 AM, Derek Hohls wrote:

<labels show="true">
<xsp:attribute name="label"><xsp:expr>fGraphPtLabel</xsp:expr></xsp:attribute>
<xsp:logic>
if ((fGraphPtLabel != null) &amp;&amp; (fGraphPtLabel.equals("name"))) { <xsp:attribute name="rotate">14</xsp:attribute>
} else {
<xsp:attribute name="rotate">1</xsp:attribute>
}
</xsp:logic>


Can't see a problem here but you might like to know that you could
save yourself some of the xsp:logic tags.... (see above)

Chris.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to