wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes XML validation common mistakes question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML validation common mistakes question" Watch "XML validation common mistakes question" New topic
Author

XML validation common mistakes question

Adam Teg
Ranch Hand

Joined: Jul 10, 2007
Posts: 58
Any guess why an DocumentBuilder parses an XML fine but it does not catch the schema contraint error. When I put a malformed xml it catches the problem. But when I remove a required attribute it is fine. I have setAttribute with XMLSchema and XSD. Please hint on common mistakes.

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

That's probably because you aren't telling the parser to validate against your schema, or if you are then you aren't doing it correctly.

I haven't used schemas myself but the Ranch has an XML FAQ page. There are links about validating against schemas there, so check them out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML validation common mistakes question
 
Similar Threads
Assignment 1.1
Missing something creating a DataSource, MySql 5.0, MyEclipse 6.5, Tomcat 6
AspectJ in Action: greenhorn gotcha's
calling jsp from servlet
Problem compile