xsl-list
[Top] [All Lists]

RE: Sorting RTF

2004-11-19 08:11:40
If you're using Saxon 7.8 then

(a) you should be using Saxon 8.1.1

(b) you are using XSLT 2.0 and therefore don't need the xx:node-set()
function

(c) the Saxon namespace should be http://saxon.sf.net/

The most likely explanation for the "casting empty sequence" error is that
there is no @dc:date attribute - certainly, you haven't given us any
information about it, nor did you mention the dc namespace.

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

-----Original Message-----
From: Paul Hebble [mailto:maceo(_at_)imsa(_dot_)edu] 
Sent: 18 November 2004 14:29
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Sorting RTF

Hi all,

Apologies in advance if this is an FAQ (and I don't see how 
it couldn't
be), but several days of searching the web, usenet, and mailing lists
have not turned up a solution.

I'm using Saxon 7.8 with these namespaces:
      xmlns:exsl="http://exslt.org/common";
      xmlns:saxon="http://icl.com/saxon";
      extension-element-prefixes="saxon exsl"

Here's what I want to do:

<xsl:variable name="items">
      <xsl:apply-templates select="*"/>
</xsl:variable>
<xsl:for-each select="exsl:node-set($items)/*">
      <xsl:sort select="xs:dateTime(@dc:date)" order="descending"/>
      <xsl:copy-of select="."/>
</xsl:for-each>

Saxon responds to this with this error on the for-each line:
"An empty sequence is not allowed as the value in 'cast as' 
expression".

I know $items isn't empty because if I replace the for-each with a
copy-of, I get the expected nodes.  I have tried setting my 
stylesheet's
version to 1.0, 1.1, and 2.0, and I have also tried these:
      select="$items"
      select="$items/*"
      select="exsl:node-set($items)"
      select="saxon:node-set($items)"
      select="saxon:node-set($items)/*"

The last two give me this error:
"No function found matching saxon:node-set with one argument"
Which makes me think that maybe xmlns:saxon is wrong, but I 
haven't seen
any others in my searching.

Any help would be appreciated.

-- 
      Paul

--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>