Title: Ignoring a DTD declaration and doing schema validation instead

I have some documents to process that may or may not contain DOCTYPE declarations.

I want to always validate the document against a schema that I specify, ignoring a DOCTYPE declaration if present. (What I have already works fine for documents where there isn't a DOCTYPE declaration)

I am looking for an alternative to removing the DOCTYPE declaration before starting validation. Any suggestions? I have tried using an EntityResolver to get around the file not found exceptions for the dtd, but the parser validates against whatever I return for the dtd rather than the schema.

Thanks,

Reply via email to