Page 1 of 1

Cannot get repeating data to work

PostPosted: Mon May 23, 2011 7:57 pm
by andrew
I am having trouble getting repeating data to work.

Stepping through the code, the xpath returns 0 repeating elements from my custom xml, however if I upload my xml and xpath expression to one of the XPath test sites, it returns 3 elements.

My data looks like:

<accountInstruction>
<securities>
<security>
<security>
<security>
</securities>
</accountInstruction>

And my repeat xpath is: /accountInstruction[1]/securities[1]/security

I am using docx4j version 2.6.0.

I am not an XPath expert, any suggestions?

Thanks,
Andrew

Re: Cannot get repeating data to work

PostPosted: Mon May 23, 2011 11:33 pm
by jason
Your customxml part (item3.xml) declares a default namespace.

Your docm worked for me when I removed the default namespace.

iirc, the add-in walkthrough contains guidance on how to make namespaces work properly.

In terms of the open xml spec, the namespace needs to be included on the w:databinding element.

Gotta run ... Jason