[xsl] MSXML3 bug - xsl:variable with xsl:number

Subject: [xsl] MSXML3 bug - xsl:variable with xsl:number
From: MURAKAMI Shinyu <murakami@xxxxxxxxxx>
Date: Mon, 5 Mar 2001 11:08:43 +0900
Hello

I'm using MSXML3 and I found a problem:
xsl:number preceded by a text is ignored when set to xsl:variable.

----- test1.xsl -----
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
  <AAA>
    <xsl:apply-templates/>
  </AAA>
</xsl:template>

<xsl:template match="item">
  <xsl:variable name="num">
    No.<xsl:number/>
  </xsl:variable>
  <NUM><xsl:copy-of select="$num"/></NUM>
</xsl:template>
</xsl:stylesheet>

----- test1.xml -----
<aaa>
  <item>one</item>
  <item>two</item>
  <item>three</item>
</aaa>

----- required result ----
<AAA>
  <NUM>
    No.1
  </NUM>
  <NUM>
    No.2
  </NUM>
  <NUM>
    No.3
  </NUM>
</AAA>

---- MSXML3 result ----
<AAA>
  <NUM>
    No.
  </NUM>
  <NUM>
    No.
  </NUM>
  <NUM>
    No.
  </NUM>
</AAA>
------------

Is it a known bug? or am I wrong?

BTW I could not find latest issue list of MSXML3 (not beta's).
I think MSXML3 is very good, but there are some compatibility problem.
for example: 
<!ENTITY NL "<xsl:text>&#xA;</xsl:text>">
can be used with SAXON, XT, etc. but with MSXML3 it's an error.
I know that reason, but many people don't.

I wish these would be added to the MSXML FAQ.

Best regards,
Shinyu Murakami

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


Current Thread