Package nu.xom

Examples of nu.xom.Builder


          System.out.println("Usage: java nu.xom.samples.RDDLToTable URL");
          return;
        }
       
        try {
            Builder parser = new Builder(new RDDLToTable());
            Document doc = parser.build(args[0]);
            Serializer out = new Serializer(System.out);
            out.write(doc);
        }
        catch (ParsingException ex) {
          System.out.println(args[0] + " is not well-formed.");
View Full Code Here


            );
            return;
        }
     
        StreamingXHTMLPurifier factory = new StreamingXHTMLPurifier();
        Builder builder = new Builder(factory);
    
        try {
            Document doc = builder.build(args[0]);
            Serializer serializer = new Serializer(System.out);
            serializer.write(doc);
        }
        // indicates a well-formedness error
        catch (ParsingException ex) {
View Full Code Here

          return;
        }
        String url = args[0];
       
        try {
            Builder builder = new Builder(new StreamingExampleExtractor());
            // Read the document
            builder.build(args[0]);   
        }
        catch (ParsingException ex) {
            System.out.println(ex);
        }
        catch (IOException ex) {
View Full Code Here

 
    // Load a parser, transformer, and implementation
    public void init() throws ServletException
 
        try {
          this.parser = new Builder();
        }
        catch (Exception ex) {
          throw new ServletException(
           "Could not locate a XOM parser", ex);
        }
View Full Code Here

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

    }

    public static void main(String[] args) {

        try {
            Builder builder = new Builder();
            for (int i = 0; i < args.length; i++) {
                Document doc = builder.build(args[i]);
                display(doc);
            }
        }
        catch (Exception ex) {
            System.err.println(ex);
View Full Code Here

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

            );
            return;  
        }
       
        try {
            Builder builder = new Builder(new NamingNodeFactory());
            builder.build(args[0]);
        }
        catch (IOException ex) {
            System.err.println("Could not read " + args[0]
              + " due to " + ex.getMessage());
        }      
View Full Code Here

    }
   
    File file = new File(args[0]);
   
    try {
      Builder parser = new Builder();
     
      // Read the document
      Document document = parser.build(file);
     
      // Modify the document
      ROT13XML.encode(document);

      // Write it out again
View Full Code Here

        "Usage: java nu.xom.samples.StreamingNodeLister URL"
      );
      return;
    }
     
    Builder builder = new Builder(new StreamingNodeLister());
    
    try {
      builder.build(args[0]);     
    }
    // indicates a well-formedness error
    catch (ParsingException ex) {
      System.out.println(args[0] + " is not well-formed.");
      System.out.println(ex.getMessage());
View Full Code Here

TOP

Related Classes of nu.xom.Builder

Copyright © 2018 www.massapicom. 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.