use of org.jaxen.dom.DocumentNavigator in project mycore by MyCoRe-Org.
the class MCRRepeatBinding method getElementNameWithPredicates.
@SuppressWarnings("unchecked")
public String getElementNameWithPredicates() throws JaxenException {
BaseXPath baseXPath = new BaseXPath(xPath, new DocumentNavigator());
Expr rootExpr = baseXPath.getRootExpr();
LocationPath locationPath = (LocationPath) rootExpr;
List<Step> steps = locationPath.getSteps();
Step lastStep = steps.get(steps.size() - 1);
return MCRNodeBuilder.simplify(lastStep.getText());
}
use of org.jaxen.dom.DocumentNavigator in project mycore by MyCoRe-Org.
the class MCRXEditorTransformer method createRootElement.
private Element createRootElement(String xPath) throws JaxenException {
BaseXPath baseXPath = new BaseXPath(xPath, new DocumentNavigator());
LocationPath lp = (LocationPath) (baseXPath.getRootExpr());
NameStep nameStep = (NameStep) (lp.getSteps().get(0));
String prefix = nameStep.getPrefix();
Namespace ns = prefix.isEmpty() ? Namespace.NO_NAMESPACE : MCRConstants.getStandardNamespace(prefix);
return new Element(nameStep.getLocalName(), ns);
}
Aggregations