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

Re: Newbie Question: Filtering Elements out of a Colle

Subject: Re: Newbie Question: Filtering Elements out of a Collection
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Tue, 22 Jan 2002 20:58:45 +0100
xml ellipse question
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="shapeCollection">
    <shapeCollection>
        <xsl:copy-of select="shapeSet[not(ellipse)]"/>
    </shapeCollection>
</xsl:template>

</xsl:stylesheet>

the output:

<shapeCollection>
    <shapeSet id="ID02">
        <circle />
        <square />
    </shapeSet>
    <shapeSet id="ID04">
        <circle />
        <octagon />
    </shapeSet>
</shapeCollection>

Hope this helps,

Joerg

----- Original Message -----
From: "Jeremy E. Denton" <jdenton@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, January 22, 2002 8:27 PM
Subject:  Newbie Question: Filtering Elements out of a Collection


>
> I apologise in advance if this is in a list FAQ.
>
> I have this rather simple xml file that contains the following:
>
> <shapeCollection>
> <shapeSet id="ID01">
> <square/>
> <rectangle/>
> <ellipse/>
> </shapeSet>
> <shapeSet id="ID02">
> <circle/>
> <square/>
> </shapeSet>
> <shapeSet id="ID03">
> <circle/>
> <ellipse/>
> </shapeSet>
> <shapeSet id="ID04">
> <circle/>
> <octagon/>
> </shapeSet>
> </shapeCollection>
>
>
> Where there is an arbirary number of shapeSets. How would I generate a
> collection of shape sets that didn't contain any shape set that had an
> ellipse in it? I would think this is a rather simple xslt script but I
admit
> that I'm so new at this that the idea of it is elluding me.
>
> Jeremy


 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.