[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Bug in Xalan 2.4.1?

Subject: Bug in Xalan 2.4.1?
From: glaprade <glaprade@xxxxxxxxxx>
Date: Tue, 21 Jan 2003 12:11:57 -0700
xalan 2.4.1
I am using the xslt-process module for Emacs and am attempting to produce an
example as to why comparing 2 node sets with the = or != operators is
problematic.  xslt-process allows me to switch between Xalan 2.4.1 and Saxon
6.5.2 for my XSLT processor.

I believe I've discovered a bug in Xalan 2.4.1.

XML FILE:
<Employees>
  <Employee status="fulltime" pay="salaried">
    <FirstName>Jeff</FirstName>
    <LastName>Smith</LastName>
    <SSN>323345333</SSN>
  </Employee>
  <Employee status="parttime" pay="hourly">
    <FirstName>Mike</FirstName>
    <LastName>Young</LastName>
    <SSN>222176543</SSN>
  </Employee>
  <Employee status="parttime" pay="salaried">
    <FirstName>George</FirstName>
    <LastName>Castanza</LastName>
    <SSN>121345123</SSN>
  </Employee>
</Employees>

XSL FILE:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <xsl:template match="/">
    <root>
      <xsl:variable name="NodeSet1" select="/Employees/Employee[1]"/>
      <xsl:variable name="NodeSet2" select="//Employee"/>
      
      <xsl:if test="$NodeSet1 = $NodeSet2">
	<Equal/>
      </xsl:if>
      <xsl:if test="$NodeSet1 != $NodeSet2">
	<NotEqual/>
      </xsl:if>
    </root>
  </xsl:template>
</xsl:stylesheet>



With Saxon 6.5.2 selected I get:
   <?xml version="1.0" encoding="UTF-8"?>
   <root>
      <Equal/>
      <NotEqual/>
   </root>


With Xalan 2.4.1 selected I get:
   F:/stuff/XSLT/equal_notequal_gotcha.xsl:13:38: Fatal error: Unknown error
in XPath
which points to this line:
   <xsl:if test="$NodeSet1 != $NodeSet2">


MSXML 4 will output the same as Saxon.

I believe this is a bug, but wanted to ensure that there is nothing wrong
with my not equal comparison.

Thanks,
Greg

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.