开发者

iterating over parallel xml elements in xslt

  <var>1</var>
      <value>not null</value>
      <var>2</var>
      <value>00FFFFFFF555555000100673</value>
  开发者_开发百科    <var>3</var>
      <value>9694r</value>

If it were a list of vars I can iterate like

 <xsl:for-each select="var">
    ..  crap code
 </xsl:for-each>

But I need to catch the value related to var whenever i catch the var ,and display it in a table. I guess this is bad design , but I'm knee deep.


You could try using:

<xsl:value-of select="following-sibling::value"/>

in place of "crap code".


You can use the following-sibling axis:

<xsl:for-each select="var">
   <xsl:value-of select="./following-sibling::value[1]" />
</xsl:for-each>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜