Link: RissRoss: Chatper 6 Questions.
Page 100: I think that the template first applied is for coffee, because the match template to coffee is the most specified (more specified than match = "@*|node ()." I also think that this template is applied to coffee and the new online element, but not the children of coffee because the template for them is overridden by the other template specified. However, in terms of question 3 for page 100, I am not sure of the answer. Any thoughts?
Well, you have three choices: (1) The default template which matches when nothing eles does; (2) The coffee template which only matches coffee elements; or (3) The identity template (template 2 in the example) which matches anything.
Page 108: I think that the template that matches regions avoids matching attributes by elimianting the @ symbol in the match equation. However, I am unsure as to what the * symbol refers to.
* means any element.
Page 113: Unsure of the answer to this question-- any thoughts?
Well, this element moves the current node to region
<coffees region="{region/@name}">
After that when <xsl:apply-templates/> is called, it starts at region and selects only coffee elements.
Page 116: These empty template rules suppress the copying of the source elements they match to the output because matching an empty template rule tells the processor to grab a node set and do nothing with it. According to Wagner, "an empty template rule is one that has a match pattern defined but no accompanying template." If these templates were not present in the stylesheet then I think that the coffee applied template would be apply to them. Is that correct?
Well, no. The default template would be applied because there is no matching template in the stylesheet.