poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allison, Timothy B." <talli...@mitre.org>
Subject RE: Getting all ContentControls
Date Thu, 14 May 2015 12:31:33 GMT
Great.  Thank you for letting me know that that solved your problem.  I'm a bit hesitant to
add that to XWPFDocument because it strips the SDTs of their context.  If the community thinks
we should add it to XWPFDocument, though, I'm not strongly against it.

Thank you again, and happy SDT processing!

Best,

          Tim

-----Original Message-----
From: Hayato Iriumi [mailto:hiriumi@gmail.com] 
Sent: Thursday, May 14, 2015 1:38 AM
To: POI Users List
Subject: Re: Getting all ContentControls

Timothy,

Thank you very much for your help! I was able to use the sample code (test
code rather) and get the result I wanted. I guess extractAllSDTs in
TestXWPFSDT.java could be implemented in XWPFDocument.java in the future,
right?

Again, thank you very much for your help! :)


2015-05-13 10:42 GMT-07:00 Allison, Timothy B. <tallison@mitre.org>:

> Because content controls can be recursive and can be held within recursive
> structures, you have to recurse to get all of them.
>
> You might want to take a look at
> org.apache.poi.xwpf.usermodel.TestXWPFSDT's extractAllSDTs(XWPFDoc) as a
> model.
>
>
> -----Original Message-----
> From: Hayato Iriumi [mailto:hiriumi@gmail.com]
> Sent: Wednesday, May 13, 2015 2:26 AM
> To: user@poi.apache.org
> Subject: Getting all ContentControls
>
> Hello,
>
> I'm trying to get a list of ContentControls in a word document. I've got an
> instance of XWPFDocument, but getBodyElements or getBodyElementsIterator
> only gives me back the first level of the document elements. The Content
> Controls I have are children to the tables in the document.
>
> I was looking for a convenient method that returns me all the document
> elements, but I have not been able to find one. Should I write my own code
> to give me all the elements in a word document or does POI already have
> something like this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message