I have the standard XML form and am having problems removing an element. XML
<my:myFields>
<my:Attachment>some values</my:Attachment&g开发者_高级运维t;
</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>
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>
精彩评论