Can't get the DOM Node text representation of the markup

Nadav Benedek <[email protected]>
Newsgroups gmane.comp.jakarta.poi.user
Message-ID <pony-01b0ff76b18f9698e0b4573376aa6c3c3ac417e9-b2f57dbcf10dc3b20e34b80221261849f09b36f1@user.poi.apache.org>
fix diff_iterator run line 325. 
also check why the text extraction does show the new lines <w:br/>



I need to work with the underlying DOM nodes in order to do some manipulations to the .docx.
However, I can't find a way to get the info from a DOM Node element.

Let's say I have a run: run

If I take the underlying dom element: originalRun.getCTR().getDomNode()
I can't extract the representation.

However, if I use Factory.Parse, on some elements I can , and on others I can't
For example this works:
CTRPr.Factory.parse(run.getCTR().getDomNode().getChildNodes().item(0))

But on CTText it doesnt:
CTText.Factory.parse(run.getCTR().getDomNode().getChildNodes().item(1))

any idea how can I easily get all the data?

2. when I use dom nodes, I can easily traverse a Run, by doing: run.getCTR().getDomNode().getChildNodes(). Is there an option to do it in the POI Level, something like run.getAllElements/getAllChildren? Can't find it...


I am using POI 3.17
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.