public void startElement(String s, String s1, String s2, Attributes attributes) throws SAXException { if(namespaceToIgnore.equals(s)) return; IslandSchema islandschema = dispatcher.getSchemaProvider().getSchemaByNamespace(s); if(islandschema == null) { return; } else { IslandVerifier islandverifier = islandschema.createNewVerifier(s, islandschema.getElementDecls()); dispatcher.switchVerifier(islandverifier); islandverifier.startElement(s, s1, s2, attributes); return; } }
/** binds all IslandSchemata. */ public boolean bind( ErrorHandler handler ) { ErrorHandlerFilter filter = new ErrorHandlerFilter(handler); try { Iterator itr = schemata.values().iterator(); while( itr.hasNext() ) ((IslandSchema)itr.next()).bind( this, filter ); } catch( SAXException e ) { // bind method may throw SAXException. return false; } return !filter.hadError; }
/** * creates a choice expression of all exported rules in the given provider. * * this expression is used as a pseudo content model of anyOtherElement. */ private Expression createChoiceOfAllExportedRules( SchemaProvider provider ) { Expression exp = Expression.nullSet; Iterator itr = provider.iterateNamespace(); while( itr.hasNext() ) { String namespace = (String)itr.next(); IslandSchema is = provider.getSchemaByNamespace(namespace); ElementDecl[] rules = is.getElementDecls(); for( int j=0; j<rules.length; j++ ) exp = module.pool.createChoice(exp, new ExternalElementExp(module.pool,namespace,rules[j].getName(),null)); } return exp; } }
IslandVerifier iv = is.createNewVerifier(namespaceUri,rules); dispatcher.switchVerifier( iv );
AttributesDecl rule = is.getAttributesDeclByName(eexp.role); if(rule==null) { errorHandler.error( new SAXParseException(
return exp; eexp.rule = is.getElementDeclByName(eexp.ruleName); if(eexp.rule==null)
/** * creates a choice expression of all exported rules in the given provider. * * this expression is used as a pseudo content model of anyOtherElement. */ private Expression createChoiceOfAllExportedRules( SchemaProvider provider ) { Expression exp = Expression.nullSet; Iterator itr = provider.iterateNamespace(); while( itr.hasNext() ) { String namespace = (String)itr.next(); IslandSchema is = provider.getSchemaByNamespace(namespace); ElementDecl[] rules = is.getElementDecls(); for( int j=0; j<rules.length; j++ ) exp = module.pool.createChoice(exp, new ExternalElementExp(module.pool,namespace,rules[j].getName(),null)); } return exp; } }
IslandVerifier iv = is.createNewVerifier(namespaceUri,rules); dispatcher.switchVerifier( iv );
AttributesDecl rule = is.getAttributesDeclByName(eexp.role); if(rule==null) { errorHandler.error( new SAXParseException(
return exp; eexp.rule = is.getElementDeclByName(eexp.ruleName); if(eexp.rule==null)
public void startElement( String namespaceURI, String localName, String qName, Attributes attributes ) throws SAXException { if( namespaceToIgnore.equals(namespaceURI) ) return; // this element is "validated". // try to locate a grammar of this namespace IslandSchema is = dispatcher.getSchemaProvider().getSchemaByNamespace(namespaceURI); if( is==null ) {// no grammar is declared with this namespace URI. return; // continue ignoring. } // a schema is found: revert to normal mode and validate them. IslandVerifier iv = is.createNewVerifier( namespaceURI, is.getElementDecls() ); dispatcher.switchVerifier(iv); // simulate this startElement method. iv.startElement(namespaceURI,localName,qName,attributes); } }
/** * creates a choice expression of all exported rules in the given provider. * * this expression is used as a pseudo content model of anyOtherElement. */ private Expression createChoiceOfAllExportedRules( SchemaProvider provider ) { Expression exp = Expression.nullSet; Iterator<?> itr = provider.iterateNamespace(); while( itr.hasNext() ) { String namespace = (String)itr.next(); IslandSchema is = provider.getSchemaByNamespace(namespace); ElementDecl[] rules = is.getElementDecls(); for( int j=0; j<rules.length; j++ ) exp = module.pool.createChoice(exp, new ExternalElementExp(module.pool,namespace,rules[j].getName(),null)); } return exp; } }
IslandVerifier iv = is.createNewVerifier(namespaceUri,rules); dispatcher.switchVerifier( iv );
/** binds all IslandSchemata. */ public boolean bind( ErrorHandler handler ) { ErrorHandlerFilter filter = new ErrorHandlerFilter(handler); try { Iterator<?> itr = schemata.values().iterator(); while( itr.hasNext() ) { ((IslandSchema)itr.next()).bind( this, filter ); } } catch( SAXException e ) { // bind method may throw SAXException. return false; } return !filter.hadError; }
AttributesDecl rule = is.getAttributesDeclByName(eexp.role); if(rule==null) { errorHandler.error( new SAXParseException(
return exp; eexp.rule = is.getElementDeclByName(eexp.ruleName); if(eexp.rule==null)
@Override public void startElement (final String namespaceURI, final String localName, final String qName, final Attributes attributes) throws SAXException { if (namespaceToIgnore.equals (namespaceURI)) return; // this element is "validated". // try to locate a grammar of this namespace final IslandSchema is = dispatcher.getSchemaProvider ().getSchemaByNamespace (namespaceURI); if (is == null) {// no grammar is declared with this namespace URI. return; // continue ignoring. } // a schema is found: revert to normal mode and validate them. final IslandVerifier iv = is.createNewVerifier (namespaceURI, is.getElementDecls ()); dispatcher.switchVerifier (iv); // simulate this startElement method. iv.startElement (namespaceURI, localName, qName, attributes); } }
/** * creates a choice expression of all exported rules in the given provider. * * this expression is used as a pseudo content model of anyOtherElement. */ private Expression createChoiceOfAllExportedRules( SchemaProvider provider ) { Expression exp = Expression.nullSet; Iterator itr = provider.iterateNamespace(); while( itr.hasNext() ) { String namespace = (String)itr.next(); IslandSchema is = provider.getSchemaByNamespace(namespace); ElementDecl[] rules = is.getElementDecls(); for( int j=0; j<rules.length; j++ ) exp = module.pool.createChoice(exp, new ExternalElementExp(module.pool,namespace,rules[j].getName(),null)); } return exp; } }
IslandVerifier iv = is.createNewVerifier(namespaceUri,rules); dispatcher.switchVerifier( iv );
/** binds all IslandSchemata. */ public boolean bind( ErrorHandler handler ) { ErrorHandlerFilter filter = new ErrorHandlerFilter(handler); try { Iterator itr = schemata.values().iterator(); while( itr.hasNext() ) ((IslandSchema)itr.next()).bind( this, filter ); } catch( SAXException e ) { // bind method may throw SAXException. return false; } return !filter.hadError; }