Subject: Re: [xsl] duplicate problem.. From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Mon, 05 Jan 2004 02:24:28 +0100 |
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)]"/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] duplicate problem.., Paul Tomsic | Thread | [xsl] Critique please!, Nik Coughlin |
RE: [xsl] Critique please!, Jim Fuller | Date | [xsl] Reprocess template results in, Mark Lundquist |
Month |