XML validation using Java Code
问题 I need some code sample which shows how I can validate a xml file against a schema. Below is my XML document: <birthdate> <month>January</month> <day>21</day> <year>1983</year> </birthdate> The schema against which I want to validate the above XML is: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" /> <xs:element name="birthdate"> <xs:complexType> <xs:sequence> <xs:element name=