Package nu.xom

Examples of nu.xom.Builder.build()


    }
     
    Builder builder = new Builder();
    
    try {
      Document doc = builder.build(args[0]);
      Element root = doc.getRootElement();
      qualify(root);
      System.out.println(doc.toXML());    
    }
    // indicates a well-formedness error
View Full Code Here


          return;
        }
       
        try {
          Builder parser = new Builder(new StreamingCommentReader());
          parser.build(args[0]);
        }
        catch (ParsingException ex) {
          System.out.println(args[0] + " is not well-formed.");
          System.out.println(ex.getMessage());
        }
View Full Code Here

      return;
    }
   
    try {
      Builder parser = new Builder();
      parser.build(args[0]);
      System.out.println(args[0] + " is well-formed.");
    }
    catch (ParsingException ex) {
      System.out.println(args[0] + " is not well-formed.");
      System.out.println(ex.getMessage());
View Full Code Here

          return;
        }
       
        try {
          Builder parser = new Builder();
          Document doc = parser.build(args[0]);
          System.out.println(doc.toXML());
        }
        catch (ParsingException ex) {
          System.out.println(args[0] + " is not well-formed.");
          System.out.println(ex.getMessage());
View Full Code Here

        try {
            // Find a parser
            Builder parser = new Builder();
     
            // Read the document
            Document document = parser.build(url);
    
            // Modify the document
            Restructurer.processNode(document.getRootElement());
     
            // Write it out again
View Full Code Here

            for (int i = 0; i < result.length; i++) {
                if (result[i] == 0x15) fail("Bad NEL output");       
            }

            InputStream in = new ByteArrayInputStream(result);
            Document reparsed = builder.build(in);
            assertEquals(doc, reparsed);
        }
        catch (UnsupportedEncodingException ex) {
            throw ex;  
       
View Full Code Here

   
   
    public void testFranceschet1() throws ParsingException, IOException {
    
        Builder builder = new Builder();
        Document doc = builder.build(
          "http://staff.science.uva.nl/~francesc/xpathmark/benchmark_canon.xml"
        );
        Element root = doc.getRootElement();
        Elements inputs = root.getChildElements("document");
        Element input = inputs.get(0).getFirstChildElement("site");
View Full Code Here

   

    public void testFranceschet2() throws ParsingException, IOException {
    
        Builder builder = new Builder();
        Document doc = builder.build(
          "http://staff.science.uva.nl/~francesc/xpathmark/benchmark_canon.xml"
        );
        Element root = doc.getRootElement();
        Elements inputs = root.getChildElements("document");
        Element input = inputs.get(1);
View Full Code Here

             + "  <servlet-name>DeviceInfoServlet</servlet-name>\n"
             + "  <url-pattern>/tools/*</url-pattern>\n"
             + "</servlet-mapping>\n</root>";
        
         Builder builder = new Builder();
         Document doc = builder.build(data, null);
        
         Nodes result = doc.query("//*[./../servlet-name = 'DeviceInfoServlet']");
         assertEquals(2, result.size());
      
     }        
View Full Code Here

   
   
    public void testJaxenIntegrationTest() throws ParsingException, IOException {
       
        Builder builder = new Builder();
        Document testDoc = builder.build(
          "http://cvs.jaxen.codehaus.org/viewrep/~raw,r=HEAD/jaxen/jaxen/xml/test/tests.xml");
        Elements documents = testDoc.getRootElement().getChildElements("document");
        for (int i = 0; i < documents.size(); i++) {
            Element documentElement = documents.get(i);
            String url = documentElement.getAttributeValue("url");
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.