Package org.jdom.xpath

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


         
          String bundleName;
          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.encodeForURL(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
View Full Code Here


          String bundleName;
          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.encodeForURL(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
          }
View Full Code Here

          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.encodeForURL(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
          }
         
View Full Code Here

    private ArrayList<SRUResult> parseDom(Document dom) {
      ArrayList<SRUResult> results = new ArrayList<SRUResult>();
     
      try {
        XPath x = XPath.newInstance("/zs:searchRetrieveResponse//zs:records//zs:record//zs:recordData//srw_dc:dc");
        x.addNamespace(Namespace.getNamespace("srw_dc", "info:srw/schema/1/dc-schema"));
        Namespace dc = Namespace.getNamespace("http://purl.org/dc/elements/1.1/");
        
        for (Object element : x.selectNodes(dom)) {
          SRUResult aResult = new SRUResult();
         
View Full Code Here

    }

  private void testSegment(final String segmentCode, Document doc, boolean useShortName) throws IOException, SAXException, JDOMException {
        String expected = new String(StreamUtils.readStream(getClass().getResourceAsStream("d08a/segment/expected-" + (useShortName ? "shortname-" : "") + segmentCode.toLowerCase() + ".xml"))).trim();
        XPath lookup = XPath.newInstance("//medi:segment[@segcode='" + segmentCode + "']");
        lookup.addNamespace("medi", "http://www.milyn.org/schema/edi-message-mapping-1.5.xsd");
        Element node = (Element) lookup.selectSingleNode(doc);
        assertNotNull("Node with segment code " + segmentCode + " wasn't found", node);

//        System.out.println(out.outputString(node));
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.