cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r663711 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Date Thu, 05 Jun 2008 19:29:37 GMT
Author: dkulp
Date: Thu Jun  5 12:29:37 2008
New Revision: 663711

URL: http://svn.apache.org/viewvc?rev=663711&view=rev
Log:
Hacky workaround for WSCOMMONS-355

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java?rev=663711&r1=663710&r2=663711&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Thu Jun  5 12:29:37 2008
@@ -33,6 +33,7 @@
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaType;
 import org.apache.ws.commons.schema.extensions.ExtensionRegistry;
 import org.apache.ws.commons.schema.resolver.URIResolver;
@@ -93,7 +94,27 @@
     }
 
     public XmlSchemaType getTypeByQName(QName schemaTypeName) {
-        return schemaCollection.getTypeByQName(schemaTypeName);
+        XmlSchemaType xst = schemaCollection.getTypeByQName(schemaTypeName);
+        
+        //HACKY workaround for WSCOMMONS-355
+        if (xst == null 
+            && "http://www.w3.org/2001/XMLSchema".equals(schemaTypeName.getNamespaceURI()))
{
+            XmlSchema sch = getSchemaByTargetNamespace(schemaTypeName.getNamespaceURI());
+            
+            if ("anySimpleType".equals(schemaTypeName.getLocalPart())) {
+                XmlSchemaSimpleType type = new XmlSchemaSimpleType(sch);
+                type.setName(schemaTypeName.getLocalPart());
+                sch.addType(type);
+                xst = type;
+            } else if ("anyType".equals(schemaTypeName.getLocalPart())) {
+                XmlSchemaType type = new XmlSchemaType(sch);
+                type.setName(schemaTypeName.getLocalPart());
+                sch.addType(type);
+                xst = type;
+            }
+        }
+        
+        return xst;
     }
 
     public XmlSchema[] getXmlSchema(String systemId) {



Mime
View raw message