[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: removing duplicate children

Subject: Re: removing duplicate children
From: Ian Davis <ian@xxxxxxxxxx>
Date: Tue, 5 Dec 2000 08:33:18 +0000
xpath for removing duplicate children
I don't think this made it through - apologies for the duplicate if it
did.

On Friday, December 01, 2000, 2:10:41 AM, Cliff wrote:

> I have a chunk of script that looks something like:
> <xsl:template match="call">
>   <xsl:text>void </xsl:text>
>   <xsl:apply-templates select="name"/>
>   <xsl:text>() throws </xsl:text>
>   <xsl:for-each select=".//throws">
>     <xsl:text>, </xsl:text>
>     <xsl:apply-template select="."/>
>   </xsl:for-each>
> </xsl:template>

How about

<xsl:template match="call">
  <xsl:text>void </xsl:text>
  <xsl:apply-templates select="name"/>
  <xsl:text>() throws </xsl:text>
  <xsl:for-each select=".//throws[not(parent::call/call/throws = .)]">
    <xsl:text>, </xsl:text>
    <xsl:apply-templates />
  </xsl:for-each>
</xsl:template>


The xsl:for-each means 'select any throws elements whose parent does
not have a call child with a throws element of the same value'


Ian
--
Chief Technology Officer
Calaba - Discovering Technology
Tel: +44 (0)20 7494 1851
GSM: +44 (0)77 7964 9112



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.