Examples of selectSingleNode()


Examples of org.jaxen.XPath.selectSingleNode()

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

Examples of org.jaxen.dom.DOMXPath.selectSingleNode()

    try
    {
      DOMXPath xPath = new DOMXPath(nodeSelector);
      for (String prefix : resource.getNamespaceContext().keySet())
        xPath.addNamespace(prefix, resource.getNamespaceContext().get(prefix));
      Node node = (Node) xPath.selectSingleNode(resource.getDocument().getDom());
      if (node == null)
        return null;
      return new XpathXmlResource(node);
    }
    catch (JaxenException e)
View Full Code Here

Examples of org.jaxen.dom.XPath.selectSingleNode()

     */
    public Node selectSingleNode(Node contextNode, String str)
    {
        try {
            XPath path = new XPath(str);
            return (Node)path.selectSingleNode((Object)contextNode);
        } catch (Exception e){
            // ignore it
        }
        return null;
    }
View Full Code Here

Examples of org.jaxen.dom4j.Dom4jXPath.selectSingleNode()

            map.put("default", XmlConstants.POM_DEFAULT_NAMESPACE);

            XPath xpath = new Dom4jXPath("/default:project/default:dependencies");
            xpath.setNamespaceContext(new SimpleNamespaceContext(map));
           
            dependenciesNode = (DefaultElement)xpath.selectSingleNode(pomDocument);
            readDependenciesListFromXmlNode(dependencies, dependenciesNode);
        }
        catch (JaxenException e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of org.jaxen.jdom.JDOMXPath.selectSingleNode()

                XPath xpath = new JDOMXPath("//" +
                                            NAMESPACE_PREFIX + ":" +
                                            MSS_CONFIG_MESSAGESTORE_ELEMENT);
                xpath.setNamespaceContext(nsContext);

                Element element = (Element) xpath.selectSingleNode(root);

                // Location
                config.setLocation(element.getAttributeValue(
                        MSS_CONFIG_LOCATION_ATTRIBUTE));
View Full Code Here

Examples of org.jaxen.xom.XOMXPath.selectSingleNode()

           
            long start = System.currentTimeMillis();
           
            int count = 0;
            for (int i = 0; i < 1000; i++) {
                Element speaker = (Element) xpath.selectSingleNode(doc);
                count += (speaker == null ? 0 : 1);
            }
           
            long end = System.currentTimeMillis();
            System.out.println((end - start));
View Full Code Here

Examples of org.jdom.xpath.XPath.selectSingleNode()

      } else if(type==Editor.JOB) {

        if(which != null && which.equalsIgnoreCase("close")) {
          onlyWarning = true;
          XPath x0 = XPath.newInstance("//job[@name='"+ name + "']");      
          Element e = (Element)x0.selectSingleNode(_dom.getDoc());
          boolean isOrder = Utils.getAttributeValue("order", e).equalsIgnoreCase("yes");

          if(!isOrder) {
            XPath x3 = XPath.newInstance("//job_chain_node[@job='"+ name + "']");        
            List listOfElement_3 = x3.selectNodes(_dom.getDoc());
View Full Code Here

Examples of org.jdom.xpath.XPath.selectSingleNode()

          if(name.length() == 0)
            return true;

          //
          XPath x0 = XPath.newInstance("//job[@name='"+ name + "']");      
          Element e = (Element)x0.selectSingleNode(_dom.getDoc());
          boolean isOrder = Utils.getAttributeValue("order", e).equalsIgnoreCase("yes");
          if( isOrder) {           

            XPath x = XPath.newInstance("//job[@name='"+ name + "']/run_time[@let_run='yes' or @once='yes' or @single_start]");      
View Full Code Here

Examples of org.jdom.xpath.XPath.selectSingleNode()

      ArrayList stateList = new ArrayList();
     
      try {
        String jobChainname = Utils.getAttributeValue("job_chain", getCommand());       
        XPath x3 = XPath.newInstance("//job_chain[@name='"+ jobChainname + "']");
        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = Utils.getAttributeValue("job_chain_node.job_chain", getCommand());
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
View Full Code Here

Examples of org.jdom.xpath.XPath.selectSingleNode()

        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = Utils.getAttributeValue("job_chain_node.job_chain", getCommand());
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
           
        }
        if(jobChain == null)
          return retVal;
       
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.