* @param result The new TITLE element being constructed.
*/
private static void extractTitle(Element head, Element title, String titlekey, Element result) {
// Make the result look like the title
Text titletext = (Text)title.getFirstChild();
result.clearChildren();
result.addChild(titletext);
// Extract any text or processors from the title element's attributes
if (hasAttribute(title, StandardDialect.PREFIX, StandardUtextAttrProcessor.ATTR_NAME)) {
result.setNodeProperty(titlekey, getAttributeValue(title,
StandardDialect.PREFIX, StandardUtextAttrProcessor.ATTR_NAME));
}
else if (hasAttribute(title, StandardDialect.PREFIX, StandardTextAttrProcessor.ATTR_NAME)) {
result.setNodeProperty(titlekey, getAttributeValue(title,
StandardDialect.PREFIX, StandardTextAttrProcessor.ATTR_NAME));
}
// Extract text from a previously set value (deep hierarchies)
else if (title.hasNodeProperty(titlekey)) {
result.setNodeProperty(titlekey, title.getNodeProperty(titlekey));
}
// Extract text from the title element's content
else if (titletext != null) {
result.setNodeProperty(titlekey, titletext.getContent());
}
pullAttributes(result, title);
head.removeChild(title);
}