• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML validation using Schema

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to validate XML document against a W3C Schema using a validating parser. I want to trap the validation error so that I am able to know which XML element is not valid.
e.g. my schema says that the element ExpiryDate
is of type "xsd:gMonth"
How can I be able to know from my program that this field has failed out of the many other fields? I mean can I trap the exception and be able to identify the field which failed?
I want to get a DOM Document as the output of the parsing.
Thanks in advance
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please read this thread,may be it will help you.
https://coderanch.com/t/125279/XML/Validation-best-approach
Regards
Balaji
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic