Reputation: 63846
I am used to matching multiple elements like this:
<xsl:template match="horse | sheep | pig | cow | dog">
But how can I restrict this to such elements which are children of a given parent type. e.g. it would match:
<animals>
<horse .../>
<sheep .../>
</animals>
But not match:
<pets>
<horse .../>
<dog .../>
</pets>
Upvotes: 2
Views: 196
Reputation: 167781
You need to spell that out as <xsl:template match="animals/horse | animals/sheep | animals/pig | animals/cow | animals/dog">
.
Upvotes: 2