xml validation error:Caused by: nu.xom.ValidityException: Document is invalid: no grammar found
Joined: Apr 19, 2008
iam passing an xml document and xsd from a remote or local ,when i try to validate xml with schema/dtd defined in it.
iam getting the error as
Caused by: nu.xom.ValidityException: Document is invalid: no grammar found. at line 2, column 10
at nu.xom.Builder$ValidityRequired.error(Unknown Source)..
But when i keep validation arg as false i am able to read xml document and any xml violation of schema those messages are displayed on console.
But when i keep validation arg as true.iam getting the above exception.
The reason i came to know is schema/dtd can not be found,so it is showing as unknown source.
please any one give idea how to resolve it or code to resolve this problem.
The document contains a reference to a schema or a DTD? (You should be able to tell which it is, surely?) And the error message says the parser can't find that schema or DTD? Well, without seeing the document it's rather difficult to guess at what's going on. Perhaps the reference isn't a well-formed URL. Or perhaps it's a relative URL and the parser doesn't know what the system ID of the document is, because of how you chose to pass it to the parser. Or perhaps something else.
So... TellTheDetails. Show us the part of the document which refers to the schema or DTD. Show us the code which parses the document.