protected XMLValidationSchema loadSchema(InputSource src, Object sysRef) throws XMLStreamException { /* 26-Oct-2007, TSa: Are SAX parser factories safe to share? * If not, should just create new instances for each * parsed schema. */ SAXParserFactory saxFactory = getSaxFactory(); MyGrammarController ctrl = new MyGrammarController(); XMLSchemaGrammar grammar = XMLSchemaReader.parse(src, saxFactory, ctrl); if (grammar == null) { String msg = "Failed to load W3C Schema from '"+sysRef+"'"; String emsg = ctrl.mErrorMsg; if (emsg != null) { msg = msg + ": "+emsg; } throw new XMLStreamException(msg); } return new W3CSchema(grammar); } }
protected void startSelf() { final XMLSchemaReader reader = (XMLSchemaReader)this.reader; super.startSelf(); try {// parse included grammar first. reader.switchSource( this, new RootIncludedSchemaState( reader.sfactory.schemaIncluded(this,reader.currentSchema.targetNamespace) ) ); } catch( AbortException e ) { // recover by ignoring the error } // disable duplicate definition check. prevDuplicateCheck = reader.doDuplicateDefinitionCheck; }
/** * Parse a schema supplied by a javax.xml.transform Source. * @param source */ public void parse(Source source) { reader.switchSource(source, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }
protected void startSelf() { final XMLSchemaReader reader = (XMLSchemaReader)this.reader; super.startSelf(); try { reader.switchSource( this, new RootIncludedSchemaState( reader.sfactory.schemaIncluded(this,reader.currentSchema.targetNamespace) ) ); } catch( AbortException e ) { // recover by ignoring the error } } }
protected void startSelf() { final XMLSchemaReader reader = (XMLSchemaReader)this.reader; super.startSelf(); try {// parse included grammar first. reader.switchSource( this, new RootIncludedSchemaState( reader.sfactory.schemaIncluded(this,reader.currentSchema.targetNamespace) ) ); } catch( AbortException e ) { // recover by ignoring the error } // disable duplicate definition check. prevDuplicateCheck = reader.doDuplicateDefinitionCheck; }
/** * Parse a schema supplied by a javax.xml.transform Source. * @param source */ public void parse(Source source) { reader.switchSource(source, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }
protected void startSelf() { final XMLSchemaReader reader = (XMLSchemaReader)this.reader; super.startSelf(); try {// parse included grammar first. reader.switchSource( this, new RootIncludedSchemaState( reader.sfactory.schemaIncluded(this,reader.currentSchema.targetNamespace) ) ); } catch( AbortException e ) { // recover by ignoring the error } // disable duplicate definition check. prevDuplicateCheck = reader.doDuplicateDefinitionCheck; }
/** * Parses an additional schema. * * The caller can call this method many times to parse * multiple schemas. * * If possible, the caller should set the system Id to the InputSource. */ public void parse( InputSource is ) { reader.switchSource( is, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }
protected void startSelf() { final XMLSchemaReader reader = (XMLSchemaReader)this.reader; super.startSelf(); try {// parse included grammar first. reader.switchSource( this, new RootIncludedSchemaState( reader.sfactory.schemaIncluded(this,reader.currentSchema.targetNamespace) ) ); } catch( AbortException e ) { // recover by ignoring the error } // disable duplicate definition check. prevDuplicateCheck = reader.doDuplicateDefinitionCheck; }
/** * Parses an additional schema. * * The caller can call this method many times to parse * multiple schemas. * * If possible, the caller should set the system Id to the InputSource. */ public void parse( InputSource is ) { reader.switchSource( is, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }
/** * Parses an additional schema. * * The caller can call this method many times to parse * multiple schemas. * * If possible, the caller should set the system Id to the InputSource. */ public void parse( InputSource is ) { reader.switchSource( is, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }
/** * Parses an additional schema. * * The caller can call this method many times to parse * multiple schemas. * * If possible, the caller should set the system Id to the InputSource. */ public void parse( InputSource is ) { reader.switchSource( is, new RootIncludedSchemaState( reader.sfactory.schemaHead(null)) ); }