public Object selectObject(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.evaluate(this); }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
@Override protected boolean appliesTo(Element e, IUserLayoutStore rdbmdls) { boolean rslt = false; // default boolean isUser = e.getName().equals(rootElementNodeName); if (isUser) { Object defaultUserElement = templateUserXPath.evaluate(e); if (defaultUserElement != null && defaultUserElement instanceof Node) { rslt = true; } } return rslt; } },
public Object selectObject(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.evaluate(this); }
public Object selectObject(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.evaluate(this); }
public Object selectObject(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.evaluate(this); }
public Object selectObject(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.evaluate(this); }
@Override protected boolean appliesTo(Element e, IUserLayoutStore rdbmdls) { boolean rslt = false; // default boolean isLayout = e.getName().equals(rootElementNodeName); if (isLayout) { String username = ((Node) documentNameXPath.evaluate(e)).getText(); rslt = !rdbmdls.isFragmentOwner(username); } return rslt; } },
@Override protected boolean appliesTo(Element e, IUserLayoutStore rdbmdls) { boolean rslt = false; // default boolean isLayout = e.getName().equals(rootElementNodeName); if (isLayout) { String username = ((Node) documentNameXPath.evaluate(e)).getText(); rslt = rdbmdls.isFragmentOwner(username); } return rslt; } },
public String getSafeFileNameWithExtension(Element e) { String namePart = ((Node) documentNameXPath.evaluate(e)).getText(); if (namePart == null) { String msg = "The XPath expression '" + documentNameXPath.getText() + "' didn't match any text in the specified element: " + e.getName(); throw new RuntimeException(msg); } return makeSafe(namePart) + "." + fileExtension; }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
protected void testXPath(Node node, String xpathText) { XPath xpath = node.createXPath(xpathText); Object object = xpath.evaluate(node); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
/** * A bug found by Stefan which results in IndexOutOfBoundsException for * empty results * * @throws Exception * DOCUMENT ME! */ public void testStefan() throws Exception { String text = "<foo>hello</foo>"; Document document = DocumentHelper.parseText(text); XPath xpath = DocumentHelper.createXPath("/x"); Object value = xpath.evaluate(document); }