如何获取xml属性值

Somasundaram NP

我有一个聚合会产生这样的输出,但是我需要使用xpath从键中获取名称,我是这个xml的新手,请指教。

<Aggregation name="area">
      <Set key="name">
        <Entry key="docCount">20</Entry>
      </Set>
      <Set key="name1">
        <Entry key="docCount">16</Entry>
      </Set>
      <Set key="name2">
        <Entry key="docCount">12</Entry>
      </Set>
      </Aggregation>

谢谢

Somasundaram NP

终于,我找回了价值

 <Report>
             <for-each select="$docSets" in="docSet">   
                <Key>{$docSet/@key}</Key>
                <Value>{$docSet//Entry/text()}</Value>
            </for-each>
   </Report>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章