Since there was no response, I'll post a small example, just to clarify what my issue is.
the class below:
Code:
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection;
public class ImportedSchemaTest {
public static void main(String[] args) throws Exception {
// downloaded from:
// - http://www.openarchives.org/OAI/2.0/oai_dc.xsd
// - http://dublincore.org/schemas/xmls/simpledc20021212.xsd
// - http://www.w3.org/2001/xml.xsd
Resource[] resources = {
new ClassPathResource("oai_dc.xsd") ,
new ClassPathResource("simpledc20021212.xsd"),
new ClassPathResource("xml.xsd")
};
CommonsXsdSchemaCollection schemaCollection = new CommonsXsdSchemaCollection(resources);
schemaCollection.setXsds(resources);
schemaCollection.afterPropertiesSet();
schemaCollection.createValidator();
}
}
will throw an exception if executed without internet connectivity. oai_dc.xsd contains an import to http://dublincore.org/schemas/xmls/simpledc20021212.xsd, but CommonsXsdSchemaCollection doesn't realize that the XSD is available locally and tries to download it.