pnt.getContent(Filters.text()); // CDATA return getPositionPath(content, sibs, "text()", buffer);
public Optional<String> extractText(Document d, String xpath) { XPathExpression<Text> expression = XPathFactory.instance().compile( xpath, Filters.text()); return getText(expression.evaluate(d)); }
public MCRJDOMContent transform(MCRContent source) throws IOException { try { Element root = source.asXML().getRootElement().clone(); for (Text text : root.getDescendants(Filters.text())) { text.setText(MCRXMLFunctions.normalizeUnicode(text.getText())); } return new MCRJDOMContent(root); } catch (JDOMException | SAXException ex) { throw new IOException(ex); } } }