• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

xml validation agains xsd

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :-)
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic