如何打印除xml之外的所有一级子元素

时间:2015-09-05 10:37:24

标签: xslt

打印除xml之外的xml中的所有子元素。

<Store>
<Store Name>Store name</Store Name>
<Store address>Store address</Store address>
    <book>
    <name>book name</name>
    <description>very good fiction</description>
    <price>300</price>
    <pages>540</pages>
    </book>
</Store>

我将获得pa ram参数=&#34;存储/预订&#34;

中的值

我需要打印如下:

书名300 540 我不想获取描述,我如何使用XSL

1 个答案:

答案 0 :(得分:1)

要选择除description以外的所有子元素,请执行:

select="*[not(self::description)]"

在XSLT 2.0中,你可以这样做:

select="* except description"