Re: [xsl] Getting a specific element count from a generic match

Subject: Re: [xsl] Getting a specific element count from a generic match
From: "Spencer Tickner" <spencertickner@xxxxxxxxx>
Date: Fri, 7 Apr 2006 13:56:39 -0800
Hi guys,

Thanks for the suggestions, Jay it worked out very well. Michael, I
get an error when replacing:

 <xsl:variable name="namelist" select="//*[not(name() =
following::*/name())]"/>

with

<xsl:variable name="namelist" select="distinct-values(//*/node-name())"/>

I'm using the new Saxon 8 api for .net. Either or I've got it working
now in my stylesheet. Thank you both for the help.

Spencer


On 4/7/06, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="2.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >
> >   <xsl:variable name="namelist" select="//*[not(name() =
> > following::*/name())]"/>
> >
>
> We're talking 2.0 here: you can get all the distinct names using
>
> select="distinct-values(//*/node-name())"
>
> That's O(n log n) rather than O(n^2), and it's also namespace-aware.
>
> Michael Kay
> http://www.saxonica.com/

Current Thread