A
anonymous
Given a sample like the one below, how can I count the number of
elements <quick> with the value 'yes'. When processing the //quick
nodes I can easily find out if they are 'empty' but I need to write a
select pattern to see if any of them is not 'empty'. In the below
example the result should be '1' for the <quick>yes</quick> element
and '2' for the total count of <quick> elements. I tried various
implementations of
<xsl:value-of select="count(//sub[quick='yes'])"/> and the like,
including node() stuff (not allowed in patterns), but the, probably
simple, solution simply eludes me.
<?xml version="1.0" encoding="UTF-8"?>
<anything>
<sub>
<quick/>
</sub>
<sub>
<quick>yes</quick>
</sub>
</anything>
elements <quick> with the value 'yes'. When processing the //quick
nodes I can easily find out if they are 'empty' but I need to write a
select pattern to see if any of them is not 'empty'. In the below
example the result should be '1' for the <quick>yes</quick> element
and '2' for the total count of <quick> elements. I tried various
implementations of
<xsl:value-of select="count(//sub[quick='yes'])"/> and the like,
including node() stuff (not allowed in patterns), but the, probably
simple, solution simply eludes me.
<?xml version="1.0" encoding="UTF-8"?>
<anything>
<sub>
<quick/>
</sub>
<sub>
<quick>yes</quick>
</sub>
</anything>