[xsl] Matching nodes which contain one attribute with value beginning with "aaa"?

Subject: [xsl] Matching nodes which contain one attribute with value beginning with "aaa"?
From: "Ben Stover" <bxstover@xxxxxxxxxxx>
Date: Thu, 10 Dec 2009 21:23:33 +0100
How do I setup a template which matches only those nodes which contain exactly ONE attribute
whose value in turn starts with the pattern "aaa"?

So the following nodes should be matched:

<ns1:somenode myattr="aaabbbccc">...</ns1:somenode>

or

<ns1:somenode myattr:ns2="aaabbbccc">...</ns1:somenode>

but NOT these nodes:

<ns1:somenode myattr="aaabbbccc" secondattr="blah">...</ns1:somenode>
or
<ns1:somenode myattr="bbbaaaccc">...</ns1:somenode>

Ben

Current Thread