0

我有这个 xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<product name="civil">
<day>Moonday</day>
    <dataseries>
    <data timepoint="3h"> 03:00 </data>
    <data timepoint="6h"> 06:00 </data>
    <data timepoint="9h"> 09:00 </data>
    <data timepoint="12h"> 12:00 </data>
    <data timepoint="15h"> 15:00 </data>
    <data timepoint="18h"> 18:00 </data>
    <data timepoint="21h"> 21:00 </data>
    <data timepoint="24h"> 00:00 </data>
    </dataseries>

如何显示交替节点?这样: 3h, 9h, 15h ... 类似:

  <xsl:for-each select="product/dataseries/data" timepoint="@6h">

但是这段代码是错误的。

4

1 回答 1

0

尝试关注

  <xsl:for-each select="product/dataseries/data[@timepoint='6h']>

在方括号中可能还有更复杂的条件(例如,使用或运算符、一些算法等)来选择您需要的节点。

于 2013-08-17T06:26:01.500 回答