/** * Creates a new instance of ValidatingUnmarshaller. */ public static ValidatingUnmarshaller create( Grammar grammar, SAXUnmarshallerHandler _core, Locator locator ) { // create a VerifierFilter and configure it // so that error messages will be sent to the core, Verifier v = new Verifier( new REDocumentDeclaration(grammar), new ErrorHandlerAdaptor(_core,locator) ); v.setPanicMode( true ); return new ValidatingUnmarshaller( new VerifierFilter( v ), _core ); }
filter = new VerifierFilter( new REDocumentDeclaration(grammar), new com.sun.msv.driver.textui.ReportErrorHandler() ); filter.setParent(factory.newSAXParser().getXMLReader()); filter.setContentHandler(this); filter.parse( args[2] );
public void startElement( String namespaceUri, String localName, String qName, Attributes atts ) { printIndent(); indent++; System.out.print("<"+qName+"> :"); Object o = filter.getVerifier().getCurrentElementType(); if( o instanceof ElementRule ) { // for RELAX ElementRule er = (ElementRule)o; if( er.getParent()==null ) System.out.println("##inline"); else System.out.println(er.getParent().name); return; } if( o instanceof TypedElementPattern ) { // for typed TREX System.out.println( ((TypedElementPattern)o).label ); return; } if( o instanceof ElementPattern ) { System.out.println( ExpressionPrinter.printContentModel( ((ElementPattern)o).contentModel ) ); return; } System.out.println("???"); }
public void endElement( String namespaceUri, String localName, String qName ) { Datatype[] types = filter.getVerifier().getLastCharacterType(); if( types!=null ) { String r=""; for( int i=0; i<types.length; i++ ) { if( types[i] instanceof XSDatatype ) r+=((XSDatatype)types[i]).displayName()+" "; else r+=types[i]+" "; } printIndent(); System.out.println("-- "+r+" --"); } indent--; printIndent(); System.out.println("</"+qName+">"); }
/** * Creates a new instance of ValidatingUnmarshaller. */ public static ValidatingUnmarshaller create( Grammar grammar, SAXUnmarshallerHandler _core, Locator locator ) { // create a VerifierFilter and configure it // so that error messages will be sent to the core, Verifier v = new Verifier( new REDocumentDeclaration(grammar), new ErrorHandlerAdaptor(_core,locator) ); v.setPanicMode( true ); return new ValidatingUnmarshaller( new VerifierFilter( v ), _core ); }
/** * Creates a new instance of ValidatingUnmarshaller. */ public static ValidatingUnmarshaller create( Grammar grammar, SAXUnmarshallerHandler _core, Locator locator ) { // create a VerifierFilter and configure it // so that error messages will be sent to the core, Verifier v = new Verifier( new REDocumentDeclaration(grammar), new ErrorHandlerToEventHandler(_core,locator) ); v.setPanicMode( true ); return new ValidatingUnmarshaller( new VerifierFilter( v ), _core ); }
/** * Creates a new instance of ValidatingUnmarshaller. */ public static ValidatingUnmarshaller create( Grammar grammar, SAXUnmarshallerHandler _core, Locator locator ) { // create a VerifierFilter and configure it // so that error messages will be sent to the core, Verifier v = new Verifier( new REDocumentDeclaration(grammar), new ErrorHandlerAdaptor(_core,locator) ); v.setPanicMode( true ); return new ValidatingUnmarshaller( new VerifierFilter( v ), _core ); }
/** * Creates a new instance of ValidatingUnmarshaller. */ public static ValidatingUnmarshaller create( Grammar grammar, SAXUnmarshallerHandler _core, Locator locator ) { // create a VerifierFilter and configure it // so that error messages will be sent to the core, Verifier v = new Verifier( new REDocumentDeclaration(grammar), new ErrorHandlerAdaptor(_core,locator) ); v.setPanicMode( true ); return new ValidatingUnmarshaller( new VerifierFilter( v ), _core ); }