rahuls 2002/10/04 06:33:26 Modified: java/src/org/apache/xerces/impl/xs XMLSchemaLoader.java Log: 1. JAXP spec. allows []s of String, File, InputStream, InputSource as well, apart from Object[] for the property "http://java.sun.com/xml/jaxp/properties/schemaSource". Implementation must adhere to the spec. 2. Making the exception message more descriptive. Revision Changes Path 1.9 +18 -5 xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Index: XMLSchemaLoader.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XMLSchemaLoader.java 30 Aug 2002 02:53:04 -0000 1.8 +++ XMLSchemaLoader.java 4 Oct 2002 13:33:26 -0000 1.9 @@ -586,12 +586,22 @@ fJAXPProcessed = true; fGrammarBucket.putGrammar(loadSchema(fXSDDescription, xis, locationPairs)); return ; - } else if (componentType != Object.class) { - // Not an Object[] + } else if ( (componentType != Object.class) && + (componentType != String.class) && + (componentType != File.class) && + (componentType != InputStream.class) && + (componentType != InputSource.class) + ) { + // Not an Object[], String[], File[], InputStream[], InputSource[] throw new XMLConfigurationException( - XMLConfigurationException.NOT_SUPPORTED, JAXP_SCHEMA_SOURCE); + XMLConfigurationException.NOT_SUPPORTED, "\""+JAXP_SCHEMA_SOURCE+ + "\" property cannot have an array of type {"+componentType.getName()+ + "}. Possible types of the array supported are Object, String, File, "+ + "InputStream, InputSource."); } + // JAXP spec. allow []s of type String, File, InputStream, + // InputSource also, apart from [] of type Object. Object[] objArr = (Object[]) fJAXPSource; fJAXPProcessed = true; for (int i = 0; i < objArr.length; i++) { @@ -653,7 +663,10 @@ return new XMLInputSource(null, null, null, is, null); } throw new XMLConfigurationException( - XMLConfigurationException.NOT_SUPPORTED, JAXP_SCHEMA_SOURCE); + XMLConfigurationException.NOT_SUPPORTED, "\""+JAXP_SCHEMA_SOURCE+ + "\" property cannot have a value of type {"+val.getClass().getName()+ + "}. Possible types of the value supported are String, File, InputStream, "+ + "InputSource OR an array of these types."); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]