1. matching children of siblings


matching children of siblings

Mike Brown

 > Given the following two data structures which are both
 > siblings:
 > <APPLE>
 > <COLOR>red</COLOR>
 > </APPLE>
 > <COLOR>orange</COLOR>
 > </ORANGE>
 > Inside an APPLE template, how do I select the COLOR of
 > the particular ORANGE structure that has the same
 > BASKET_ID of the current APPLE?
 <xsl:template match="APPLE">
	name="AppleBasket" select="BASKET_ID"/>

Read the select expression like this:

elements named COLOR that are children of elements named ORANGE that are children of nodes found in the parent axis (..). Further, the ORANGE elements are limited to the subset for which the comparison of child elements named BASKET_ID to the node-set identified by the AppleBasket variable is true. (it will be true if both node-sets have a member with the same string value) (I think).