• 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

How to validate an XML document against a xsd file ?

 
author
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have an xml file loaded in memory (Actually in a String but I can parse it).
I'd like to check the file against an .xsd document (the xml document must respect rules in the xsd file) Does anybody know how to do it in Java?
Thanks a lot
Francesco
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has been asked before, so a search on this forum would have helped immediately...
Anyway, here are a couple of resources to try out:
https://coderanch.com/t/125376/XML/Validating-XML-against-xsd-schemata
http://bobcat.webappcabaret.net/javachina/faq/xml_java_01.htm#jaxp_sax_Q60
http://www-106.ibm.com/developerworks/edu/x-dw-xvalid-i.html
 
Francesco Marchioni
author
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answer. Regards
Francesco
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic