tags:

views:

152

answers:

2

Hi, 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

+1  A: 

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%5F1%5F8%5F0.msi

Ron

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?

Ron Savage
+2  A: 

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...

dhiller
I get the error when my servlet is started and when I parse the xml file
Frank