D
dutone
Is it possible to use a template and then, in the same transformation,
reuse it for a call to document()?
I have a document that has a child. If necessary, I need to include
another document's (same structure) child. I'd like to reuse a
template but it doesn't seem to be working out for me.
<xsl:template match="/root">
<id><xsl:value-of select="name"/></id>
<children>
<xsl:apply-templates select="child"/>
<xsl:if test="string-length($additonal-id)>0">
<xsl:apply-templates select="document($additional-id)/
root"/>
</xsl:if>
</children>
</xsl:template>
<xsl:template match="child">
....
</xsl:template>
The code above will cause an infinite loop. I've tried passing the /
root/child element as a param to the child template, but that causes a
type mismatch error.
Any ideas? I'd hope that I wouldn't have to recreate the xsl:value-of
the elements of the child structure with a document()/root/.
reuse it for a call to document()?
I have a document that has a child. If necessary, I need to include
another document's (same structure) child. I'd like to reuse a
template but it doesn't seem to be working out for me.
<xsl:template match="/root">
<id><xsl:value-of select="name"/></id>
<children>
<xsl:apply-templates select="child"/>
<xsl:if test="string-length($additonal-id)>0">
<xsl:apply-templates select="document($additional-id)/
root"/>
</xsl:if>
</children>
</xsl:template>
<xsl:template match="child">
....
</xsl:template>
The code above will cause an infinite loop. I've tried passing the /
root/child element as a param to the child template, but that causes a
type mismatch error.
Any ideas? I'd hope that I wouldn't have to recreate the xsl:value-of
the elements of the child structure with a document()/root/.