Page 1 of 1

Conditional list not showing right node - OpenDope

PostPosted: Mon Nov 11, 2013 3:35 am
by gingwa123
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.

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>

Re: Conditional list not showing right node - OpenDope

PostPosted: Tue Nov 12, 2013 9:36 am
by jason
It isn't directly analogous to XSLT.

For best results, your repeat content control should point at /TESTS/TEST

Then nest inside that, a condition content control /TESTS/TEST[id='1']

Then inside that, do what you want with detail.

Have a look at OpenDoPEHandler's processRepeat method to see exactly how it works.

If you need further help, you'll need to provide the docx containing the content controls and OpenDoPE parts.

Re: Conditional list not showing right node - OpenDope

PostPosted: Fri Nov 15, 2013 2:19 am
by gingwa123
thanks getting there slowly but surely :)