Package org.jaxen.jdom

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


    if (nsNodeList != null) {
        for (int j = 0; j < nsNodeList.getLength(); j++) {
      Element ns = (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


    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

            SAXBuilder builder = new SAXBuilder();
            Document d = builder.build( in );          

            Namespace ns = Namespace.getNamespace( "planets", "http://www.planets-project.eu/xml/ns/planets/core/mimetypes" );           
            JDOMXPath xpath = new JDOMXPath("/planets:Document/planets:MIME-mapping");   
            xpath.addNamespace( "planets", "http://www.planets-project.eu/xml/ns/planets/core/mimetypes" );                       
           
            Iterator<?> _mappings = xpath.selectNodes( d ).iterator();
            while ( _mappings.hasNext() ) {           
           
                Element _mapping = (Element)_mappings.next();
View Full Code Here

            SAXBuilder builder = new SAXBuilder();
            Document d = builder.build( in );          

            Namespace ns = Namespace.getNamespace( "planets", "http://www.planets-project.eu/xml/ns/planets/core/mimetypes" );           
            JDOMXPath xpath = new JDOMXPath("/planets:Document/planets:MIME-mapping");   
            xpath.addNamespace( "planets", "http://www.planets-project.eu/xml/ns/planets/core/mimetypes" );                       
           
            Iterator<?> _mappings = xpath.selectNodes( d ).iterator();
            while ( _mappings.hasNext() ) {           
           
                Element _mapping = (Element)_mappings.next();
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.