You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2008/05/03 00:50:06 UTC
svn commit: r652938 -
/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Author: bimargulies
Date: Fri May 2 15:50:06 2008
New Revision: 652938
URL: http://svn.apache.org/viewvc?rev=652938&view=rev
Log:
Remove workaround for fixed problem in XmlSchema.
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=652938&r1=652937&r2=652938&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 Fri May 2 15:50:06 2008
@@ -20,7 +20,6 @@
package org.apache.cxf.common.xmlschema;
import java.io.Reader;
-import java.io.StringReader;
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
@@ -204,19 +203,14 @@
}
/**
- * This is a really ugly trick to get around a bug or oversight in XmlSchema, which is that
- * there is no way to programmatically construct an XmlSchema instance that ends up cataloged
- * in a collection. If there is a fix to WSCOMMONS-272, this can go away.
+ * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was
+ * created to hold a workaround.
* @param namespaceURI TNS for new schema.
* @return new schema
*/
public XmlSchema newXmlSchemaInCollection(String namespaceURI) {
- StringBuffer tinyXmlSchemaDocument = new StringBuffer();
- tinyXmlSchemaDocument.append("<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' ");
- tinyXmlSchemaDocument.append("targetNamespace='" + namespaceURI + "'/>");
- StringReader reader = new StringReader(tinyXmlSchemaDocument.toString());
- return schemaCollection.read(reader, new ValidationEventHandler() { });
+ return new XmlSchema(namespaceURI, schemaCollection);
}
/**