I wanted to replace all matching nodes in the xml-file.
To the original xml:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<Button/>
</StackPanel>
</Window>
I applied the following xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="Button">
<AnotherButton><xsl:apply-templates select="@*|node()" /></AnotherButton>
</xsl:template>
</xsl:stylesheet>
But it produces the same xml. What I did wrong?
What Sean is saying is that if you remove the namespace from your XML document the XSLT will work
produces...
Alternatively, you asked if you can keep your namespace
Add your
x:
namespace to your Button...Update your XSL to also use this
x:Button
namespaceproduces...