public SchemaSG parse(InputSource pSource) throws Exception {
final String mName = "parse";
reset();
log.finest(mName, "->", pSource.getSystemId());
SGFactory factory = getSGFactory();
XSSchema schema;
if (Boolean.valueOf(getGenerator().getProperty("jaxme.dtd.input")).booleanValue()) {
DTDParser parser = new DTDParser();
String targetNamespace = getGenerator().getProperty("jaxme.dtd.targetNamespace");
if (targetNamespace != null && !"".equals(targetNamespace)) {
parser.setTargetNamespace(new XsAnyURI(targetNamespace));
}
schema = parser.parse(pSource);
} else {
XSParser parser = factory.newXSParser();
log.finest(mName, "Parser = " + parser + ", validating = " + getGenerator().isValidating());
parser.setValidating(getGenerator().isValidating());
schema = parser.parse(pSource);
}
log.finest(mName, "Schema = " + schema);
SchemaSG result = factory.getSchemaSG(schema);
log.finest(mName, "<-", result);
return result;
}