Package org.jdom

Examples of org.jdom.Namespace


    }

    @Override
    public void writeSchema(Element root)
    {
        Namespace xsd = Namespace.getNamespace(SoapConstants.XSD_PREFIX, SoapConstants.XSD);
       
        Element simple = new Element("simpleType",xsd );
        simple.setAttribute(new Attribute("name", getSchemaType().getLocalPart()));
        root.addContent(simple);
       
View Full Code Here


        assertEquals(data.getInHeaders().getAction(), "http://example.org/action/notify");
        assertEquals(data.getInHeaders().getReplyTo().getAddress(),
                     "http://www.w3.org/2005/08/addressing/none");
        Element params = data.getInHeaders().getReplyTo().getReferenceParametersElement();
        final Namespace customerNamespace = Namespace.getNamespace("customer",
                                                                   "http://example.org/customer");
        Attribute level = params.getAttribute("level", customerNamespace);
        assertNotNull(level);
        assertEquals(level.getValue(), "premium");
        Element customerKey = params.getChild("CustomerKey", customerNamespace);
View Full Code Here

      XMLOutputter xmlOut = new XMLOutputter();
      System.out.println("*** NetcdfDataset/showParsedXML = \n" + xmlOut.outputString(doc) + "\n*******");
    }

    Element netcdfElem = doc.getRootElement();
    Namespace use = netcdfElem.getNamespace(); // detect incorrect namespace
    if (!use.equals(ncNS)) {
      errlog.format("Incorrect namespace specified in NcML= %s must be %s%n", use.getURI(), ncNS.getURI());
      return null;
    }

    Element aggElem = netcdfElem.getChild("aggregation", ncNS);
    if (aggElem == null) {
View Full Code Here

        } catch (JDOMException e) {
            errlog.append(e.toString());
        }

        Element   qcElem = doc.getRootElement();
        Namespace ns     = qcElem.getNamespace();


        return new TDSRadarDatasetCollection(desc, dsc_location, qcElem, ns,
                                             errlog);
    }
View Full Code Here

    return Collections.singletonList(folder);
  }

  private void processSavedSearch(Element savedSearchElement, IFolder folder) {
    Namespace namespace = Namespace.getNamespace("rssowl", "http://www.rssowl.org");

    String name = savedSearchElement.getAttributeValue("name");
    boolean matchAllConditions = Boolean.parseBoolean(savedSearchElement.getAttributeValue("matchAllConditions"));

    ISearchMark searchmark = Owl.getModelFactory().createSearchMark(null, folder, name);
View Full Code Here

      throw new RuntimeException("Without builder no channel can " +
                                 "be created.");
    }

    Date dateParsed = new Date();
    Namespace defNS = ParserUtils.getDefaultNS(channel);

    if (defNS == null) {
      defNS = Namespace.NO_NAMESPACE;
      LOGGER.info("No default namespace found.");
    }

    // RSS 1.0 Dublin Core Module namespace
    Namespace dcNS = ParserUtils.getNamespace(channel, "dc");

    if (dcNS == null) {
      LOGGER.debug("No namespace for dublin core found");
      dcNS = defNS;
    }
View Full Code Here

      }
    } else if (rootElement.indexOf("rdf") >= 0) {
      return RSS_1_0_Parser.getInstance().parse(cBuilder, root);
    } else if (rootElement.indexOf("feed") >= 0) {
      Attribute versionAttr = root.getAttribute("version");
      Namespace namespace = ParserUtils.getDefaultNS(root);
      if (versionAttr != null) {
          String feedVersion = versionAttr.getValue();
          if (feedVersion.indexOf("0.1") >= 0 || feedVersion.indexOf("0.2") >= 0) {
              LOGGER.info("Channel uses feed root element (Version " + feedVersion + ").");
              LOGGER.warn("This atom version is not really supported yet, assume Atom 0.3 format");
              return Atom_0_3_Parser.getInstance().parse(cBuilder, root);
          } else if (feedVersion.indexOf("0.3") >= 0) {
              LOGGER.info("Channel uses feed root element (Version 0.3).");
              return Atom_0_3_Parser.getInstance().parse(cBuilder, root);
          }
      } else if (namespace != null && namespace.getURI() != null) {
          if ( !namespace.getURI().equals("http://www.w3.org/2005/Atom")) {
              LOGGER.warn("Channel uses unknown namespace in feed root element, assume Atom 1.0 format.");
          } else {
              LOGGER.info("Channel uses feed root element (Atom 1.0 format).");
          }
          return Atom_1_0_Parser.getInstance().parse(cBuilder, root);
View Full Code Here

          + "be created.");
    }
    Date dateParsed = new Date();
    logger.debug("start parsing.");

    Namespace defNS = ParserUtils.getDefaultNS(root);
    if (defNS == null) {
      defNS = Namespace.NO_NAMESPACE;
      logger.info("No default namespace found.");
    }
    Namespace dcNS = ParserUtils.getNamespace(root, "dc");
    // fall back to default name space
    if (dcNS == null) {
      dcNS = defNS;
    }

    // Content namespace
    Namespace contentNS = ParserUtils.getNamespace(root, "content");

    ParserUtils.matchCaseOfChildren(root, "channel");

    // Get the channel element (only one occurs)
    Element channel = root.getChild("channel", defNS);
View Full Code Here

      throw new RuntimeException("Without builder no channel can "
          + "be created.");
    }

    Date dateParsed = new Date();
    Namespace defNS = ParserUtils.getDefaultNS(channel);

    if (defNS == null) {
      defNS = Namespace.NO_NAMESPACE;
      LOGGER.info("No default namespace found.");
    } else if ((defNS.getURI() == null) ||
               !defNS.getURI().equals("http://www.w3.org/2005/Atom")) {
      LOGGER.warn("Namespace is not really supported, still trying assuming Atom 1.0 format");
    }

    LOGGER.debug("start parsing.");
View Full Code Here

    if (cBuilder == null) {
      throw new RuntimeException("Without builder no channel can "
          + "be created.");
    }
    Date dateParsed = new Date();
    Namespace defNS = ParserUtils.getDefaultNS(root);
    if (defNS == null) {
      defNS = Namespace.NO_NAMESPACE;
      logger.info("No default namespace found.");
    }

    // RSS 1.0 Dublin Core Module namespace
    Namespace dcNS = ParserUtils.getNamespace(root, "dc");
    // fall back to default name space (for retrieving descriptions)
    if (dcNS == null) {
      dcNS = defNS;
    }

    // RSS 1.0 Syndication Module namespace
    Namespace syNS = ParserUtils.getNamespace(root, "sy");

    // RSS 1.0 Aggregation Module namespace
    Namespace agNS = ParserUtils.getNamespace(root, "ag");

    // RSS 1.0 Administration Module namespace
    Namespace adminNS = ParserUtils.getNamespace(root, "admin");

    // RSS 1.0 DCTerms Module namespace
    Namespace dctermsNS = ParserUtils.getNamespace(root, "dcterms");

    // RSS 1.0 Annotation Module namespace
    Namespace annotateNS = ParserUtils.getNamespace(root, "annotate");

    // RSS091 Module namespace
    Namespace rss091NS = ParserUtils.getNamespace(root, "rss091");

    // Content namespace
    Namespace contentNS = ParserUtils.getNamespace(root, "content");

    ParserUtils.matchCaseOfChildren(root, new String[] { "channel", "item",
        "image", "textinput" });

    // Get the channel element (only one occurs)
View Full Code Here

TOP

Related Classes of org.jdom.Namespace

Copyright © 2018 www.massapicom. 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.