* Tests that imports without <tt>schemaLocation</tt> are resolved if the corresponding schemas
* have been registered using {@link XmlSchemaCollection#getKnownNamespaceMap()}.
*/
@Test
public void testImportWithKnownNamespace() {
XmlSchemaCollection schemaCol = new XmlSchemaCollection();
schemaCol.getKnownNamespaceMap().put("http://www.w3.org/XML/1998/namespace",
new XmlSchemaCollection().read(new InputSource(Resources.asURI("xml.xsd"))));
XmlSchema schema = schemaCol.read(new InputSource(Resources.asURI("knownNamespace.xsd")));
List<XmlSchemaExternal> externals = schema.getExternals();
assertEquals(1, externals.size());
XmlSchemaImport schemaImport = (XmlSchemaImport)externals.get(0);
assertEquals("http://www.w3.org/XML/1998/namespace", schemaImport.getNamespace());
XmlSchema schema2 = schemaImport.getSchema();