jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes XML schema validation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML schema validation problem" Watch "XML schema validation problem" New topic

XML schema validation problem

Mickey White

Joined: Dec 07, 2001
Posts: 1
I have great problems to get a xml document validated against a xml schema. First, I tried using Xerces 2.0.0 beta3, but now i use Xerces 1.4.4. To check my implementation, I use the examples of Xerces (personal-schema.xml, personal.xsd).
I have written the following code:
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.framework.*;
import java.io.*;
import org.w3c.dom.Document;
import org.xml.sax.*;
public class Test {
public static void main(String[] args) {
try {
DOMParser parser = new DOMParser();
parser.setFeature( "http://xml.org/sax/features/validation", true);
parser.setFeature( "http://xml.org/sax/features/namespaces", true);

parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
// parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);

ErrorChecker errors = new ErrorChecker();

System.out.println("Parse Dokument");

catch (Exception e) {
Now, the code cannot be compiled. It says, the method setValidationSchemaFullChecking is not in class DOMParser. You have to know that DOMParser extends the abstract class XMLParser in another package. This method is protected. But it should be possible to call this message!? Whats the problem with that???

I agree. Here's the link: http://aspose.com/file-tools
subject: XML schema validation problem
It's not a secret anymore!