In article <cg5mdm$8nt$04$>,
Tassilo J. Klein <> wrote:
% Ooops, I forgot to mention, that I am using XLST to produce HTML and
% therefore want to make those checks using XLS.
An XPath which matches all Entry elements which contain a Fourth element is
//Entry[Fourth]
You can use this as part of a test, match, or select expression in XSLT. For
instance (you don't need // xsl:template's match attribute)
<xsl:template match='Entry[Fourth]'>
My favourite Entry is number <xsl:value-of select='@Id'/>.
</xsl:template>
or (ok, this isn't quite the same expression)
<xsl:template match='Entry'>
Blah blah blah
<xsl:if test='Fourth'>
This Entry has a Fourth element.
</xsl:if>
</xsl:template>
or how about
<xsl:template match='/'>
We do something with all Entry elements containing fourth:
<xsl:apply-templates mode='withfourth' select='//Entry[Fourth]'/>
Then we do something else with the whole document:
<xsl:apply-templates/>
</xsl:template>
<xsl:template mode='withfourth' match="*">
Blah blah blah.
</xsl:template>
...
--
Patrick TJ McPhee
East York Canada