Package nu.xom

Examples of nu.xom.Document.toXML()


     * string) from the internal <code>Document</code>
     * @return the completed MusicXML file as a String
     */
    public String getMusicXMLString()
    {  Document xomDoc = getMusicXMLDoc();
      return xomDoc.toXML();
    }
   
    /**
     * creates the internal <code>Document</code> with the top-level
     * <code>Element</code>.
View Full Code Here


        // check correctness
        if (cmd.equals("test")) {
          if (! Arrays.equals(XOMUtil.toCanonicalXML(doc), XOMUtil.toCanonicalXML(doc2))) {
            System.err.println("Canonical XML Mismatch: ");
            System.err.println("expected: " + doc.toXML());
            System.err.println("actual: " + doc2.toXML());                 
            printDiff(doc, doc2);
            System.exit(0);
          }
          if (!equalsDocTypeEquals(doc.getDocType(), doc2.getDocType())) { 
            System.err.println("DocType Mismatch: ");
View Full Code Here

            System.exit(0);
          }
          if (!equalsDocTypeEquals(doc.getDocType(), doc2.getDocType())) { 
            System.err.println("DocType Mismatch: ");
            System.err.println("expected: " + doc.toXML());
            System.err.println("actual: " + doc2.toXML());
            System.exit(0);
          }
        }
      }   
    }   
View Full Code Here

  //                  System.exit(0);
  //                }
                  if (!equalsDocTypeEquals(doc.getDocType(), doc2.getDocType())) { 
                    System.err.println("DocType Mismatch: ");
                    System.err.println("expected: " + doc.toXML());
                    System.err.println("actual: " + doc2.toXML());
                    System.exit(0);
                  }
                }
              } catch (RuntimeException e) {
                System.err.println("FATAL ERROR: " + e);
View Full Code Here

public class JsonXmlConverterTest {
    public void shouldConvertToXml() {
        JsonObject object = sampleJson();
        Element element = JsonXmlConverter.getElement(object, "r");
        Document document = new Document(element);
        String xml = document.toXML();
        Assert.assertTrue(xml.contains("<r>"), "should contain the opening tag <r>");
    }

    public void shouldGetW3cDomTree() {
        JsonObject sampleJson = sampleJson();
View Full Code Here

       
        System.out.println("Ready to bench");
        Thread.sleep(5000);
       
        long pre = System.currentTimeMillis();
        doc.toXML();
        long post = System.currentTimeMillis();
        System.out.println((post - pre)/1000.0
          + "s to get XML for entire Document");
       
    }
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

        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

        System.out.println((post - pre)/1000.0 + "s to get value of entire Document");

        System.gc(); System.gc(); System.gc();
       
        pre = System.currentTimeMillis();
        doc.toXML();
        post = System.currentTimeMillis();
        System.out.println((post - pre)/1000.0 + "s to get XML for entire Document");
                 
    }
View Full Code Here

       
        try {
          XMLReader crimson = XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
          Builder parser = new Builder(crimson);
          Document doc = parser.build(args[0]);
          System.out.println(doc.toXML());
        }
        catch (ParsingException ex) {
          ex.printStackTrace();
          System.out.println(args[0] + " is not well-formed.");
          System.out.println(ex.getMessage());
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.