The XML contains a single stock element which in turn contains four items. We use this structure to investigate how XSL processes nodes. The template is tested against every node in the input tree. When a match is made then the content of the template is output. Once a match is made the child nodes will not be considered unless an explicit instruction to do so is given. This is a simple transformation, it outputs a single constant value for every node matched.
|
We can decide which nodes match using match attribute of the xsl:template node - the content of this node determines what gets output. In this example we output the bar code and the description of each item.The xsl:value-of nodes
|
|
This question introduces more advanced topics. You would be well advised to return to this question after having completed some of the later tutorials. The default axis is the child axis - when we specify stock/item we mean that item is a child of stock. It is possible to employ another axis such as ancestor, following-sibling, preceding-sibling, following, preceding, namespace, descentant and ancestor-or-self.
|