cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r663716 - in /cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Date Thu, 05 Jun 2008 19:40:15 GMT
Author: dkulp
Date: Thu Jun  5 12:40:15 2008
New Revision: 663716

URL: http://svn.apache.org/viewvc?rev=663716&view=rev
Log:
Merged revisions 663711 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r663711 | dkulp | 2008-06-05 15:29:37 -0400 (Thu, 05 Jun 2008) | 2 lines
  
  Hacky workaround for WSCOMMONS-355
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java?rev=663716&r1=663715&r2=663716&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Thu Jun  5 12:40:15 2008
@@ -34,6 +34,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;
@@ -90,7 +91,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