使用XSL变换从链接的XML提取数据



这是xml文件https://dl.google.com/android/repository/extras/extras/intel/addon.xml我想使用XSLT

对其进行转换
<xsl:transform
    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="sdk:license"/>
</xsl:transform>

您可以告诉我如何从该XML中提取数据谢谢

只需在XSLT的顶部添加名称空间,然后获得所需的结果

<xsl:transform
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:sdk="http://schemas.android.com/sdk/android/addon/7"
        version="1.0">
        <xsl:template match="@*|node()">
                <xsl:copy>
                        <xsl:apply-templates select="@*|node()"/>
                </xsl:copy>
        </xsl:template>
        <xsl:template match="sdk:license"/>
</xsl:transform>

最新更新