#1 test fails comparing attribute values

closed-accepted
None
5
2002-02-18
2001-04-03
Anonymous
No

The following test fails.

Here's the xslt:

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" />

<xsl:template match="/">
<xsl:choose>
<xsl:when test="/root/node1/@attr1=/root/node2/@attr2">
<div>Test succeeded!</div>
</xsl:when>
<xsl:otherwise>
<div>Test failed!</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

Here's the xml:

<root>
<node1 attr1="val1"/>
<node2 attr2="val1"/>
</root>

If I replace the xsl:when test with the following, the
test succeeds:
<xsl:when test="/root[node1/@attr1=node2/@attr2]">

Discussion

  • Nobody/Anonymous

    Logged In: NO

    While there is a work-around for the above test case, I
    haven't been able to come up with a work-around for the
    following test case:

    <xsl:when test="@rid = /topic/metadata/@id">

    In this example, the node with current context has a rid
    attribute. The following also fails:

    <xsl:when test="./@rid = /topic/metadata/@id">

     
  • Jonathan Stowe

    Jonathan Stowe - 2001-12-17
    • assigned_to: nobody --> gellyfish
    • status: open --> open-accepted
     
  • Jonathan Stowe

    Jonathan Stowe - 2001-12-19
    • assigned_to: gellyfish --> nobody
     
  • Jonathan Stowe

    Jonathan Stowe - 2001-12-19

    Logged In: YES
    user_id=313586

    Currently the comparison of attributes is not implemented. I would
    hope that with the next major release of the module this will be
    available.

    I am moving this from 'bugs' to feature requests.

    /J\

     
  • Jonathan Stowe

    Jonathan Stowe - 2001-12-27
    • assigned_to: nobody --> gellyfish
     
  • Jonathan Stowe

    Jonathan Stowe - 2001-12-27
    • assigned_to: gellyfish --> nobody
     
  • Jonathan Stowe

    Jonathan Stowe - 2002-01-08
    • assigned_to: nobody --> gellyfish
     
  • Jonathan Stowe

    Jonathan Stowe - 2002-02-18
    • status: open-accepted --> closed-accepted
     

Log in to post a comment.