On Tue, 8 Apr 2008, Yury Batrakov wrote:
> I'm working on extending XWPFWordExtractor's functionality to support
> extraction of hyperlinks.

Great news :) Please upload the diff to bugzilla once you're done, so
everyone can benefit from your improvements

> I am already done with hyperlinks' text, but unable to get their URLs.
> Exploring OOXML document structure, I found that URLs are stored as
> relationships in /word/_rels/document.xml.rels but i can't find POI code
> that loads them.

It's all handled via openxml4j - once you have the PackagePart for the
word document, you want to fetch all the relationships with the
relationship type of "hyperlink for word document" (check in the _rels
file to see what it actually is). From that PackageRelationshipCollection,
you can fetch out individual relationships by their id (it'll be r:id in
the word doc). The hyperlink's target is the target on the package
relationship

You'll probably want to take a look at how we do it for excel, as there's
now support for ooxml excel hyperlinks. See:
  src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java
  src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to