aspose file tools
The moose likes XML and Related Technologies and the fly likes How to validate an XML document against a xsd file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "How to validate an XML document against a xsd file ?" Watch "How to validate an XML document against a xsd file ?" New topic
Author

How to validate an XML document against a xsd file ?

Francesco Marchioni
author
Ranch Hand

Joined: Sep 22, 2003
Posts: 175
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


JBoss AS 5 Development
JBoss Tutorials
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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:
http://www.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


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Francesco Marchioni
author
Ranch Hand

Joined: Sep 22, 2003
Posts: 175
Thanks for your answer. Regards
Francesco
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to validate an XML document against a xsd file ?
 
Similar Threads
Validate XML from a string instead of a file?
How to validate an XML schema i.e. Validate an XSD file
how to validate xml document with xml schema in netbean and how to create simpleType in Netbean
How to validate XML against XSD in using JDom
XML Schema Help