Package org.dom4j

Examples of org.dom4j.Document.selectSingleNode()


        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      String serchstr = "//String[@id='" + localeid
          + "']/locales/locale[@code='" + locale.toString() + "']";
      Element e = (Element) document.selectSingleNode(serchstr);
      List list = e.elements();
      if (list.size() <= i)
      {
        return;
      }
View Full Code Here


            SAXReader xmlReader = new SAXReader();
            Document doc = xmlReader.read(file);
           
            System.out.println(doc.asXML());

            Node oiDbNode = doc.selectSingleNode("//oiDb");
            oldFolder.oiDb = oiDbNode.getText();
           
            Node oiGroupNode = doc.selectSingleNode("//oiGroup");
            oldFolder.oiGroup = oiGroupNode.getText();
           
View Full Code Here

            System.out.println(doc.asXML());

            Node oiDbNode = doc.selectSingleNode("//oiDb");
            oldFolder.oiDb = oiDbNode.getText();
           
            Node oiGroupNode = doc.selectSingleNode("//oiGroup");
            oldFolder.oiGroup = oiGroupNode.getText();
           
            Node oiSeriesNode = doc.selectSingleNode("//oiSeries");
           
            //FIXME Path for empty oiSeries
View Full Code Here

            oldFolder.oiDb = oiDbNode.getText();
           
            Node oiGroupNode = doc.selectSingleNode("//oiGroup");
            oldFolder.oiGroup = oiGroupNode.getText();
           
            Node oiSeriesNode = doc.selectSingleNode("//oiSeries");
           
            //FIXME Path for empty oiSeries
            if (oiSeriesNode == null) {
                oldFolder.oiSeries = file.getParentFile().getParentFile().getName();
            } else {
View Full Code Here

            SAXReader xmlReader = new SAXReader();
            Document doc = xmlReader.read(metadataFile);

            thesisMetadata.identifier = FilenameUtils.getBaseName(metadataFile.getName());
           
            Node classificationNode = doc.selectSingleNode("//classification");
            if (classificationNode == null) {
                thesisMetadata.classification = "?";
            } else {
                thesisMetadata.classification = classificationNode.getText();
                if (thesisMetadata.classification.trim().equals("")) {
View Full Code Here

                if (thesisMetadata.classification.trim().equals("")) {
                    thesisMetadata.classification = "?";
                }
            }
           
            Node levelNode = doc.selectSingleNode("//etdms:degree/etdms:level");
            thesisMetadata.level = levelNode.getText();
           
            Node dateNode = doc.selectSingleNode("//etdms:date");
            thesisMetadata.year = dateNode.getText().split("-")[0];
           
View Full Code Here

            }
           
            Node levelNode = doc.selectSingleNode("//etdms:degree/etdms:level");
            thesisMetadata.level = levelNode.getText();
           
            Node dateNode = doc.selectSingleNode("//etdms:date");
            thesisMetadata.year = dateNode.getText().split("-")[0];
           
            thesisMetadata.etdmsMetadata = createMetadataFromDocument(doc);
           
        } catch (Exception e) {
View Full Code Here

          // First we check whether it is an XML file
        SAXReader reader  = new SAXReader();
            Document  testDoc = reader.read(new InputSource(new FileReader(inputFile)));

          // Then we check whether it is one that we're interested in
            if (testDoc.selectSingleNode("/testsuite") == null)
            {
              return;
            }

            // Ok, it is, so lets extract the data that we want:
View Full Code Here

            generalElement.addAttribute("errors", String.valueOf(totalNumErrors));
            generalElement.addAttribute("failures", String.valueOf(totalNumErrors));

            if ((numErrors > 0) || (numFailures > 0))
            {
                Element testSuiteNode = (Element)testDoc.selectSingleNode("/testsuite");
                String  testSuiteName = testSuiteNode.attributeValue("name");

                // since tests have failed, we add it to the summary
                for (Iterator it = testSuiteNode.selectNodes("testcase[failure or error]").iterator(); it.hasNext();)
                {
View Full Code Here

            for (int idx = debugDocuments.size() - 1; idx > -1; idx--) {
                debugDoc = (Document) debugDocuments.get(idx);
                out.write("<tr>");
                out.write("<td>" + String.valueOf(idx) + "</td>");
                out.write("<td><a target=\"blank\" href=\"" + getContextPath() + "/tmlDebug?command=showModules&index=" + idx + "\">" + debugDoc.selectSingleNode("/tmldebugdocument/@url").getText()
                        + "</a></td>");
                out.write("<td>" + debugDoc.selectSingleNode("/tmldebugdocument/@started").getText() + "");
                out.write("<td>");
                Attribute endedElement = (Attribute) debugDoc.selectSingleNode("/tmldebugdocument/@ended");
                if (endedElement != null) {
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.