TextRecord textRecord = new TextRecord(((redirectionURI != null) ? redirectionURI : uri),
jxlDocument.getOutputEncoding(), jxlDocument.isUseHiresMargins());
if (redirectionURI != null) {
textRecord.setAlternateURI(uri);
}
TextRecordResult result = new TextRecordResult(textRecord, jxlDocument.getURIRewriter(),
jxlDocument.getTextColorBrightness(),
jxlDocument.isParseTables(), pluckerDocument);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new DOMSource(node), result);
pluckerDocument.addRecord(textRecord);
String[] linkURIs = result.getLinkURIs();
for (int i = 0; i < linkURIs.length; i++) {
String linkURI = linkURIs[i];
addPageLink(linkURI);
}
String[] imageURIs = result.getEmbeddedImageURIs();
for (int i = 0; i < imageURIs.length; i++) {
String imageURI = imageURIs[i];
addImageLink(imageURI);
}
// Add bookmarks defined by the page.
Bookmark[] bookmarks = result.getBookmarks();
for (int i = 0; i < bookmarks.length; i++) {
Bookmark bookmark = bookmarks[i];
pluckerDocument.addBookmark(bookmark);
}
// Process AutoBookmarks
BookmarkProcessor processor = jxlDocument.getBookmarkProcessor();
String title = result.getTitle();
processor.process(pluckerDocument, uri, title);
}