Package org.jaxen.jdom

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


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

                element = (Element) xpath.selectSingleNode(root);
                config.setLog4jConfigurationFile(
                        element.getAttributeValue(MSS_CONFIG_LOG4J_ATTRIBUTE));
            } else {
                handleConfigError(null);
            }
View Full Code Here

    sh.endElement ("", "temporary-root", "temporary-root");
    sh.endDocument();
    org.jdom.Element temporaryRoot = sh.getDocument().getRootElement();
    XPath xpath = new JDOMXPath("/temporary-root/row[2]");
    org.jdom.Element painter
        = (org.jdom.Element)xpath.selectSingleNode(temporaryRoot);
    String value = painter.getAttribute("title").getValue();
    // check testXSLT.xml for the expected result
    assertTrue(value.equals("The Artist's Garden at Vetheuil"));
      }
  }
View Full Code Here

        try {
            JDOMXPath xpath = new JDOMXPath(xpathProperty);
            xpath.setNamespaceContext(new SimpleNamespaceContext(mapNs));
            // Select the node to update and check it exists
            return SelectResult.of(xpath.selectSingleNode(metadataRecord));
        } catch (JaxenException e) {
            Log.warning(Geonet.EDITORADDELEMENT, "An illegal xpath was used to locate an element: " + xpathProperty);
            return SelectResult.ERROR;
        }
    }
View Full Code Here

      // populate licenses container
      this.licenses.clear();
      for (int i = 0; i < results.size(); i++) {
        Element license = results.get(i);
        // add if not filtered
        String liD = ((Attribute)xp_LicenseID.selectSingleNode(license)).getValue();
        if (! lcFilter.contains(liD)) {
          this.licenses.add(new CCLicense(liD, license.getText(), i));
        }
      }
    } catch (JaxenException jaxen_e) {
View Full Code Here

   */
  public String getLicenseUrl() {
    String text = null;
    try {
      JDOMXPath xp_LicenseName = new JDOMXPath("//result/license-uri");
        text =  ((Element)xp_LicenseName.selectSingleNode(this.license_doc)).getText();
    }
    catch (Exception e) {
      log.warn(e.getMessage());
      setSuccess(false);
      text = "An error occurred getting the license - uri.";
View Full Code Here

   */
  public String getLicenseName() {
    String text = null;
    try {
      JDOMXPath xp_LicenseName = new JDOMXPath("//result/license-name");
      text =  ((Element)xp_LicenseName.selectSingleNode(this.license_doc)).getText();
    }
    catch (Exception e) {
      log.warn(e.getMessage());
      setSuccess(false);
      text = "An error occurred on the license name.";
View Full Code Here

      JDOMXPath xpathRdf         = new JDOMXPath("//result/rdf");
      JDOMXPath xpathLicenseRdf         = new JDOMXPath("//result/licenserdf");
      XMLOutputter xmloutputter   = new XMLOutputter();
      Element rdfParent             = ((Element)xpathRdf.selectSingleNode(this.license_doc));
      xmloutputter.output(rdfParent, outputstream);
      Element licenseRdfParent       = ((Element)xpathLicenseRdf.selectSingleNode(this.license_doc));
      outputstream.write("\n".getBytes());
      xmloutputter.output(licenseRdfParent, outputstream);
      outputstream.write("\n</result>\n".getBytes());
    } catch (Exception e) {
      log.warn("An error occurred getting the rdf . . ." + e.getMessage() );
View Full Code Here

    java.io.ByteArrayOutputStream outputstream = new java.io.ByteArrayOutputStream();
    JDOMXPath xp_Success = null;
    String text = null;
    try {
      xp_Success = new JDOMXPath("//message");
      text =  ((Element)xp_Success.selectSingleNode(this.license_doc)).getText();
      setErrorMessage(text);
    }
    catch (Exception e) {
      log.warn("There was an issue . . . " + text);
      setSuccess(true);
View Full Code Here

        Element root = doc.getRootElement();
       
        try {
            JDOMXPath endpointXPath = new JDOMXPath("services/service[@id='migrate1']/endpoint");
           
            Element endpoint = (Element)endpointXPath.selectSingleNode(root);
           
            endpoint.setText(wsdlLocation);
           
            String settings = selectedPlan.getRecommendation().getAlternative().getExperiment().getSettings();
           
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.