Examples of selectSingleNode()


Examples of org.apache.commons.jxpath.JXPathContext.selectSingleNode()

        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);

            return jxContext.selectSingleNode(name);
        } catch (Exception e) {
            throw new ConfigurationException("Module does not support <" + name + ">" + "attribute.", e);
        }
    }
View Full Code Here

Examples of org.apache.excalibur.xml.xpath.XPathProcessor.selectSingleNode()

                    String xpath = bindingElm.getAttribute("xpath");
                    if (!xpath.equals("")) {
                        XPathProcessor xpathProcessor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);
                        try {
                            Node node = xpathProcessor.selectSingleNode(document, xpath);
                            if (node == null)
                                throw new BindingException("XPath expression \"" + xpath + "\" didn't return a result.");
                            if (!(node instanceof Element))
                                throw new BindingException("XPath expression \"" + xpath + "\" did not return an element node.");
                            element = (Element)node;
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.selectSingleNode()

        assertNotNull(response);

        SynapseXPath xPath = new SynapseXPath("//return");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement returnEle = (OMElement) xPath.selectSingleNode(response);

        assertNotNull(returnEle);

        assertEquals(returnEle.getText().trim(),"100");
View Full Code Here

Examples of org.apache.xmlbeans.impl.xpath.jaxen.XBeansXPath.selectSingleNode()

            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

Examples of org.apache.xpath.CachedXPathAPI.selectSingleNode()

            CachedXPathAPI xpathAPI = new CachedXPathAPI();

            Element nsctx = doc.createElement("nsctx");
            nsctx.setAttribute("xmlns:ds", Constants.SignatureSpecNS);

            Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                    "//ds:Signature", nsctx);

            // check to make sure that the document claims to have been signed
            if (signatureElem == null) {
                System.out.println("The document is not signed");
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

    String linkTarget = computeDirLinkTarget(dirlinkFolder, target);
    SAXReader saxReader = new SAXReader();
    try {
      File dirlinkFile = new File(dirlink.getLocationURI().getPath());
      Document document = saxReader.read(dirlinkFile);
      Element ele = (Element)document.selectSingleNode("/dirlink/path");    //TODO use statics
      ele.addAttribute("location", linkTarget);                //TODO use statics
        XMLWriter output = new XMLWriter(new FileWriter(dirlinkFile));
        try {
          output.write( document );
        } finally {
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

          File catalinaBase = new File(WGADesignerPlugin.getDefault().getStateLocation().toFile(), "tomcat_current");
          File conf = new File(catalinaBase, "conf");
          File serverXML = new File(conf, "server.xml");
          SAXReader reader = new SAXReader();
          Document doc = reader.read(serverXML);
          Element serverElement = (Element) doc.selectSingleNode("/Server");
          String serverPort = serverElement.attributeValue("port", "8005");
          String shutdownCommand = serverElement.attributeValue("shutdown", "SHUTDOWN");
         
          // send shutdown command to specified port
          Socket socket = new Socket();
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

            File componentConfig = new File(componentDir, "component.xml");
            if (componentConfig.exists()) {
                SAXReader saxReader = new SAXReader();
                Document componentXML = saxReader.read(componentConfig);
                ComponentClassLoader classLoader = new ComponentClassLoader(componentDir);
                String className = componentXML.selectSingleNode("/component/class").getText();
                String subdomain = componentXML.selectSingleNode("/component/subdomain").getText();
                //component = (Component)classLoader.loadClass(className).newInstance();
                Class aClass = classLoader.loadClass(className);
                component = (Component)aClass.newInstance();
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

            if (componentConfig.exists()) {
                SAXReader saxReader = new SAXReader();
                Document componentXML = saxReader.read(componentConfig);
                ComponentClassLoader classLoader = new ComponentClassLoader(componentDir);
                String className = componentXML.selectSingleNode("/component/class").getText();
                String subdomain = componentXML.selectSingleNode("/component/subdomain").getText();
                //component = (Component)classLoader.loadClass(className).newInstance();
                Class aClass = classLoader.loadClass(className);
                component = (Component)aClass.newInstance();

                manager.addComponent(subdomain, component);
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

                File webXML = new File(componentDir, "web" + File.separator + "web.xml");
                if (webXML.exists()) {
                    ComponentServlet.registerServlets(this, component, webXML);
                }
                // If there a <adminconsole> section defined, register it.
                Element adminElement = (Element)componentXML.selectSingleNode("/component/adminconsole");
                if (adminElement != null) {
                    // If global images are specified, override their URL.
                    Element imageEl = (Element)adminElement.selectSingleNode(
                            "/component/adminconsole/global/logo-image");
                    if (imageEl != 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.