Package nu.xom

Examples of nu.xom.Document.toXML()


      }
      Document doc = new Document(root);
      DocType doctype
        = new DocType("Fibonacci_Numbers", "fibonacci.dtd");
      doc.insertChild(doctype, 0);
      System.out.println(doc.toXML())

  }

}
View Full Code Here


        BigInteger temp = high;
        high = high.add(low);
        low = temp;
      }
      Document doc = new Document(root);
      System.out.println(doc.toXML())

  }

}
View Full Code Here

        }
       
        try {
          Builder parser = new Builder(new RDDLFilter());
          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

        root.appendChild(child1);
        root.appendChild(child2);
        child2.addAttribute(new Attribute("id", "p1", Attribute.Type.ID));
        Document in = new Document(root);
        Document out = XIncluder.resolve(in);
        String result = out.toXML();
        assertEquals("<?xml version=\"1.0\"?>\n" +
           "<root><child2 id=\"p1\" /><child2 id=\"p1\" /></root>\n", result);
       
    }
   
View Full Code Here

        Reader reader = new StringReader(data);
        Document doc = builder.build(reader);
        Document result = XIncluder.resolve(doc);
        assertEquals("<?xml version=\"1.0\"?>\n"
          + "<document xmlns:xi=\"http://www.w3.org/2001/XInclude\">Correct!</document>\n",
          result.toXML());
       
    }
   
   
    public void testBadAcceptAttribute()
View Full Code Here

    File f = new File(new File(Oscar3Props.getInstance().workspace, "chemnamedict"), "chemnamedict.xml");
    Document doc = new Builder().build(f);
    ChemNameDict ncnd = new ChemNameDict();
    ncnd.readXML(doc);
    doc = ncnd.toXML();
    System.out.println(doc.toXML().length());
    ncnd = new ChemNameDict();
    ncnd.readXML(doc);
    doc = ncnd.toXML();
    System.out.println(doc.toXML().length());
   
View Full Code Here

    doc = ncnd.toXML();
    System.out.println(doc.toXML().length());
    ncnd = new ChemNameDict();
    ncnd.readXML(doc);
    doc = ncnd.toXML();
    System.out.println(doc.toXML().length());
   
    /*NewChemNameDict ncnd = new NewChemNameDict();
    ChemNameDict cnd = ChemNameDictSingleton.getChemNameDictInstance();
    System.out.println("Ready!");
    long time = System.currentTimeMillis();
View Full Code Here

        System.out.println("Memory used after garbage collection: "
          + format.format(usage) + "M");
      
        // Make sure the document isn't prematurely garbage collected
        System.out.println("Meaningless number: "
          + doc.toXML().length());
    }

}
View Full Code Here

       
        String data = "<?xml version=\"1.0\"?>\n"
          + "<!DOCTYPE root [\n  <!ELEMENT test (#PCDATA)>\n]>"
          + "\n<test />\n"
        Document doc = (new Builder()).build(data, null);
        String result = doc.toXML();
        assertEquals(data, result);   
       
   
   
   
View Full Code Here

          + "<!DOCTYPE root [\n" +
                "  <!--comment-->\n  <!ELEMENT test (#PCDATA)>" +
            "\n  <!--comment-->\n]>"
          + "\n<test />\n"
        Document doc = (new Builder()).build(data, null);
        String result = doc.toXML();
        assertEquals(data, result);   
       
   
   
   
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.