   | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | |  | code sample for the XMLOutputter question. | code sample for the XMLOutputter question. 2004-01-16 - By Ing. Terenzio Berni
Back 1) I have configured the SAXBuilder with this instructions:
SAXBuilder saxBuilder = new SAXBuilder(true); saxBuilder.setFeature("http://apache.org/xml/features/validation/schema", true); saxBuilder.setProperty("http://apache.org/xml/properties/schema/external-sch emaLocation","urn:hl7-org:v2xml file:///C:/xsd/messages.xsd");
2) I validate the xml and create a Document this way:
InputStream inputstream = new FileInputStream("C:/test_files/ADT_A01.xml"); Document document = saxBuilder.build(inputstream);
3) and I output the file like this:
XMLOutputter output = new XMLOutputter(" "); output.output(cloneddocument, new FileOutputStream("C:/test_files/ADT_A01_modified.xml"));
but I don't know how to strip out all the datas gathered during the validation from the XSD. I've searched some Xerces properties but I didn't find anything that worked...
Regard, Terenzio
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected) .com
Earn $52 per hosting referral at Lunarpages.
|
|
 |