tags:

views:

19

answers:

1

I have the standard XML form and am having problems removing an element. XML

<my:myFields>
    <my:Attachment>some values</my:Attachment>
</my:myFields>

I have tried using this:

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="Attachment"/>
</xsl:stylesheet>
+2  A: 

The namespace for 'my' needs to be specified in the XSLT.

Example,

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:my="whatever the namespace is">
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="my:Attachment"/>
</xsl:stylesheet>
Doug D