Package org.jdom

Examples of org.jdom.Namespace


      // rewrite DOM as a string to find differences, since text outside the root element is not tracked

      Element rootElement = document.getRootElement();
      if (is12()) {
        rootElement.setNamespace(Namespace.getNamespace("http://java.sun.com/xml/ns/javaee"));
        Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));
        rootElement.setAttribute(new Attribute("schemaLocation",
            "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd", xsi));
        rootElement.setAttribute("version", "1.2");
      } else if (is20()) {
        rootElement.setNamespace(Namespace.getNamespace("http://java.sun.com/xml/ns/javaee"));
        Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));
        rootElement.setAttribute(new Attribute("schemaLocation",
            "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd", xsi));
        rootElement.setAttribute("version", "2.0");
      }
      Namespace namespace = rootElement.getNamespace();
      if (is12()||is20()) {
        applyNamespace(rootElement, namespace);
      }
      List<Element> components = rootElement.getChildren(COMPONENT, namespace);
View Full Code Here


    }
    return 0;
  }

  public boolean equals(Element element1, Element element2) {
    Namespace namespace = element1.getNamespace();
    if (element1.getName().equals(element2.getName()) && element1.getNamespace().equals(element2.getNamespace())) {
      if (element1.getChildText(COMPONENT_CLASS, namespace).equals(element2.getChildText(COMPONENT_CLASS, namespace))) {
        if (element1.getChildText(COMPONENT_TYPE, namespace).equals(element2.getChildText(COMPONENT_TYPE, namespace))) {
          return true;
        }
View Full Code Here

        {
            Document document = builder.build( new StringReader( effectiveXml ) );
            Element rootElement = document.getRootElement();

            // added namespaces
            Namespace pomNamespace = Namespace.getNamespace( "", "http://maven.apache.org/POM/4.0.0" );
            rootElement.setNamespace( pomNamespace );

            Namespace xsiNamespace = Namespace.getNamespace( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
            rootElement.addNamespaceDeclaration( xsiNamespace );
            if ( rootElement.getAttribute( "schemaLocation", xsiNamespace ) == null )
            {
                rootElement.setAttribute( "schemaLocation", "http://maven.apache.org/POM/4.0.0 "
                    + ( isPom ? POM_XSD_URL : SETTINGS_XSD_URL ), xsiNamespace );
View Full Code Here

      // rewrite DOM as a string to find differences, since text outside the root element is not tracked

      org.jdom.Element rootElement = document.getRootElement();
      if (is12()) {
        rootElement.setNamespace(Namespace.getNamespace("http://java.sun.com/xml/ns/javaee"));
        Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));
        rootElement.setAttribute(new Attribute("schemaLocation",
            "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd", xsi));
        rootElement.setAttribute("version", "1.2");
      } else if (is20()) {
        rootElement.setNamespace(Namespace.getNamespace("http://java.sun.com/xml/ns/javaee"));
        Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));
        rootElement.setAttribute(new Attribute("schemaLocation",
            "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd", xsi));
        rootElement.setAttribute("version", "2.0");
      }
      Namespace namespace = rootElement.getNamespace();
      if (is12() || is20()) {
        applyNamespace(rootElement, namespace);
      }
      List<org.jdom.Element> components = rootElement.getChildren(COMPONENT, namespace);
View Full Code Here

    }
    return 0;
  }

  public boolean equals(org.jdom.Element element1, org.jdom.Element element2) {
    Namespace namespace = element1.getNamespace();
    if (element1.getName().equals(element2.getName()) && element1.getNamespace().equals(element2.getNamespace())) {
      if (element1.getChildText(COMPONENT_CLASS, namespace).equals(element2.getChildText(COMPONENT_CLASS, namespace))) {
        if (element1.getChildText(COMPONENT_TYPE, namespace).equals(element2.getChildText(COMPONENT_TYPE, namespace))) {
          return true;
        }
View Full Code Here

        new ActionStartXCommand(action.getId(), "map-reduce").call();
        action = jpaService.execute(wfActionGetCmd);
        assertNotNull(action.getExternalId());

        Element actionXml = XmlUtils.parseXml(action.getConf());
        Namespace ns = actionXml.getNamespace();
        Element configElem = actionXml.getChild("configuration", ns);
        String strConf = XmlUtils.prettyPrint(configElem).toString();
        XConfiguration inlineConf = new XConfiguration(new StringReader(strConf));
        String workDir = inlineConf.get("work.dir", null);
        assertNotNull(workDir);
View Full Code Here

    Element processElm = new Element("process");
    Document doc = new Document(processElm);

    processElm.setAttribute("processID", String.valueOf(process.getId()));

    Namespace xmlns = Namespace.getNamespace("http://www.goobi.org/logfile");
    processElm.setNamespace(xmlns);
    // namespace declaration
    if (addNamespace) {

      Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
      processElm.addNamespaceDeclaration(xsi);
      Attribute attSchema = new Attribute("schemaLocation", "http://www.goobi.org/logfile" + " XML-logfile.xsd", xsi);
      processElm.setAttribute(attSchema);
    }
    // process information
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Element> getMetsValues(String expr, Object element, HashMap<String, Namespace> namespaces) throws JaxenException {
      JDOMXPath xpath = new JDOMXPath(expr.trim().replace("\n", ""));
      // Add all namespaces
      for (String key : namespaces.keySet()) {
        Namespace value = namespaces.get(key);
        xpath.addNamespace(key, value.getURI());
      }
      return xpath.selectNodes(element);
  }
View Full Code Here

  public void startExport(List<Prozess> processList, OutputStream outputStream, String xslt) {
    Document answer = new Document();
    Element root = new Element("processes");
    answer.setRootElement(root);
    Namespace xmlns = Namespace.getNamespace("http://www.goobi.org/logfile");

    Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    root.addNamespaceDeclaration(xsi);
    root.setNamespace(xmlns);
    Attribute attSchema = new Attribute("schemaLocation", "http://www.goobi.org/logfile" + " XML-logfile.xsd", xsi);
    root.setAttribute(attSchema);
    for (Prozess p : processList) {
View Full Code Here

        feed.setFeedType(FEED_TYPE);
        WireFeedOutput wireFeedOutput = new WireFeedOutput();
        Document feedDoc = wireFeedOutput.outputJDom(feed);
        feedDoc.getRootElement().addContent(fetchedEntryElement);
       
        Namespace ns = Namespace.getNamespace(
            "http://roller.apache.org/namespaces/app");
        Element rollerElement = fetchedEntryElement.getChild("atom-draft", ns);
        if (rollerElement == null) {
            log.debug("Client is NOT preserving foreign markup");
        }
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.