Subject: Re: [xsl] Template inside a Template From: Mike Brown <mike@xxxxxxxx> Date: Sat, 13 Oct 2001 15:00:32 -0600 (MDT) |
kalpana rawat wrote: > Can we have a Templte inside a template. Yes, but not the way you probably expect. > e.g., > <xsl:template name="Item"> > <xsl:template name="Notes"> > ......something goes here > </xsl:template> > </xsl:template> You probably want <xsl:template name="Item"> <xsl:call-template name="Notes"/> ......something goes here </xsl:template> <xsl:template name="Notes"> ......something goes here </xsl:template> But do you understand the processing model of XSLT? <xsl:template match="foo"> means "this template is a good match for an element named foo, if such a node has been selected for processing". <xsl:apply-templates select="foo"/> means "go process, one at a time, all the 'foo' element children of the node currently being processed, by finding the template that is the best match for that node" <xsl:for-each select="foo"> means "process, one at a time, all the 'foo' element children of the node currently being processed, and use the contents of this for-each element as the best matching template. <xsl:template name="foo"> means "this template is named foo and can be called while processing any node" <xsl:call-template name="foo"/> means "invoke the template named foo here, without changing the current node" Processing starts at the root node, and there are built-in templates that cause recursive descent through elements and the copying of text nodes. - Mike ____________________________________________________________________________ mike j. brown, fourthought.com | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | personal: http://hyperreal.org/~mike/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Template inside a Template, kalpana rawat | Thread | Re: [xsl] Template inside a Templat, kalpana rawat |
Re: [xsl] passing variables to a st, Eric Smith | Date | Re: [xsl] passing variables to a st, Jörg Heinicke |
Month |