• Post Reply Bookmark Topic Watch Topic
  • New Topic

xml validation agains xsd  RSS feed

 
prash patil
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,
I need suggestion/pointers regarding programmatic xml validation.
I have a XML & DTD file. I want to validate that xml file against the specified DTD using java program.



regards,
PP :-)
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your subject line and post contradict each other. Are you looking for DTD validation or XML schema validation?

DTD Validation:
SAX program that validates documents

To perform XSD validation you have to set some additional features:

"http://xml.org/sax/features/namespace-prefixes" to enable namespace support.
"http://apache.org/xml/features/validation/schema" to enable XML Schema validation.

If you need to validate against an external XML schema use the "http://apache.org/xml/properties/schema/external-schemaLocation" property.

Use of the features and properties are demonstated in this XSD validation code
[ December 05, 2008: Message edited by: Peer Reynders ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!