This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Template inside a Template
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Template inside a Template
- From: kalpana rawat <kal_xml at yahoo dot com>
- Date: Sat, 13 Oct 2001 15:41:06 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Thanks that didn't click me.... before.
--- Mike Brown <mike@skew.org> wrote:
> 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
>
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list