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

sort + current() - bug in Microsoft MSXML 4?

Subject: sort + current() - bug in Microsoft MSXML 4?
From: "WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)" <adam_watkin-jones@xxxxxx>
Date: Wed, 23 Oct 2002 15:46:29 +0100
microsoft sort
Hi all!

I have been struggling to use sort with current() under MSXML 4 (Product
Version: 4.10.9404.0).  Xalan 2.3.1, Saxon 6.5.2, jd.xslt 1.2.9, MSXML 3
(Product Version: 8.30.9926.0) all produce the result I expect.

I've included the details below.  Could somebody confirm the correct
behaviour?

Many thanks,
Adam



****** XML:

<list>
    <item>
        <name>name2</name>
        <order>2</order>
    </item>
    <item>
        <name>name3</name>
        <order>3</order>
    </item>
    <item>
        <name>name1</name>
        <order>1</order>
    </item>
</list>



****** XSL:

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

    <xsl:output method="xml" encoding="utf-8" indent="yes"/>

    <xsl:template match="/">
        <list>
            <xsl:for-each select="list/item/name">
                <xsl:sort select="/list/item[name=current()]/order"
                        order="descending" data-type="number"/>
                    <name>
                        <xsl:value-of select="."/>
                    </name>
            </xsl:for-each>
        </list>
    </xsl:template>

</xsl:stylesheet>


****** Expected output:

<list>
<name>name3</name>
<name>name2</name>
<name>name1</name>
</list>


****** MSXML 4 output:

<list>
<name>name2</name>
<name>name3</name>
<name>name1</name>
</list>




 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.