Closed eum2o closed 2 years ago
Thanks for the feedback, @eum2o. Will look into this.
TraversalUtil
and ClassFinder
instead.Note: The impl used now doesn't supporting finding SdtElement
objects, though. It recognizes them and then returns the contents found in them. See org.docx4j.TraversalUtil.getChildrenImpl(Object)
.
So: It will still find Text
elements in them - as requested for this issue.
If we need to find those direct nodes, too, we should maybe discuss contributing to Docx4J.
Tested with docwriter 2.1.0
Description The mentioned method does not find texts in
SdtElement
s (which are used e.g. for TOCs) because they are not of typeContentAccessor
, thus their children are not examined.See DocxDataInspector.java#L47
Given A document can have content (in the body of the main document) like this:
Example Call
Problem/Bug
texts
contains "Change History" and "Table of Contents"texts
contains "Change History"Hint Think about reusing
org.docx4j.TraversalUtil
, to avoid duplicating the traversal stuff. For example as a workaround I used something like