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

RE: generic sort based on attribute names

Subject: RE: generic sort based on attribute names
From: "Chaitanya Desai" <cdesai@xxxxxxxxxxx>
Date: Sun, 23 Jan 2005 18:02:55 -0800
chaitanya desai
I am using Saxon (the editor I am using is Oxygen) and get the following
errors:
1) Attribute separator not allowed in this element
2) error in expression name(), "=""", ., """ "' separator=""



-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Sun 1/23/2005 3:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  generic sort based on attribute names

> >
> > Here's a solution using the latter approach:
> >
> > <xsl:for-each select="e">
> >  <xsl:sort>
> >    <xsl:for-each select="@*">
> >      <xsl:sort select="name()"/>
> >      <xsl:value-of select='name(), "=""", ., """ "' separator=""/>
> >    </xsl:for-each>
> >  </xsl:sort>
> >  <xsl:copy-of select="."/>
> > </xsl:for-each>
> >
> Saxon 8.2 produces an error message that:
>
> "A sequence of more than one item is not allowed as the @sort-key
> attribute of xsl:sort".

OK: you need to wrap it like this:

> > <xsl:for-each select="e">
> >  <xsl:sort>
      <xsl:value-of>
> >    <xsl:for-each select="@*">
> >      <xsl:sort select="name()"/>
> >      <xsl:value-of select='name(), "=""", ., """ "' separator=""/>
> >    </xsl:for-each>
      </xsl:value-of>
> >  </xsl:sort>
> >  <xsl:copy-of select="."/>
> > </xsl:for-each>
>
> Besides this problem, does xsl:sort have a "sort-key" attribute? I
> don't see it specified either in the latest WG draft or in the book.
>
Looks like the error message needs improving...

Michael Kay
http://www.saxonica.com/

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.