This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Matching braches without a certain node
- To: xsl-list at mulberrytech dot com
- Subject: Re: Matching braches without a certain node
- From: Conor Ryan <cryan at xmlw dot ie>
- Date: Wed, 29 Nov 2000 10:06:20 +0000
- Reply-To: xsl-list at mulberrytech dot com
><xsl:template match="/">
> [stuff before]
> <xsl:for-each select="//middle">
> <xsl:if test="not (foo[node()]">
> [Whatever I want to do]
> </xsl:if>
> </xsl:for-each>
></xsl:template>
>
>(You get the general idea.) Isn't there any simpler way to do this?? I'd
>rather do something where, in one line, I match the 'middle' nodes without
>the 'foo' tag, and then do an unconditional loop over these nodes.
is this what you're looking for?
<xsl:template match="/">
[stuff before]
<xsl:for-each select="//middle[not(child::foo)]">
[Whatever you want to do]
</xsl:for-each>
</xsl:template>
---------
Conor Ryan,
XML Workshop Ltd,
10 Greenmount Industrial Estate, Harolds Cross, Dublin 12, IRELAND.
Email: cryan@xmlw.ie
Phone: +353 1 4547811; Fax: +353 1 4731626
Web: http://www.xmlw.ie/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list