This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Argh! Help! Want to use DOM, Schema, Factory to Validate! how? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Argh! Help! Want to use DOM, Schema, Factory to Validate! how?" Watch "Argh! Help! Want to use DOM, Schema, Factory to Validate! how?" New topic
Author

Argh! Help! Want to use DOM, Schema, Factory to Validate! how?

Dan Bizman
Ranch Hand

Joined: Feb 25, 2003
Posts: 387
I want to use the Java XML API so that I can pop in and out different implementations of XML parsers as I need/want to. However, as far as I can tell, if I want Xerces to validate an XML document with a Schema, I CANNOT use the DocumentBuilderFactory method. Is this correct? As far as I can tell, the only way to make it use a schema for validation is by setting certain parser features such as "http://apache.org/xml/features/validation/schema" and this can only be done on either a SAX Parser or Xerces' DOMParser, which you MUST refer to explicitly by name to use "setFeature" since setFeature is not part of the DOM interface.
Does anyone know if there's a way around this? Can I actually use the following and make it use an XML Schema?

If not, then what was the purpose of the above interface?!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Argh! Help! Want to use DOM, Schema, Factory to Validate! how?