1 package com.freemindcafe.xml.xsd.sample4;
4 import java.io.InputStream;
5 import java.io.StringWriter;
6 import java.util.ArrayList;
8 import junit.framework.Assert;
20 public void read_xml_and_validate_against_the_schema_succeeds()
throws Exception{
21 InputStream stream = this.getClass().getResourceAsStream(
"/com/freemindcafe/xml/xsd/sample4/po.xml");
23 XmlOptions options =
new XmlOptions();
24 ArrayList<Object> validationErrors=
new ArrayList<Object>();
25 options.setErrorListener(validationErrors);
26 if (!document.validate(options)) {
27 StringWriter sW=
new StringWriter();
28 for (Object o : validationErrors) {
31 System.out.println(sW.toString());
33 Assert.assertTrue(document.validate());
org.apache.xmlbeans.XmlObject getElement()
com.freemindcafe.purchase3.PurchaseOrderType getPurchaseOrder()
org.apache.xmlbeans.XmlObject getComment1()