carrilho.paulo@gmail.com wrote:[color=blue]
> Thank you in advance.
>
> If and only if a tag from Parameters, exists in Output (with the same
> name). This tag in Output should overwrite the tag with the same name
> in Parameters.
>
> <Parameters>
> <A>
> <B>One<B/>
> <A/>
> <D>
> <E>Three<E/>
> <D/>
> <Parameters/>
> <Output>
> <A>
> <C>Two<C/>
> <A>
> <Output/>[/color]
That isn't XML. Your end-tags are all defective.
[color=blue]
> the XSLT should transforms it into:
>
> <Parameters>
> <A>
> <C>Two<C/>
> <A/>
> <D>
> <E>Three<E/>
> <D/>
> <Parameters/>
>
> The A tag (and its childs) were copied from Output into Parameters.[/color]
Assuming you fix up your file, try this.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"/>
<xsl:template match="Parameters">
<Parameters>
<xsl:apply-templates/>
</Parameters>
</xsl:template>
<xsl:template match="Parameters/*">
<xsl:choose>
<xsl:when test="../../Output/*[name()=current()/name()]">
<xsl:copy-of select="../../Output/*[name()=current()/name()]"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
///Peter
--
XML FAQ:
http://xml.silmaril.ie/