|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Template inside a Template
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
|
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
|

Cart








