public ParsedPattern parseExternal(String uri, SchemaBuilder schemaBuilder, Scope s, String inheritedNs) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, null, s, inheritedNs); xr.parse(makeInputSource(xr, uri)); return sp.getParsedPattern(); } catch (SAXException e) { throw SAXParseable.toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
p = new SAXParseable(new InputSource(path), eh); } else { p = new CompactParseable(new InputSource(path), eh);
public ParsedPattern parse(SchemaBuilder schemaBuilder) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, null, null,""); xr.parse(in); ParsedPattern p = sp.getParsedPattern(); return schemaBuilder.expandPattern(p); } catch (SAXException e) { throw toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
p = new SAXParseable(new InputSource(args[0]),eh); else p = new CompactParseable(new InputSource(args[0]),eh);
public ParsedPattern parse(SchemaBuilder schemaBuilder) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, null, null,""); xr.parse(in); ParsedPattern p = sp.getParsedPattern(); return schemaBuilder.expandPattern(p); } catch (SAXException e) { throw toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
public ParsedPattern parseExternal(String uri, SchemaBuilder schemaBuilder, Scope s, String inheritedNs) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, null, s, inheritedNs); xr.parse(makeInputSource(xr, uri)); return sp.getParsedPattern(); } catch (SAXException e) { throw SAXParseable.toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
p = new SAXParseable(new InputSource(args[0]), eh); } else { p = new CompactParseable(new InputSource(args[0]), eh);
public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, g, g, inheritedNs); xr.parse(makeInputSource(xr, uri)); return sp.getParsedPattern(); } catch (SAXException e) { throw SAXParseable.toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
p = new SAXParseable(new InputSource(args[0]),eh); else p = new CompactParseable(new InputSource(args[0]),eh);
public ParsedPattern parseInclude(String uri, SchemaBuilder schemaBuilder, IncludedGrammar g, String inheritedNs) throws BuildException, IllegalSchemaException { try { XMLReader xr = xrc.createXMLReader(); SchemaParser sp = new SchemaParser(this, xr, eh, schemaBuilder, g, g, inheritedNs); xr.parse(makeInputSource(xr, uri)); return sp.getParsedPattern(); } catch (SAXException e) { throw SAXParseable.toBuildException(e); } catch (IOException e) { throw new BuildException(e); } }
/** * Parses a RELAX NG grammar into an annotated grammar. */ private Model loadRELAXNG() throws SAXException { // build DOM forest final DOMForest forest = buildDOMForest( new RELAXNGInternalizationLogic() ); // use JAXP masquerading to validate the input document. // DOMForest -> ExtensionBindingChecker -> RNGOM XMLReaderCreator xrc = new XMLReaderCreator() { public XMLReader createXMLReader() { // foreset parser cannot change the receivers while it's working, // so we need to have one XMLFilter that works as a buffer XMLFilter buffer = new XMLFilterImpl() { public void parse(InputSource source) throws IOException, SAXException { forest.createParser().parse( source, this, this, this ); } }; XMLFilter f = new ExtensionBindingChecker(Const.RELAXNG_URI,opt,errorReceiver); f.setParent(buffer); f.setEntityResolver(opt.entityResolver); return f; } }; Parseable p = new SAXParseable( opt.getGrammars()[0], errorReceiver, xrc ); return loadRELAXNG(p); }
/** * Parses a RELAX NG grammar into an annotated grammar. */ private Model loadRELAXNG() throws SAXException { // build DOM forest final DOMForest forest = buildDOMForest( new RELAXNGInternalizationLogic() ); // use JAXP masquerading to validate the input document. // DOMForest -> ExtensionBindingChecker -> RNGOM XMLReaderCreator xrc = new XMLReaderCreator() { public XMLReader createXMLReader() { // foreset parser cannot change the receivers while it's working, // so we need to have one XMLFilter that works as a buffer XMLFilter buffer = new XMLFilterImpl() { public void parse(InputSource source) throws IOException, SAXException { forest.createParser().parse( source, this, this, this ); } }; XMLFilter f = new ExtensionBindingChecker(Const.RELAXNG_URI,opt,errorReceiver); f.setParent(buffer); f.setEntityResolver(opt.entityResolver); return f; } }; Parseable p = new SAXParseable( opt.getGrammars()[0], errorReceiver, xrc ); return loadRELAXNG(p); }