[xsl] Compound filter in for-each

Subject: [xsl] Compound filter in for-each
From: Alan Hale <alan.hale@xxxxxxxxxxx>
Date: Tue, 24 Mar 2009 18:47:05 +0000
Still working on XML derived from Google Earth KML. I want to filter on
particular ExtendedData/Data name and value combinations. Here is an
extract of relevant XML:
<Placemark>
..................
<ExtendedData>
         <Data name  "sciencName">
           <value>Euphrasia micrantha</value>
         </Data>
         <Data name  "grid_ref">
           <value>SN701822</value>
         </Data>
         <Data name  "eng_name">
           <value>An Eyebright</value>
         </Data>
         <Data name  "rdb_status">
           <value>Endangered</value>
         </Data>
.........................
</ExtendedData>
............................
</Placemark>

So I guess what I am looking for is something like:

<xsl:for-each select "Placemark/ExtendedData/Data[@name 'rdb_status'and value 'Endangered']">

- though this doesn't work (in XML Notepad I just get the unhelpful error message "Input string was not in a correct format.") I've tried various permutations and searched the list archives and the wider Web but not found anything that works for me. Is this actually possible?

Many thanks

Alan Hale
Aberystwyth

Current Thread