XML validation against XSD with javax.xml.validation.Validator: cannot resolve types come from 2nd XSD
问题 I am trying to write a method that validates XML against XSD. In my case, I have multiple XSD files. When I use tools like IntelliJ IDEA to generate a sample XML from my main XSD everything looks fine: the sample XML is generated and looks as I expect. So I think that my XSD files are okay. This is my simplified main XSD: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <xsd:import schemaLocation=