XML Validator with XML SCHEMA

Goodmorning,

 

I'm making a Java parser, and I would like to take as input a XML Schema.
I'm using Xerces 2.6.0 and I read that this tool can use XML Schema. I Tried
to write a java tool and I found out that my program works with DTD very
good, but I don't know like to use with an XML Schema. What differents codes
or .jar I have to use? Which features about xerces I have to introduct in my
program?

 

With DTD I wrote: 

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

 

And with XML Schema I wrote

 

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

 

The problem is that with the second code, my program use DTD always. Why?

Please write me soon, I hope you know a solution.

Thank you.

     Gianni

 

 

Received on Thursday, 22 January 2004 08:04:26 UTC