Package org.jaxen

Examples of org.jaxen.XPath.selectSingleNode()


    }
   
    public void testNullPointerException() throws JaxenException {
        Document doc = DocumentHelper.createDocument();
        XPath xpath = new Dom4jXPath("/foo");
        xpath.selectSingleNode(doc);
    }   
   
   
}
View Full Code Here


            for (int j = 0; j < 10; j++)
            {
                long start2 = System.currentTimeMillis();
                for (int i = 0; i < 100; i++)
                {
                    XmlCursor speaker = (XmlCursor)xpath.selectSingleNode(docXC);
                    count += (speaker == null ? 0 : 1);
                }
                //System.out.println((j*100) + "                \t" + (System.currentTimeMillis()-start2));
            }

View Full Code Here

   * @return The title of the document, or <code>null</code> if we can't find the title.
   */
  private String getTitle(Document document) throws MojoExecutionException {
    try {
      XPath titleXPath = createTitleXPath();
      Node titleNode = (Node) titleXPath.selectSingleNode(document);
      if (titleNode != null) {
        return titleNode.getNodeValue();
      } else {
        return null;
      }
View Full Code Here

     */
    public String getString(OMElement root, String query) {
        prepareRoot(root);
        try {
            XPath xpath = getXPathUsingCache(query);
            OMNode node = (OMNode) xpath.selectSingleNode(root);
            String result = null;
            if (node instanceof OMElement) {
                OMElement element = (OMElement) node;
                result = element.getText();
            } else if (node instanceof OMAttribute) {
View Full Code Here

     */
    public OMElement getElement(OMElement root, String query) {
        prepareRoot(root);
        try {
            XPath xpath = getXPathUsingCache(query);
            OMNode node = (OMNode) xpath.selectSingleNode(root);
            OMElement result = null;
            if (node instanceof OMElement) {
                result = (OMElement) node;
            }
            return result;
View Full Code Here

    String path,
    Base base,
    Map<String,String> namespaces) throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces);
      return xpath.selectSingleNode(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
 
View Full Code Here

     * @return The title of the document, or <code>null</code> if we can't find the title.
     */
    private String getTitle(Document document) throws MojoExecutionException {
        try {
            XPath titleXPath = createTitleXPath();
            Node titleNode = (Node) titleXPath.selectSingleNode(document);
            if (titleNode != null) {
                return titleNode.getNodeValue();
            } else {
                return null;
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.