如何使用XSL从InfoPath XML中删除元素

如何使用XSL从InfoPath XML中删除元素,xml,xslt,infopath,Xml,Xslt,Infopath,我有标准XML表单,在删除元素时遇到问题。XML <my:myFields> <my:Attachment>some values</my:Attachment> </my:myFields> 一些价值观 我试过使用这个: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template

我有标准XML表单,在删除元素时遇到问题。XML

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

一些价值观
我试过使用这个:

<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>

需要在XSLT中指定“我的”的命名空间

例如

<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>