[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] duplicate problem..


Subject: Re: [xsl] duplicate problem..
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Mon, 05 Jan 2004 02:24:28 +0100

Paul Tomsic wrote:

I'm looping across:
  <Chapter_group>
    <Chapter id="7" isbn="0-324-12175" name="Data And
Statistics" original_number="0" page_count="25" />
    <Chapter id="8" isbn="0-324-12175" name="Data And
Statistics" original_number="1" page_count="25" />
    <Chapter id="9" isbn="0-324-12175"
name="Descriptive Statistics: Tabular And Graphical
Methods" original_number="2" page_count="53" />
 </Chapter_group>

with this:
	<xsl:variable name="unique-chapter-name-list"
select="//Chapter_group/Chapter[not(./@name =
following::./@name)]"/>
            ^^
This is not legal XPath syntax, you should have gotten an
error message. The ./ is redundant too. Try
  <xsl:variable name="unique-chapter-name-list"
    select="//Chapter_group/Chapter[not(@name =
     following::Chapter/@name)]"/>

Depending on your source and context, the following might
perform better (no // in front of the Cahpter_Group, and
using following-sibling):
  <xsl:variable name="unique-chapter-name-list"
    select="Chapter_group/Chapter[not(@name =
     following-sibling::Chapter/@name)]"/>

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords