You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/01/03 21:18:14 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSDHandler.java
sandygao 02/01/03 12:18:14
Modified: java/src/org/apache/xerces/impl/xs/traversers
XSDHandler.java
Log:
According to the schema spec, it's an error if included or redefined documents can't be found. But it's ok if an imported document is not found.
An warning is issued in the latter case.
Revision Changes Path
1.9 +10 -4 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Index: XSDHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XSDHandler.java 20 Dec 2001 16:45:51 -0000 1.8
+++ XSDHandler.java 3 Jan 2002 20:18:14 -0000 1.9
@@ -97,7 +97,7 @@
* schema, other grammars may be constructed as a side-effect.
*
* @author Neil Graham, IBM
- * @version $Id: XSDHandler.java,v 1.8 2001/12/20 16:45:51 sandygao Exp $
+ * @version $Id: XSDHandler.java,v 1.9 2002/01/03 20:18:14 sandygao Exp $
*/
public class XSDHandler {
@@ -1015,12 +1015,12 @@
// otherwise. schemaDoc is null if and only if no schema document
// was resolved to.
private Document getSchema(String schemaNamespace, String schemaHint,
- String baseSystemId, boolean useProperties) {
+ String baseSystemId, boolean useNamespace) {
// contents of this method will depend on the system we adopt for entity resolution--i.e., XMLEntityHandler, EntityHandler, etc.
XMLInputSource schemaSource=null;
Document schemaDoc = null;
try {
- schemaSource = fLocationResolver.resolveEntity(schemaNamespace, schemaHint, baseSystemId, useProperties);
+ schemaSource = fLocationResolver.resolveEntity(schemaNamespace, schemaHint, baseSystemId, useNamespace);
// REVISIT: when the system id and byte stream and character stream
// of the input source are all null, it's
// impossible to find the schema document. so we skip in
@@ -1064,7 +1064,13 @@
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
"General",
new Object[]{"file not found: " + schemaHint},
- XMLErrorReporter.SEVERITY_WARNING);
+ // when using namespace, then hint is optional,
+ // and it's not an error if the file is not found
+ // but if not using namespace (include/redefine),
+ // it's an error if the file is not found.
+ useNamespace ?
+ XMLErrorReporter.SEVERITY_WARNING :
+ XMLErrorReporter.SEVERITY_ERROR);
}
catch (IOException ex) {
// REVISIT: report an error!
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org