xsl-list
[Top] [All Lists]

[xsl] how to sort a union using number()?

2007-03-15 16:43:37
Greetings,

I was wondering if someone might explain how to sort a union of nodes 
using the number() function.

I encountered a point where I needed to apply templates to a union of 
nodes, sorting them on a common element.

The naive approach was (XPaths radically simplified for brevity):

<xsl:apply-templates
     select="Classifier.feature/Attribute|$associations">
  <xsl:sort
       select="number(NumberString|$associations/NumberString)"/>
</xsl:apply-templates>

but this resulted in:

Error on line 228 of file:/e:/schema.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the first 
argument of number()

I'm using Saxon 8.9J.

Thank you very much,
Andy Halper

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>