Subject: RE: creating nodes using multiple templates/modes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 27 Mar 2006 10:01:40 +0100
|
> is it possible to create an output node (A) in XSLT 2.0 using one
> template and use another template to add children (B) to this newly
> created node?
Yes:
<xsl:template name="one">
<A>
<xsl:call-template name="two"/>
</A>
</xsl:template>
<xsl:template name="two">
<B/>
</xsl:template>
T
> <xsl:template match="UML:Package[key('stereotype-id',
> @stereotype)/@name='apply-function' and
> UML:ModelElement.taggedValue/UML:TaggedValue/UML:TaggedValue.d
> ataValue='21to23']">
> <xsl:apply-templates select="//*" mode="convert-21to23"/>
I suspect your error is the "//*". This selects all the elements in the
whole document. Your intention was probably to do a recursive descent in
which you only select the children of the current node, that is select="*".
Michael Kay
http://www.saxonica.com/
|