SWS-339
This commit is contained in:
@@ -163,8 +163,10 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali
|
||||
for (int i = 0; i < imports.getCount(); i++) {
|
||||
XmlSchemaExternal external = (XmlSchemaExternal) imports.getItem(i);
|
||||
if (external instanceof XmlSchemaImport) {
|
||||
XmlSchema importedSchema = external.getSchema();
|
||||
if (importedSchema != null && !processedSchemas.contains(importedSchema)) {
|
||||
XmlSchemaImport schemaImport = (XmlSchemaImport) external;
|
||||
XmlSchema importedSchema = schemaImport.getSchema();
|
||||
if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) &&
|
||||
importedSchema != null && !processedSchemas.contains(importedSchema)) {
|
||||
inlineIncludes(importedSchema, processedSchemas);
|
||||
findImports(importedSchema, processedSchemas);
|
||||
xmlSchemas.add(importedSchema);
|
||||
|
||||
@@ -90,6 +90,15 @@ public class CommonsXsdSchemaCollectionTest extends XMLTestCase {
|
||||
assertEquals("Invalid amount of XSDs loaded", 1, schemas.length);
|
||||
}
|
||||
|
||||
public void testXmlNamespace() throws Exception {
|
||||
Resource resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTestCase.class);
|
||||
collection.setXsds(new Resource[]{resource});
|
||||
collection.setInline(true);
|
||||
collection.afterPropertiesSet();
|
||||
XsdSchema[] schemas = collection.getXsdSchemas();
|
||||
assertEquals("Invalid amount of XSDs loaded", 1, schemas.length);
|
||||
}
|
||||
|
||||
public void testCreateValidator() throws Exception {
|
||||
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTestCase.class);
|
||||
collection.setXsds(new Resource[]{a});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns="http://www.springframework.org/spring-ws/xmlNamespace" elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
|
||||
|
||||
<xsd:element name="GetOrderRequest">
|
||||
<xsd:complexType>
|
||||
|
||||
Reference in New Issue
Block a user