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);
}