Package org.jaxen.jdom

Examples of org.jaxen.jdom.JDOMXPath.addNamespace()


    Document doc = builder.build(fis);
    Element root = doc.getRootElement();
    // XXX this is expensive for very large documents. In those cases another
    // XXX method (direct processing of SAX events, or XMLPull) should be used.
    XPath path = new JDOMXPath("//text:span | //text:p | //text:tab | //text:tab-stop | //text:a");
    path.addNamespace("text", root.getNamespace("text").getURI());
    Namespace xlink = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink");
    List list = path.selectNodes(doc);
    boolean lastp = true;
    for (int i = 0; i < list.size(); i++) {
      Element el = (Element)list.get(i);
View Full Code Here


    };
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(fis);
    XPath path = new JDOMXPath("/office:document-meta/office:meta/*");
    Element root = doc.getRootElement();
    path.addNamespace("office", root.getNamespace("office").getURI());
    List list = path.selectNodes(doc);
    for (int i = 0; i < list.size(); i++) {
      Element n = (Element)list.get(i);
      String text = n.getText();
      if (text.trim().equals("")) continue;
View Full Code Here

  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

    Document doc = builder.build(fis);
    Element root = doc.getRootElement();
    // XXX this is expensive for very large documents. In those cases another
    // XXX method (direct processing of SAX events, or XMLPull) should be used.
    XPath path = new JDOMXPath("//text:span | //text:p | //text:tab | //text:tab-stop | //text:a");
    path.addNamespace("text", root.getNamespace("text").getURI());
    Namespace xlink = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink");
    List list = path.selectNodes(doc);
    boolean lastp = true;
    for (int i = 0; i < list.size(); i++) {
      Element el = (Element)list.get(i);
View Full Code Here

    };
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(fis);
    XPath path = new JDOMXPath("/office:document-meta/office:meta/*");
    Element root = doc.getRootElement();
    path.addNamespace("office", root.getNamespace("office").getURI());
    List list = path.selectNodes(doc);
    for (int i = 0; i < list.size(); i++) {
      Element n = (Element)list.get(i);
      String text = n.getText();
      if (text.trim().equals("")) continue;
View Full Code Here

        for (int j = 0; j < nsNodeList.getLength(); j++) {
      org.w3c.dom.Element ns
          = (org.w3c.dom.Element)nsNodeList.item(j);
      String prefix = ns.getAttribute("Prefix");
      String uri = ns.getAttribute("Uri");
      xpath.addNamespace(prefix, uri);
        }
    }
    returnParamInfo.put(name, xpath);
      }
  } catch (Exception e) {
View Full Code Here

        // Namespace
        Namespace namespace = Namespace.getNamespace (XPDLUtil.XPDL_NS);
        // cut out the WorkflowProcess nodes
        XPath path = new JDOMXPath
            ("/xpdl:Package/xpdl:WorkflowProcesses/xpdl:WorkflowProcess");
        path.addNamespace("xpdl", XPDLUtil.XPDL_NS);
        Iterator processListIterator = path.selectNodes(doc).iterator();
        while (processListIterator.hasNext()) {
            Element child = (Element)processListIterator.next();
            processes.add(child);
        }
View Full Code Here

    }

    private XPath buildJDOMXPath(String pathString) throws JDOMException,
                 JaxenException {
  XPath path = new JDOMXPath (pathString);
  path.addNamespace("xpdl", XPDLUtil.XPDL_NS);
        path.addNamespace("vx", XPDLUtil.XPDL_EXTN_NS);
        path.addNamespace("vx1", XPDLUtil.XPDL_EXTN_V1_1_NS);
  return path;
    }
View Full Code Here

    private XPath buildJDOMXPath(String pathString) throws JDOMException,
                 JaxenException {
  XPath path = new JDOMXPath (pathString);
  path.addNamespace("xpdl", XPDLUtil.XPDL_NS);
        path.addNamespace("vx", XPDLUtil.XPDL_EXTN_NS);
        path.addNamespace("vx1", XPDLUtil.XPDL_EXTN_V1_1_NS);
  return path;
    }

    private void validateHeaderDefinition
View Full Code Here

    private XPath buildJDOMXPath(String pathString) throws JDOMException,
                 JaxenException {
  XPath path = new JDOMXPath (pathString);
  path.addNamespace("xpdl", XPDLUtil.XPDL_NS);
        path.addNamespace("vx", XPDLUtil.XPDL_EXTN_NS);
        path.addNamespace("vx1", XPDLUtil.XPDL_EXTN_V1_1_NS);
  return path;
    }

    private void validateHeaderDefinition
  (Document doc, CollectingErrorHandler eh)
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.