2006/unicorn/org/w3c/unicorn/tests XMLBeansTest.java,1.2,1.3

Update of /sources/public/2006/unicorn/org/w3c/unicorn/tests
In directory hutz:/tmp/cvs-serv25604/org/w3c/unicorn/tests

Added Files:
	XMLBeansTest.java 
Log Message:
Test Class for XMLBeans under Unicorn

--- NEW FILE: XMLBeansTest.java ---
// $Id: XMLBeansTest.java,v 1.3 2008/07/10 14:53:46 fbatard Exp $
// Author: Jean-Guilhem Rouel
// (c) COPYRIGHT MIT, ERCIM and Keio, 2006.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.unicorn.tests;

import java.io.IOException;
import java.net.URL;

import org.apache.xmlbeans.XmlException;
import org.w3.unicorn.observationresponse.ObservationresponseDocument;


/**
 * XmlBeansTest<br />
 * Created: Jun 26, 2006 12:05:50 PM<br />
 * @author Batard Florent
 */
public class XMLBeansTest {

	public static void main(String[] args) throws XmlException, IOException {
		
		URL url = new URL("http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fshenril.free.fr%2Fmain.css&profile=css21&usermedium=all&warning=1&lang=fr&output=ucn");
		
		
//		 Bind the instance to the generated XMLBeans types.
		ObservationresponseDocument ObsDoc=null;
		try {
			ObsDoc = ObservationresponseDocument.Factory.parse(url.openStream());
		} catch (XmlException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 

		ObservationresponseDocument.Observationresponse obs=ObsDoc.getObservationresponse();
//		 Get and print pieces of the XML instance.
		
			System.out.println(obs.getPassed()); 
	}
	
}

Received on Thursday, 10 July 2008 14:54:22 UTC