Page 1 of 1

Nesting repeats?

PostPosted: Mon Aug 29, 2016 6:57 pm
by htrost
Hi,

I'm evaluating OpenDoPE and docx4j if it could replace a Custom XML Word solution which is not longer supported by Word since Word 2010.
We have some simple documents where I think OpenDoPE could be the solution but we have also documents with loops/repeats where we are having a loop depth of 7.
So I need to nest loops into loops. Is this possible with OpenDoPE and the Word Add In?

regards
Hagen

Re: Nesting repeats?

PostPosted: Mon Aug 29, 2016 10:09 pm
by jason
Hello Hagen

You can nest repeats, no problem.

cheers .. Jason

Re: Nesting repeats?

PostPosted: Tue Aug 30, 2016 7:34 pm
by htrost
Hi Jason,

I tried it many times but I was unable to get a nested repeat running.

The first repeat is working, but the second not.

For example:

I have this data structure
Code: Select all
<data>
   <element-list>
      <element>
         <name>element1</name>
         <child-list>
            <child>
               <name>child11</name>
            </child>
            <child>
               <name>child12</name>
            </child>
         </child-list>
      
      </element>
      <element>
         <name>element2</name>
         <child-list>
            <child-list>
            <child>
               <name>child21</name>
            </child>
            <child>
               <name>child22</name>
            </child>
         </child-list>
         </child-list>
      </element>
   </element-list>
</data>


The xpath of the first repeat is

/data[1]/element-list[1]/element

which iterates like expected over all element notes

How do I have to set the xpath of the second repeat if I would like to print out every child of an element. So that the result looks like

Code: Select all
element1
child11
child12

element2
child21
child22


Im doing it all with the Word Add In in Word 2016

Re: Nesting repeats?

PostPosted: Sun Sep 04, 2016 9:28 am
by jason
Which of our 2 OpenDoPE Word AddIns are you using?

YOu can do nested repeats with either...

It can help to be in Design Mode: Word Developer menu, Controls > Design Mode