Conditional list not showing right node - OpenDope
Posted: Mon Nov 11, 2013 3:35 am
I'm trying to list under a "test" what tests failed and their details. So if i wanted to say select all the tests with id 1 and then display in a table their contents
/TESTS/TEST[id='1']
I then want to select detail and somethingelse
would their nested applicabilities be:
/TESTS/TEST[id='1']/detail
/TESTS/TEST/detail
or
./detail
Normally in XSLT I would do:
<xsl:for-each select="//TEST[id='1']"> <---- Repeat
<xsl:value-of select="./detail"/> <--- Bindings
<xsl:value-of select="./somethingelse"/> <---- Bindings
</xsl:for-each>
I either get the same item repeated (first in the document) or blank. It works fine if I don't have a condition in xpath so a little confused.
/TESTS/TEST[id='1']
I then want to select detail and somethingelse
would their nested applicabilities be:
/TESTS/TEST[id='1']/detail
/TESTS/TEST/detail
or
./detail
Normally in XSLT I would do:
<xsl:for-each select="//TEST[id='1']"> <---- Repeat
<xsl:value-of select="./detail"/> <--- Bindings
<xsl:value-of select="./somethingelse"/> <---- Bindings
</xsl:for-each>
I either get the same item repeated (first in the document) or blank. It works fine if I don't have a condition in xpath so a little confused.
- Code: Select all
<TESTS>
<TEST>
<id>1</id>
<detail>something</detail>
<somethingelse>blahblah</somethingelse>
</TEST>
<TEST>
<id>1</id>
<detail>something</detail>
<somethingelse>blahblah</somethingelse>
<TEST>
<id>2</id>
<detail>something</detail>
<somethingelse>blahblah</somethingelse>
<TEST>
</TESTS>