[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
<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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|