So yeah, I having trouble with an XML --> XHTML transformation using XSL. More specifically I want to count the number of persons with specific data and then output the result.
My XML structure is akin to something like this:
Code: Select all
<people>
<person>
<name>Mary</name>
<sex>Yes please</sex>
<note>bring condoms, bring wine, wears expensive lingerie</note>
</person>
<person>
<name>Felli</name>
<sex>Yes please</sex>
<note>loli with a twist, mean eye</note>
</person>
<person>
<name>Helga</name>
<sex>Hell no</sex>
<note>Huge girth, hambeast, needs eyebleach</note>
</person>
<person>
<name>Jenna</name>
<sex>Yes please</sex>
<note>bring wine, pornstar, blonde</note>
</person>
...
etc. etc.
</people>
I'm trying to count (using XSLT count() function or any other suitable XSLT method) the number of persons with both the
sex element containing "yes please" as well as the
note element containing the words "bring wine". I have traversed the Intarwebs for months, steering away from porn, searching high and low, and have found lots of would-be examples, just not the one I'm looking for. All my past efforts have produced incorrect results or a result of 0, so there's something I'm doing wrong - I just can't figure out what.
The solution is most likely something incredibly easy.