This list is really for Saxon-specific problems, not for general XSLT coding questions, which are best directed to xsl-list at
xsl:for-each select="." selects a single node (the context node), which it then sorts. Obviously sorting a list containing one node is not particularly useful. You need to do the sorting in the template that processes the <root> element and applies-templates to the set of <Contact> elements.
Michael Kay
-----Original Message-----
From: [] On Behalf Of Howard Greenblatt
Sent: 28 July 2003 19:13
Subject: [saxon] Newbie

I really am new at this. I have a simple Xml doc which I cannot get to sort. What am I doing wrong

<?xml version='1.0' ?>
<?xml-stylesheet type="text/xsl" xhref="bb.xsl"?>
        streetAddress='30 Wes'
        Boutique='Boston Energy"
        telephoneNumber='(900) 222-7009'
        Boutique='Palladian Research'

And a xsl of


<xsl:output indent='yes'/>
<xsl:strip-space elements='*' />

<!--  comment -->

<xsl:template match="@*|node()">
                <xsl:apply-templates select="@*|node()"/>      

<xsl:template match="Contact">
                                        <xsl:for-each select=".">
                                         <xsl:sort select="@Boutique" data-type='text'/>
                                 <xsl:copy-of select="." />


Howard Greenblatt