Re: [xsl] Removing Duplicates & Formatting

Subject: Re: [xsl] Removing Duplicates & Formatting
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 10 Dec 2003 14:44:26 GMT
you'd probbaly better off doing this in two passes, first get the paths
then elimiate duplicates.

this uses saxon node-set extension to do two passes in one stylesheet,
more or less every xslt engine (except mozilla) has a similar extension.


<xsl:stylesheet xmlns:xsl=""; version="1.0"
<xsl:output method="xml" indent="yes" />

<xsl:key name="ref" match="elem" use="ref"/>

<xsl:template match="/">
<xsl:variable name="x">
<xsl:for-each select="//*[not(*)]">
<xsl:for-each select="ancestor-or-self::*"
 >/<xsl:value-of select="name()"/>

<xsl:copy-of select="saxon:node-set($x)/p[not(.=following-sibling::p)]"/>


$ saxon path.xml path.xsl
<?xml version="1.0" encoding="utf-8"?>


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

 XSL-List info and archive:

Current Thread