开发者

How to remove an element from InfoPath XML using XSL

开发者 https://www.devze.com 2023-01-22 19:56 出处:网络
I have the standard XML form and am having problems removing an element.XML <my:myFields> <my:Attachment>some values</my:Attachment&g开发者_高级运维t;

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

精彩评论

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