Determined to grok the built-in templates
Given: <text> foo </text> and this XSLT: <xsl:template match="*"> template-match="*" <xsl:apply-templates /> </xsl:template> <xsl:template match="/"> template-match="/" <xsl:apply-templates /> </xsl:template> the output is: template-match="/" template-match="*" foo I believe I'm right in saying that together these two templates overide(?) the built-in 'traversal' template, so precisely three templates are in play; these two (above), and the 'text-copy' template: <xsl:template match="text()|@*"> <xsl:value-of select="."> </xsl:template> I'm probably already labouring under a miscomprehension of some sort, but here's my understanding of the sequence of events: # Template Current node-set Result tree - -------- ---------------- ----------- 1. "/" <text>foo</text> template-match="/" 2. "*" [unchanged] + template-match="*" 3. 'text-copy' [unchanged] + foo Notes: 1. "/" is the best match, so it goes first, the <text> element (and its string value) becomes the current node set and the literal result text is appended to the result tree. 2. "*" comes next (not sure why) but as the <text> element has no children the current node set is unchanged, and the literal result element is appended to the result tree. 3. the 'text-copy' template brings up the rear and the text from the current node set is appended to the result tree. How wrong am I? :-/ Please don't say completely! sdt
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format