Question

I have a xml file, let's call it test.xml and I have a schema for validation (schema.xsd). I'm also using the last version of TomCat.
I was wondering what could cause the following errors :

Error: URI=file:///C:/../Upload/test.xml Line=2: Document is invalid: no grammar found.
Error: URI=file:///C:/../Upload/test.xml Line=2: Document root element "TEST_ROOT", must match DOCTYPE root "null".

Sincerly

Was it helpful?

Solution

I don't know TomCat and since you did not post any details on when you got this error I assume you got it when you yourself validated the xml against your xsd?

At first I'd try checking on command line with xmllint, this will give you some more information what is wrong with your document.

If you'd post some more details, we'd be able to help you further.

I'f you're an xml newbie, I'd suggest you read at first some tutorials. I.e. the almighty G will help you.

This may be a good start...

OTHER TIPS

This utility has a Validate vs. Schema function (File Menu). You pick the XML file then the XSD file. It is written in .NET ... maybe it will give you a more descriptive error.

http://www.dot-dash-dot.com/files/WTFXMLSetup_1_8_0.msi

Regarding those example URIs above, are the files in that folder on the C:\ drive of the Tomcat server? Or is that the path they were uploaded from?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top