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

Re: Evaluation of predicates (potential bug in MSXML

Subject: Re: Evaluation of predicates (potential bug in MSXML .NET)
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 May 2006 13:51:26 +0200
Re:  Evaluation of predicates (potential bug in MSXML
At 2006-05-22 13:37 +0200, Buchcik, Kasimier wrote:
JFYI: In the following scenario, the result of MSXML .NET
differs from the results of Saxon, Xalan and Libxslt/Libxml2.

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
          <xsl:value-of select="count(//foo[name() = 'foo'][1])"/>

Which is to say, count all first-of-siblings named 'foo' at all levels of the document.


</xsl:template>

</xsl:stylesheet>

<?xml version="1.0"?>
<foo>
  <foo>
    <foo/>
    <foo/>
    <foo/>
  </foo>
</foo>

There are three points in the document at which there is a 'foo' amongst siblings.


Result of MSXML .NET:
<?xml version='1.0' encoding='utf-8' ?>
1

That is an incorrect result.


All the other processors return "3".

However, MSXML .NET returns "3", if we change the expression to
"count(//foo[1][1])".

That is also the count of all first siblings named 'foo' at all levels of the document.


. . . . . . . . . . . . . Ken

p.s. an XPath expression very similar to the above is one of the trick questions in the XPath portion of my training class.

--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSL-FO/XSLT training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO/UBL training: Varo,Denmark 06-09-25/10-06
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.