Package org.jdom.xpath

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


        Element root = document.getRootElement();
        if(root != null)
        {
            if(StringUtils.isNotEmpty(root.getNamespaceURI()))
            {
                xpath.addNamespace(NAMESPACE_PREFIX, root.getNamespaceURI());
            }
        }
        return xpath;
    }
   
View Full Code Here


  protected Element addProperty(Element beanElem, Document doc, String name, String ref, String value) {
    try {
      String selectString = "spring:property[@name='"+ name +"']";
     
      XPath xpath = XPath.newInstance(selectString);
      xpath.addNamespace("spring", springBeansNamespace.getURI());
      Object property = xpath.selectSingleNode(beanElem);
     
      if (property != null) {
        return (Element) property;
      }
View Full Code Here

  protected Element getBean(String className, Document doc) {
    try {
      String selectString = "//spring:bean[@class='"+ className +"']";
     
      XPath xpath = XPath.newInstance(selectString);
      xpath.addNamespace("spring", springBeansNamespace.getURI());
      Object beanNode = xpath.selectSingleNode(doc.getRootElement());
     
      return (Element) beanNode;
    } catch (JDOMException e) {
      throw new ArchMapperException("Error searching in the config file: "+ e.getMessage(), e);
View Full Code Here

            String defaultLanguage = "eng";
           
            try {
                // Extract resource identifier
                XPath xp = XPath.newInstance (resourceIdentifierXPath);
                xp.addNamespace("gmd", "http://www.isotc211.org/2005/gmd");
                xp.addNamespace("gco", "http://www.isotc211.org/2005/gco");
                @SuppressWarnings("unchecked")
                List<Element> resourceIdentifiers = xp.selectNodes(response);
                if (resourceIdentifiers.size() > 0) {
                    // Check if the metadata to import has a resource identifier
View Full Code Here

           
            try {
                // Extract resource identifier
                XPath xp = XPath.newInstance (resourceIdentifierXPath);
                xp.addNamespace("gmd", "http://www.isotc211.org/2005/gmd");
                xp.addNamespace("gco", "http://www.isotc211.org/2005/gco");
                @SuppressWarnings("unchecked")
                List<Element> resourceIdentifiers = xp.selectNodes(response);
                if (resourceIdentifiers.size() > 0) {
                    // Check if the metadata to import has a resource identifier
                    // existing in current catalog for a record with a different UUID
View Full Code Here

      XPath xp = XPath.newInstance ("//Layer[count(./*[name(.)='Layer'])=0] | " +
                      "//wms:Layer[count(./*[name(.)='Layer'])=0] | " +
                      "//wfs:FeatureType | " +
                      "//wcs:CoverageOfferingBrief | " +
                      "//sos:ObservationOffering");
      xp.addNamespace("wfs", "http://www.opengis.net/wfs");
      xp.addNamespace("wcs", "http://www.opengis.net/wcs");
      xp.addNamespace("wms", "http://www.opengis.net/wms");
      xp.addNamespace("sos", "http://www.opengis.net/sos/1.0");
                   
      @SuppressWarnings("unchecked")
View Full Code Here

                      "//wms:Layer[count(./*[name(.)='Layer'])=0] | " +
                      "//wfs:FeatureType | " +
                      "//wcs:CoverageOfferingBrief | " +
                      "//sos:ObservationOffering");
      xp.addNamespace("wfs", "http://www.opengis.net/wfs");
      xp.addNamespace("wcs", "http://www.opengis.net/wcs");
      xp.addNamespace("wms", "http://www.opengis.net/wms");
      xp.addNamespace("sos", "http://www.opengis.net/sos/1.0");
                   
      @SuppressWarnings("unchecked")
            List<Element> layers = xp.selectNodes(capa);
View Full Code Here

                      "//wfs:FeatureType | " +
                      "//wcs:CoverageOfferingBrief | " +
                      "//sos:ObservationOffering");
      xp.addNamespace("wfs", "http://www.opengis.net/wfs");
      xp.addNamespace("wcs", "http://www.opengis.net/wcs");
      xp.addNamespace("wms", "http://www.opengis.net/wms");
      xp.addNamespace("sos", "http://www.opengis.net/sos/1.0");
                   
      @SuppressWarnings("unchecked")
            List<Element> layers = xp.selectNodes(capa);
      if (layers.size()>0) {
View Full Code Here

                      "//wcs:CoverageOfferingBrief | " +
                      "//sos:ObservationOffering");
      xp.addNamespace("wfs", "http://www.opengis.net/wfs");
      xp.addNamespace("wcs", "http://www.opengis.net/wcs");
      xp.addNamespace("wms", "http://www.opengis.net/wms");
      xp.addNamespace("sos", "http://www.opengis.net/sos/1.0");
                   
      @SuppressWarnings("unchecked")
            List<Element> layers = xp.selectNodes(capa);
      if (layers.size()>0) {
        log.info("  - Number of layers, featureTypes or Coverages found : " + layers.size());
View Full Code Here

            String dummyNsPrefix = "";
            boolean addNsPrefix = !layer.getNamespace().equals(Namespace.NO_NAMESPACE);
            if (addNsPrefix) dummyNsPrefix = "x:";

            XPath mdUrl     = XPath.newInstance ("./" + dummyNsPrefix + "MetadataURL[@type='TC211' and " + dummyNsPrefix + "Format='text/xml']/" + dummyNsPrefix + "OnlineResource");
            if (addNsPrefix) mdUrl.addNamespace("x", layer.getNamespace().getURI());
            Element onLineSrc   = (Element) mdUrl.selectSingleNode (layer);

            // Check if metadataUrl in WMS 1.3.0 format
            if (onLineSrc == null) {
                mdUrl     = XPath.newInstance ("./" + dummyNsPrefix + "MetadataURL[@type='ISO19115:2003' and " + dummyNsPrefix + "Format='text/xml']/" + dummyNsPrefix + "OnlineResource");
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.