DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15527>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15527

multiple key definitions (same name) do not work as expected on longer strings

           Summary: multiple key definitions (same name) do not work as
                    expected on longer strings
           Product: XalanJ2
           Version: 2.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.processor
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


At the weekend we found a problem in Cocoon 2.1 (CVS head) using the used Xalan
2.4.1 and XSLTC there
(http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103985066026426&w=2).

The files used for the tests were
xml-cocoon2\src\webapp\samples\flow\examples\prefs\pages\userInfo.xsp
and version 1.5
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/jpath.xsl
I will attach simplified versions of both files.

In the XSL there was a aggregated key declaration (or how is it called?):

  <xsl:key name="JPathExprs" match="jpath:if" use="@test"/>
  <xsl:key name="JPathExprs" match="jpath:when" use="@test"/>
  <xsl:key name="JPathExprs" match="jpath:for-each" use="@select"/>
  <xsl:key name="JPathExprs" match="jpath:value-of" use="@select"/>

When applying templates like

<xsl:apply-templates select="//jpath:if | //jpath:when | //jpath:value-of |
//jpath:for-each"/>

and using a template like

  <xsl:template match="jpath:if | jpath:when | jpath:for-each | jpath:value-of">
    <tr>
        <td>
            <xsl:value-of select="name()"/>
        </td>
        <td>
            <xsl:value-of select="concat(@test, @select)"/>
        </td>
        <td>
            <xsl:value-of select="generate-id()"/>
        </td>
        <td>
            <xsl:value-of select="generate-id(key('JPathExprs', concat(@test,
@select)))"/>
        </td>
        <td>
            <xsl:value-of select="count(key('JPathExprs', concat(@test,
@select)))"/>
        </td>
    </tr>
  </xsl:template>

the generate-id() and the count() return wrong values for strings like "check
and firstName = ''". The generate-id() return is empty and the count() return is
0. But as you can guess those expressions are important for Muenchian Grouping.

Reply via email to