Codota Logo
XPath
Code IndexAdd Codota to your IDE (free)

How to use
XPath
in
play.libs

Best Java code snippets using play.libs.XPath (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: com.google.code.maven-play-plugin.org.playframework/play

public static Node selectNode(String path, Object node) {
  return selectNode(path, node, null);
}
origin: com.typesafe.play/play-java_2.10

/**
 * Select all nodes that are selected by this XPath expression. If multiple nodes match,
 * multiple nodes will be returned. Nodes will be returned in document-order,
 * @param path
 * @param node
 * @return
 */
public static NodeList selectNodes(String path, Object node) {
  return selectNodes(path, node, null);
}
origin: com.typesafe.play/play-java_2.10

/**
 * Return the text of a node, or the value of an attribute
 * @param path the XPath to execute
 * @param node the node, node-set or Context object for evaluation. This value can be null.
 */
public static String selectText(String path, Object node) {
  return selectText(path, node, null);
}
origin: com.typesafe.play/play-java_2.12

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    
    if (namespaces != null) {
      PlayNamespaceContext nsContext = new PlayNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (Node) xpath.evaluate(path, node, XPathConstants.NODE);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: com.google.code.maven-play-plugin.org.playframework/play

/**
 * Select all nodes that are selected by this XPath expression. If multiple nodes match, multiple nodes will be
 * returned. Nodes will be returned in document-order,
 * 
 * @param path
 *            Path expression
 * @param node
 *            The node object
 * @param namespaces
 *            Namespaces that need to be available in the xpath, where the key is the prefix and the value the
 *            namespace URI
 * @return Nodes in document-order
 */
@SuppressWarnings("unchecked")
public static List<Node> selectNodes(String path, Object node, Map<String, String> namespaces) {
  try {
    return getDOMXPath(path, namespaces).selectNodes(node);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: com.typesafe.play/play-java_2.11

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    
    if (namespaces != null) {
      PlayNamespaceContext nsContext = new PlayNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (Node) xpath.evaluate(path, node, XPathConstants.NODE);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: com.google.code.maven-play-plugin.org.playframework/play

/**
 * Return the text of a node, or the value of an attribute
 * 
 * @param path
 *            the XPath to execute
 * @param node
 *            the node, node-set or Context object for evaluation. This value can be null.
 * @param namespaces
 *            The name spaces
 * @return The text of a node
 */
public static String selectText(String path, Object node, Map<String, String> namespaces) {
  try {
    Node rnode = (Node) getDOMXPath(path, namespaces).selectSingleNode(node);
    if (rnode == null) {
      return null;
    }
    if (!(rnode instanceof Text)) {
      rnode = rnode.getFirstChild();
    }
    if (!(rnode instanceof Text)) {
      return null;
    }
    return ((Text) rnode).getData();
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: play/play-java

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    
    if (namespaces != null) {
      SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (Node) xpath.evaluate(path, node, XPathConstants.NODE);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: com.typesafe.play/play-java

/**
 * Select all nodes that are selected by this XPath expression. If multiple nodes match,
 * multiple nodes will be returned. Nodes will be returned in document-order,
 * @param path the xpath expression
 * @param node the starting node
 * @return result of evaluating the xpath expression against node
 */
public static NodeList selectNodes(String path, Object node) {
  return selectNodes(path, node, null);
}
origin: com.typesafe.play/play-java_2.11

/**
 * @param path the XPath to execute
 * @param node the node, node-set or Context object for evaluation. This value can be null.
 * @return the text of a node, or the value of an attribute
 */
public static String selectText(String path, Object node) {
  return selectText(path, node, null);
}
origin: play/play-java

public static Node selectNode(String path, Object node) {
  return selectNode(path, node, null);
}
origin: com.typesafe.play/play-java_2.10

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    
    if (namespaces != null) {
      SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (Node) xpath.evaluate(path, node, XPathConstants.NODE);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: com.typesafe.play/play-java_2.12

/**
 * Select all nodes that are selected by this XPath expression. If multiple nodes match,
 * multiple nodes will be returned. Nodes will be returned in document-order,
 * @param path the xpath expression
 * @param node the starting node
 * @return result of evaluating the xpath expression against node
 */
public static NodeList selectNodes(String path, Object node) {
  return selectNodes(path, node, null);
}
origin: com.typesafe.play/play-java_2.12

/**
 * @param path the XPath to execute
 * @param node the node, node-set or Context object for evaluation. This value can be null.
 * @return the text of a node, or the value of an attribute
 */
public static String selectText(String path, Object node) {
  return selectText(path, node, null);
}
origin: com.typesafe.play/play-java_2.10

public static Node selectNode(String path, Object node) {
  return selectNode(path, node, null);
}
origin: com.typesafe.play/play-java

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    
    if (namespaces != null) {
      PlayNamespaceContext nsContext = new PlayNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (Node) xpath.evaluate(path, node, XPathConstants.NODE);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: play/play-java

/**
 * Select all nodes that are selected by this XPath expression. If multiple nodes match,
 * multiple nodes will be returned. Nodes will be returned in document-order,
 * @param path
 * @param node
 * @return
 */
public static NodeList selectNodes(String path, Object node) {
  return selectNodes(path, node, null);
}
origin: com.typesafe.play/play-java

/**
 * @param path the XPath to execute
 * @param node the node, node-set or Context object for evaluation. This value can be null.
 * @return the text of a node, or the value of an attribute
 */
public static String selectText(String path, Object node) {
  return selectText(path, node, null);
}
origin: com.typesafe.play/play-java_2.11

public static Node selectNode(String path, Object node) {
  return selectNode(path, node, null);
}
origin: com.typesafe.play/play-java_2.10

/**
 * Return the text of a node, or the value of an attribute
 * @param path the XPath to execute
 * @param node the node, node-set or Context object for evaluation. This value can be null.
 */
public static String selectText(String path, Object node, Map<String, String> namespaces) {
  try {
    XPathFactory factory = XPathFactory.newInstance();
    javax.xml.xpath.XPath xpath = factory.newXPath();
    if (namespaces != null) {
      SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
      bindUnboundedNamespaces(nsContext, namespaces);
      xpath.setNamespaceContext(nsContext);
    }
    return (String) xpath.evaluate(path, node, XPathConstants.STRING);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
play.libsXPath

Javadoc

XPath for parsing

Most used methods

  • selectNode
  • selectNodes
    Select all nodes that are selected by this XPath expression. If multiple nodes match, multiple nodes
  • selectText
    Return the text of a node, or the value of an attribute
  • bindUnboundedNamespaces
  • getDOMXPath

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now