VolantisXMLReaderFactory readerFactory = new VolantisXMLReaderFactory();
readerFactory.disableValidation();
XMLReader reader = readerFactory.create();
XMLFilter filter;
filter = createFilter();
if (filter != null) {
filter.setParent(reader);
reader = filter;
}
filter = new XMLFilterImpl() {
public void startElement(
String uri, String localName, String qName, Attributes atts)
throws SAXException {
System.out.println("<" + qName + ">");
super.startElement(uri, localName, qName, atts);
}
public void endElement(String uri, String localName, String qName)
throws SAXException {
System.out.println("</" + qName + ">");
super.endElement(uri, localName, qName);
}
};
filter.setParent(reader);
reader = filter;
reader.setContentHandler(new ValidatingHandler(validator,
getSchemaNamespaces()));