相关疑难解决方法(0)

区别:child :: node()和child ::*

我刚刚写了一个起初不起作用的XSLT.

我不得不重新命名的所有儿童<Recordset><C>:

<?xml version="1.0" encoding="utf-8"?>
<Record>
<Recordset>
    <company>102</company>
    <store>1801</store>
    ....
</Recordset>
<Recordset>
....
</Recordset>
</Record>
Run Code Online (Sandbox Code Playgroud)

我使用了以下XSLT:

<xsl:template match="Record/Recordset/child::*">    
    <xsl:element name="C">
        <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)

它的工作原理和重命名的所有孩子<Recordset><C>.但首先我在模板中的匹配看起来像这样:

<xsl:template match="Record/Recordset/child::node()">
Run Code Online (Sandbox Code Playgroud)

我的想法是每个孩子<Recordset>都是一个节点,因此node()是合适的.它也有效,但它<C/>为每个孩子插入了额外的东西.

child::node()和之间有什么区别child::*

xslt

22
推荐指数
2
解决办法
4万
查看次数

标签 统计

xslt ×1