开发者

How to remove an element from InfoPath XML using XSL

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜