Page 1 of 1

Authoring tool issues

PostPosted: Tue Jul 07, 2015 7:48 pm
by Maarten
Hi,

Background: We are investigating wether we can use Docx4j in our reporting chain. One of the requirements would be a GUI authoring tool and nested repeats.
When experimenting with the Authoring tool, I've been running into a few issues. Notably around repeats.
Word version: 15.0.4724.1003 | Windows 7 latest SP

1. Consistently repeatable: At a certain point in the XML, we can no longer drag the nodes into the word file. Every XML leaf up to and including "/group[1]/resourceusetree[1]/events[1]/event[1]/name[1]" can be dragged. Everything beyond that is results in unbound controls. Both data and repeats.

Any attempt to clean up, modify, change line endings, etc. and replacing the xml of the docx file has had no result. We can recreate this problem on different installations.
Strangely, it seems to be related to the docx file itself. creating a blanc new docx file and trying the bindings again works as intended.
Note: Original file (attached) was created using a Dutch + Belgian Office installation. The working docx was created later using an English Office installation.

2. Trying a repeat in a repeat in a repeat, I caused Word to crash. Since then, this file is no longer usable. I can't use this file to generate an interred & bound docx/pdf using docx4j no more. Some diagnostics in both the authoring tool and docx4j would be nice.
Note: Original file (attached) was created using English Office.

3. Using the Authoring tool (friendly) and Authoring advanced causes Word to behave erratically. Which is the preferred tool? We prefer the friendly of course.

4. The tool is easily confused what field you have selected (for the edit, remove mappings, etc.). Is this a Word limitation or could this be improved?

5. Add-in feedback: It would be nice to not only have the inspection of the XML, but also a generated DOCX based on the internal (or supplied) XML. This to be able to test the repeats. Using advanced repeats in conjunction with tables does require "live" previews to be able to debug. My take on this is that it doesn't have to run in a web service, but could just open up a generated (inserted and bound) docx file in Word itself.

edit: fix numbering.

Re: Authoring tool issues

PostPosted: Wed Jul 15, 2015 10:04 pm
by jason
Maarten wrote:1. Consistently repeatable: At a certain point in the XML, we can no longer drag the nodes into the word file. Every XML leaf up to and including "/group[1]/resourceusetree[1]/events[1]/event[1]/name[1]" can be dragged. Everything beyond that is results in unbound controls. Both data and repeats.

Any attempt to clean up, modify, change line endings, etc. and replacing the xml of the docx file has had no result. We can recreate this problem on different installations.
Strangely, it seems to be related to the docx file itself. creating a blanc new docx file and trying the bindings again works as intended.
Note: Original file (attached) was created using a Dutch + Belgian Office installation. The working docx was created later using an English Office installation.


The problem here is that the XPaths part (stored in the docx, in this case in /customXml/item1.xml) contains two entries with the same ID:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
        <xpath id="IwDTG">
                <dataBinding xpath="/group[1]/resourceusetree[1]/events[1]/event[1]" storeItemID="{ECA7D178-4334-4B5E-A2E9-7302202758E9}"/>
        </xpath>
        <xpath id="IwDTG">
                <dataBinding xpath="/group[1]/resourceusetree[1]/events[1]/event" storeItemID="{ECA7D178-4334-4B5E-A2E9-7302202758E9}"/>
        </xpath>
 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Manually deleting the duplicate entry fixes the problem. I haven't looked into how the duplicate entries may have arisen. Do you recall whether you used both authoring tools to create this docx, or just the friendly drag/drop one?

Re: Authoring tool issues

PostPosted: Wed Jul 15, 2015 10:16 pm
by jason
Maarten wrote:2. Trying a repeat in a repeat in a repeat, I caused Word to crash. Since then, this file is no longer usable. I can't use this file to generate an interred & bound docx/pdf using docx4j no more. Some diagnostics in both the authoring tool and docx4j would be nice.
Note: Original file (attached) was created using English Office.


docx4j tells me:

Code: Select all
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Failed to getPart
   at org.docx4j.openpackaging.io3.Load3.getRawPart(Load3.java:581)
   at org.docx4j.openpackaging.io3.Load3.getPart(Load3.java:342)
   at org.docx4j.openpackaging.io3.Load3.addPartsFromRelationships(Load3.java:250)
   ... 10 more
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Problems parsing InputStream for part /null
   at org.docx4j.openpackaging.parts.XmlPart.setDocument(XmlPart.java:92)
   at org.docx4j.openpackaging.io3.Load3.getRawPart(Load3.java:537)
   ... 12 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
   at org.docx4j.openpackaging.parts.XmlPart.setDocument(XmlPart.java:90)
   ... 13 more


Your customXml/item4.xml is blank.

That's stopping docx4j from opening the docx.

If you edit item4.xml to include say:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
<?xml version="1.0"?>
<foo/>
 
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


things work.

Re: Authoring tool issues

PostPosted: Thu Jul 16, 2015 1:32 am
by Maarten
Manually deleting the duplicate entry fixes the problem. I haven't looked into how the duplicate entries may have arisen. Do you recall whether you used both authoring tools to create this docx, or just the friendly drag/drop one?

That may very well the case, I was still figuring out how to use your plugins and had both of them active. Since I shortly after removed the advanced one, no other docxs had this issue.

Your customXml/item4.xml is blank.

Curious, no idea how this got blank. It would be nice to see this debug in Word itself.

Would/should reloading the xml data part not refresh and solve both point 1 and 2?

Kind regards,
Maarten @ Yesplan

Re: Authoring tool issues

PostPosted: Fri Jul 17, 2015 10:22 pm
by jason
Definitely avoid having both authoring plugins active at once!

That seems the most likely cause of #1, and could well have caused #2.

Re: Authoring tool issues

PostPosted: Fri Jul 17, 2015 10:30 pm
by jason
Maarten wrote:5. Add-in feedback: It would be nice to not only have the inspection of the XML, but also a generated DOCX based on the internal (or supplied) XML. This to be able to test the repeats. Using advanced repeats in conjunction with tables does require "live" previews to be able to debug. My take on this is that it doesn't have to run in a web service, but could just open up a generated (inserted and bound) docx file in Word itself.


A web app is an obvious way to do this, either the author manually uploading to test (which you could setup yourself), or integrated into the addin (which I'd have to do, until such time as the authoring tool is open sourced).

But, as you say, it could be done in the AddIn itself, using docx4j.net (which is how the Docx4jHelper AddIn works).

Re: Authoring tool issues

PostPosted: Tue Aug 11, 2015 7:05 pm
by Maarten
Hi Jason,

Thank you for your replies so far!

#2 I highly doubt it, as far as I recall I had already removed the "advanced" plugin.

What's your take on 3 and 4?

Kind regards,
Maarten @ Yesplan