[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] Getting a specific element count from a generic match
Subject: RE: [xsl] Getting a specific element count from a generic match
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 11 Apr 2006 14:42:13 +0100
|
> Isn't this purely a fault with the stylesheet, rather than being
> specific to saxon.net?
The reported problem was that the compile-time error messages were not being
displayed: so yes, the stylesheet is known to have errors; the problem is
with the display of diagnostics.
Michael Kay
http://www.saxonica.com/
>
> Look at the stylesheet:
>
> > 1 <?xml version="1.0" encoding="utf-8"?>
> > 2 <xsl:stylesheet version="2.0"
> > 3 x mlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > 4
> > 5 <xsl:variable name="namelist"
> > select="distinct-values(//*/node-name())"/>
> > 6
> > 7 <xsl:variable name="root" select="/"/>
> > 8
> > 9 <xsl:template match="/">
> > 10 <xsl:for-each select="$namelist">
> > 11 <xsl:variable name="thisname" select="name()"/>
> > 12 <name value="{$thisname}"
> > count="{count($root//*[name() = $thisname])}"/>
> > 13 </xsl:for-each>
> > 14 </xsl:template>
> > 15
> > 16 </xsl:stylesheet>
>
> Here $namelist contains a list of items of xdt:anyAtomicType yet it's
> trying to be used as a list of nodes (when name() is called on each
> item in the sequence). Saxon is probably staticly aware of this which
> is why its not compiling the stylesheet, whereas other processors wont
> reveal the error until runtime....
Current Thread |
- RE: [xsl] Getting a specific element count from a generic match, (continued)
- Michael Kay - Mon, 10 Apr 2006 17:07:09 +0100
- Message not available
- Spencer Tickner - Mon, 10 Apr 2006 10:10:03 -0800
- Michael Kay - Mon, 10 Apr 2006 20:13:55 +0100
- Message not available
- andrew welch - Tue, 11 Apr 2006 13:52:06 +0100
- Michael Kay - Tue, 11 Apr 2006 14:42:13 +0100 <=
- Ben Senior - Tue, 11 Apr 2006 16:00:58 +0200
- Ben Senior - Tue, 11 Apr 2006 16:15:44 +0200
- Wendell Piez - Tue, 11 Apr 2006 10:57:21 -0400
- Message not available
- M. David Peterson - Fri, 14 Apr 2006 04:07:24 -0600
|