![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT: Moving node in document >Thread Next - Re: XSLT: Moving node in document Re: XSLT: Moving node in documentTo: NULL Date: 4/1/2005 1:40:00 AM Thanks, simple and elegant.
Could you give me a hint how to parameterise this?
The following approach doesn't seem to work:
------------------------------------------------------
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="nodeparent" />
<xsl:param name="nodeid" />
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="node[@id='{$nodeid}']"/>
<xsl:template match="node[@id='{$nodeparent}']">
<xsl:copy>
<xsl:copy-of select="@*|//node[@id='{$nodeid}']"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------
Easy enough to put an <xsl:choose> construct inside the identity
transform, and ignore the node satisfying "@id = $nodeid'. But how can
we then add that node to $nodeparent?
Claudio
--
,= ,-_-. =. Claudio Jolowicz
((_/)o o(\_)) http://www.jolowicz.com
`-'(. .)`-'
\_/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
