Re: [xsl] Questions regarding match

Subject: Re: [xsl] Questions regarding match
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 1 Sep 2006 13:24:13 +0100
  i've tried:

  <xsl:template match="fields[descendant::field[contains(@id,'Metadata') and  contains(@id,'.subject.')]]" >...</xsl:template>

That's legal,but the XPath 
descendant::field[contains(@id,'Metadata') and  contains(@id,'.subject.')]
selcts those fields for wich the id attribute contains both 'Metadata'
and '.subject.' But I (guessing here) think that you want to test if the
parent alement has one field with @id that contains 'Metadata' and one
field with id that contains .subject. so that would be

fields[field[contains(@id,'Metadata')] and field[contains(@id,'.subject.')]]

 I'm assuming here that you don't need descendant:: and that the defualt
child:: axis is enough, but you can put  descendant:: back (twice) if
you need it.

David

Current Thread