Re: [xsl] Evaluation of predicates (potential bug in MSXML .NET)

Subject: Re: [xsl] Evaluation of predicates (potential bug in MSXML .NET)
From: "bryan rasmussen" <rasmussen.bryan@xxxxxxxxx>
Date: Mon, 22 May 2006 14:30:24 +0200
I just tried this in the msxsl.exe commandline tool (which uses
msxml), and it returned 3.

When you say you were using msxml.net do you mean you were using msxml
in a .net application? Or where you using the .Net implementation of
XSLT?

There is a Microsoft knowledge base on msxml with .net:
http://support.microsoft.com/default.aspx?scid=kb;en-us;815112

"Using MSXML in .NET applications through COM interoperability can
result in unexpected and problems that are difficult to debug.
Microsoft does not recommend or support directly instantiating and
using MSXML objects in .NET code, nor does Microsoft recommend or
support marshalling MSXML interface pointers across the interop
boundary."

I wouldn't expect that to effect this case though.

Cheers,
Bryan Rasmussen

On 5/22/06, Buchcik, Kasimier <k.buchcik@xxxxxxxxxxxx> wrote:
Hi,

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])"/>
 </xsl:template>

</xsl:stylesheet>

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

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

All the other processors return "3".

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

Regards,

Kasimier

Current Thread