Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2080

EXSLT function set:has-same-node() fails on namespace nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.7
    • 2.7
    • Xalan-extensions
    • None

    Description

      Ran sample test case provided on EXSLT.org website for set:has-same-node() and
      test has-same-node() between two disjoint sets of namespace nodes failed.

      The Xalan-C++ processor has the same bug and will open a separate bug against
      their processor to have this fixed.

      XML input:

      <?xml version="1.0"?>

      <doc>
      <city name="Paris" country="France"/>
      <city name="Madrid" country="Spain"/>
      <city name="Vienna" country="Austria"/>
      <city name="Barcelona" country="Spain"/>
      <city name="Salzburg" country="Austria"/>
      <city name="Bonn" country="Germany"/>
      <city name="Lyon" country="France"/>
      <city name="Hannover" country="Germany"/>
      <city name="Calais" country="France"/>
      <city name="Berlin" country="Germany"/>
      </doc>

      XSL Stylesheet:

      <?xml version="1.0"?>

      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
      xmlns:set="http://exslt.org/sets" >

      <!-- Test set:has-same-node -->

      <xsl:variable name="a1" select="//city[@name='Vienna' or @name='Salzburg']"/>
      <xsl:variable name="a2" select="//city[@country='Austria']"/>

      <xsl:template match="/">
      <out>
      Test has-same-node() between two disjoint sets of namespace nodes:
      <xsl:if test="not(set:has-same-node((//city[1])/namespace::,(//city[2])/namespace::))">OK</xsl:if>;
      </out>
      </xsl:template>

      </xsl:stylesheet>

      Expected Output:

      <?xml version="1.0" encoding="utf-8"?><out xmlns:set="http://exslt.org/sets">
      Test has-same-node() between two disjoint sets of namespace nodes:
      OK;
      </out>

      Actual Output:
      <?xml version="1.0" encoding="utf-8"?><out xmlns:set="http://exslt.org/sets">
      Test has-same-node() between two disjoint sets of namespace nodes:
      ;
      </out>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              june@ca.ibm.com June Ng
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: