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 2001/11/28 19:40:53 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSAttributeChecker.java XSDAbstractTraverser.java XSDAttributeTraverser.java XSDComplexTypeTraverser.java XSDElementTraverser.java XSDHandler.java XSDSimpleTypeTraverser.java XSDocumentInfo.java
sandygao 01/11/28 10:40:52
Modified: java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
XSConstraints.java
java/src/org/apache/xerces/impl/xs/traversers
XSAttributeChecker.java XSDAbstractTraverser.java
XSDAttributeTraverser.java
XSDComplexTypeTraverser.java
XSDElementTraverser.java XSDHandler.java
XSDSimpleTypeTraverser.java XSDocumentInfo.java
Log:
Update xs package to use the new ValidationContext/State, so that the classes
can tell the DV implementation whether facet checking or id/idref/entity checking is necessary.
Revision Changes Path
1.12 +56 -43 xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Index: XMLSchemaValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLSchemaValidator.java 2001/11/26 21:45:51 1.11
+++ XMLSchemaValidator.java 2001/11/28 18:40:52 1.12
@@ -119,7 +119,7 @@
* @author Eric Ye IBM
* @author Andy Clark IBM
* @author Jeffrey Rodriguez IBM
- * @version $Id: XMLSchemaValidator.java,v 1.11 2001/11/26 21:45:51 elena Exp $
+ * @version $Id: XMLSchemaValidator.java,v 1.12 2001/11/28 18:40:52 sandygao Exp $
*/
public class XMLSchemaValidator
implements XMLComponent, XMLDocumentFilter, FieldActivator {
@@ -164,7 +164,6 @@
public static final String ENTITY_RESOLVER =
Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
protected static final String VALIDATION_MANAGER =
Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
// REVISIT: this is just a temporary solution for entity resolver
@@ -187,7 +186,7 @@
SYMBOL_TABLE,
ERROR_REPORTER,
ENTITY_RESOLVER,
- VALIDATION_MANAGER
+ VALIDATION_MANAGER,
};
//
@@ -216,10 +215,10 @@
/** Entity resolver */
protected XMLEntityResolver fEntityResolver;
-
// updated during reset
protected ValidationManager fValidationManager = null;
protected ValidationState fValidationState = null;
+
// handlers
/** Document handler. */
@@ -360,7 +359,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void doctypeDecl(String rootElement, String publicId, String systemId,
+ public void doctypeDecl(String rootElement, String publicId, String systemId,
Augmentations augs)
throws XNIException {
@@ -428,9 +427,9 @@
XMLString defaultValue = handleEndElement(element);
// call handlers
if (fDocumentHandler != null) {
-
+
fDocumentHandler.emptyElement(element, attributes, augs);
-
+
// REVISIT: should we send default element value?
/*if (defaultValue == null) {
fDocumentHandler.emptyElement(element, attributes);
@@ -594,7 +593,7 @@
public void startEntity(String name,
String publicId, String systemId,
String baseSystemId,
- String encoding,
+ String encoding,
Augmentations augs) throws XNIException {
// call handlers
@@ -785,13 +784,6 @@
/** Stack to record if we saw character data outside of element content*/
boolean[] fStringContent = new boolean[INITIAL_STACK_SIZE];
- /**
- * This table has to be own by instance of XMLValidator and shared
- * among ID, IDREF and IDREFS.
- * REVISIT: Should replace with a lighter structure.
- */
- final Hashtable fTableOfIDs = new Hashtable();
- final Hashtable fTableOfIDRefs = new Hashtable();
/**
* temprory qname
@@ -802,6 +794,14 @@
*/
static final Object fTempObject = new Object();
+ // used to validate default/fixed values against xsi:type
+ // only need to check facets, so we set extraChecking to false (in reset)
+ private ValidationState fState4XsiType = new ValidationState();
+
+ // used to apply default/fixed values
+ // only need to check id/idref/entity, so we set checkFacets to false
+ private ValidationState fState4ApplyDefault = new ValidationState();
+
// identity constraint information
/**
@@ -911,7 +911,6 @@
fDynamicValidation = false;
}
- // get entity resolver. if there is no one, create a default
// REVISIT: use default entity resolution from ENTITY MANAGER - temporary solution
fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_MANAGER);
@@ -943,13 +942,20 @@
fElementDepth = -1;
fChildCount = 0;
- // clear values stored in id and idref table
- fTableOfIDs.clear();
- fTableOfIDRefs.clear();
-
fMatcherStack.clear();
fValueStoreCache = new ValueStoreCache();
+
+ fState4XsiType.setExtraChecking(false);
+ fState4XsiType.setSymbolTable(symbolTable);
+ fState4XsiType.setSymbolTable(symbolTable);
+ fState4XsiType.setNamespaceSupport(fNamespaceSupport);
+
+ fState4ApplyDefault.setFacetChecking(false);
+ fState4ApplyDefault.setSymbolTable(symbolTable);
+ fState4ApplyDefault.setSymbolTable(symbolTable);
+ fState4ApplyDefault.setNamespaceSupport(fNamespaceSupport);
+
} // reset(XMLComponentManager)
//
@@ -1135,6 +1141,7 @@
// thus we will not validate in the case dynamic feature is on or we found dtd grammar
fDoValidation = fValidation && !(fValidationManager.isGrammarFound() || fDynamicValidation);
+ // REVISIT: why don't we do it in reset()?
fValidationState = fValidationManager.getValidationState();
fValidationState.setNamespaceSupport(fNamespaceSupport);
fValidationState.setSymbolTable(fSymbolTable);
@@ -1146,27 +1153,8 @@
String sLocation = attributes.getValue(URI_XSI, XSI_SCHEMALOCATION);
String nsLocation = attributes.getValue(URI_XSI, XSI_NONAMESPACESCHEMALOCATION);
- if (sLocation != null) {
- StringTokenizer t = new StringTokenizer(sLocation, " \n\t\r");
- String namespace, location;
- while (t.hasMoreTokens()) {
- namespace = t.nextToken ();
- if (!t.hasMoreTokens()) {
- // REVISIT: new error code
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "General", new Object[]{"No matching location hint for namespace '" + namespace + "' in attribute schemaLocation"},
- XMLErrorReporter.SEVERITY_WARNING);
- break;
- }
- location = t.nextToken();
- if (fGrammarResolver.getGrammar(namespace) == null)
- fSchemaHandler.parseSchema(namespace, location);
- }
- }
- if (nsLocation != null) {
- if (fGrammarResolver.getGrammar(null) == null)
- fSchemaHandler.parseSchema(null, nsLocation);
- }
+ parseSchemas(sLocation, nsLocation);
+
// REVISIT: we should not rely on presence of
// schemaLocation or noNamespaceSchemaLocation
// attributes
@@ -1459,7 +1447,6 @@
return defaultValue;
} // handleEndElement(QName,boolean)*/
-
void handleStartPrefix(String prefix, String uri) {
// push namespace context if necessary
if (fPushForNextBinding) {
@@ -1471,6 +1458,30 @@
fNamespaceSupport.declarePrefix(prefix, uri.length() != 0 ? uri : null);
}
+ void parseSchemas(String sLocation, String nsLocation) {
+ if (sLocation != null) {
+ StringTokenizer t = new StringTokenizer(sLocation, " \n\t\r");
+ String namespace, location;
+ while (t.hasMoreTokens()) {
+ namespace = t.nextToken ();
+ if (!t.hasMoreTokens()) {
+ // REVISIT: new error code
+ fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
+ "general", new Object[]{"No matching location hint for namespace '" + namespace + "' in attribute schemaLocation"},
+ XMLErrorReporter.SEVERITY_WARNING);
+ break;
+ }
+ location = t.nextToken();
+ if (fGrammarResolver.getGrammar(namespace) == null)
+ fSchemaHandler.parseSchema(namespace, location);
+ }
+ }
+ if (nsLocation != null) {
+ if (fGrammarResolver.getGrammar(null) == null)
+ fSchemaHandler.parseSchema(null, nsLocation);
+ }
+ }
+
void getAndCheckXsiType(QName element, String xsiType) {
// This method also deals with clause 1.2.1.2 of the constraint
// Validation Rule: Schema-Validity Assessment (Element)
@@ -1816,10 +1827,12 @@
fChildCount == 0 && content.length() == 0 && !fNil) {
// 5.1.1 If the �actual type definition� is a �local type definition� then the canonical lexical representation of the {value constraint} value must be a valid default for the �actual type definition� as defined in Element Default Valid (Immediate) (�3.3.6).
if (fCurrentType != fCurrentElemDecl.fType) {
- if (XSConstraints.ElementDefaultValidImmediate(fCurrentType, fCurrentElemDecl.fDefault.toString()) == null)
+ if (XSConstraints.ElementDefaultValidImmediate(fCurrentType, fCurrentElemDecl.fDefault.toString(), fState4XsiType) == null)
reportSchemaError("cvc-elt.5.1.1", new Object[]{element.rawname, fCurrentType.getXSTypeName(), fCurrentElemDecl.fDefault.toString()});
}
// 5.1.2 The element information item with the canonical lexical representation of the {value constraint} value used as its �normalized value� must be �valid� with respect to the �actual type definition� as defined by Element Locally Valid (Type) (�3.3.4).
+ // REVISIT: don't use toString, but validateActualValue instead
+ // use the fState4ApplyDefault
elementLocallyValidType(element, fCurrentElemDecl.fDefault.toString());
}
else {
1.7 +4 -3 xml-xerces/java/src/org/apache/xerces/impl/xs/XSConstraints.java
Index: XSConstraints.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSConstraints.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XSConstraints.java 2001/11/26 22:24:35 1.6
+++ XSConstraints.java 2001/11/28 18:40:52 1.7
@@ -61,6 +61,7 @@
import org.apache.xerces.impl.dv.xs.*;
import org.apache.xerces.impl.xs.models.CMBuilder;
import org.apache.xerces.impl.xs.models.XSCMValidator;
+import org.apache.xerces.impl.validation.ValidationContext;
import java.util.Vector;
/**
@@ -68,7 +69,7 @@
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSConstraints.java,v 1.6 2001/11/26 22:24:35 lmartin Exp $
+ * @version $Id: XSConstraints.java,v 1.7 2001/11/28 18:40:52 sandygao Exp $
*/
public class XSConstraints {
@@ -246,7 +247,7 @@
* check whether a value is a valid default for some type
* returns the compiled form of the value
*/
- public static Object ElementDefaultValidImmediate(XSTypeDecl type, String value) {
+ public static Object ElementDefaultValidImmediate(XSTypeDecl type, String value, ValidationContext context) {
DatatypeValidator dv = null;
@@ -282,7 +283,7 @@
try {
// REVISIT: we'll be able to do this once he datatype redesign is implemented
//actualValue = dv.validate(value, null);
- dv.validate(value, null);
+ dv.validate(value, context);
actualValue = value;
} catch (InvalidDatatypeValueException ide) {
}
1.2 +5 -4 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java
Index: XSAttributeChecker.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSAttributeChecker.java 2001/10/25 20:36:04 1.1
+++ XSAttributeChecker.java 2001/11/28 18:40:52 1.2
@@ -96,7 +96,7 @@
* - use symbol table instead of many hashtables
*
* @author Sandy Gao, IBM
- * @version $Id: XSAttributeChecker.java,v 1.1 2001/10/25 20:36:04 elena Exp $
+ * @version $Id: XSAttributeChecker.java,v 1.2 2001/11/28 18:40:52 sandygao Exp $
*/
public class XSAttributeChecker {
@@ -1179,11 +1179,12 @@
return attrValues;
}
- private Object validate(String attr, String value, int dvIndex,
+ private Object validate(String attr, String ivalue, int dvIndex,
XSDocumentInfo schemaDoc) throws InvalidDatatypeValueException {
- if (value == null)
+ if (ivalue == null)
return null;
+ String value = normalize(ivalue, DatatypeValidator.COLLAPSE);
Object retValue = value;
Vector memberType;
int choice;
@@ -1202,7 +1203,7 @@
break;
case DT_NONNEGINT:
try {
- retValue = fXIntPool.getXInt(Integer.parseInt(value.trim()));
+ retValue = fXIntPool.getXInt(Integer.parseInt(value));
} catch (NumberFormatException e) {
throw new InvalidDatatypeValueException("the value '"+value+"' is not a valid nonNegativeInteger");
}
1.3 +8 -3 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
Index: XSDAbstractTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSDAbstractTraverser.java 2001/11/13 22:28:39 1.2
+++ XSDAbstractTraverser.java 2001/11/28 18:40:52 1.3
@@ -70,6 +70,7 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.impl.XMLErrorReporter;
import org.apache.xerces.util.SymbolTable;
+import org.apache.xerces.impl.validation.ValidationState;
import org.w3c.dom.Element;
import java.util.Hashtable;
import java.util.Vector;
@@ -84,7 +85,7 @@
* @author Elena Litani, IBM
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: XSDAbstractTraverser.java,v 1.2 2001/11/13 22:28:39 sandygao Exp $
+ * @version $Id: XSDAbstractTraverser.java,v 1.3 2001/11/28 18:40:52 sandygao Exp $
*/
abstract class XSDAbstractTraverser {
@@ -110,19 +111,23 @@
protected XSAttributeChecker fAttrChecker = null;
protected XMLErrorReporter fErrorReporter = null;
+ // used to validate default/fixed attribute values
+ ValidationState fValidationState = new ValidationState();
+
XSDAbstractTraverser (XSDHandler handler,
XSAttributeChecker attrChecker) {
fSchemaHandler = handler;
fAttrChecker = attrChecker;
}
- //REVISIT: Implement
void reset(XMLErrorReporter errorReporter, SymbolTable symbolTable) {
fErrorReporter = errorReporter;
fSymbolTable = symbolTable;
+ fValidationState.setExtraChecking(false);
+ fValidationState.setSymbolTable(symbolTable);
}
- // traver the annotation declaration
+ // traverse the annotation declaration
// REVISIT: store annotation information for PSVI
// REVISIT: how to pass the parentAttrs? as DOM attributes?
// as name/value pairs (string)? in parsed form?
1.4 +7 -3 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
Index: XSDAttributeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSDAttributeTraverser.java 2001/11/01 20:08:00 1.3
+++ XSDAttributeTraverser.java 2001/11/28 18:40:52 1.4
@@ -67,7 +67,9 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.impl.XMLErrorReporter;
import org.apache.xerces.util.DOMUtil;
+import org.apache.xerces.util.SymbolTable;
import org.apache.xerces.impl.xs.util.XInt;
+import org.apache.xerces.impl.validation.ValidationState;
import org.w3c.dom.Element;
/**
@@ -88,7 +90,7 @@
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSDAttributeTraverser.java,v 1.3 2001/11/01 20:08:00 sandygao Exp $
+ * @version $Id: XSDAttributeTraverser.java,v 1.4 2001/11/28 18:40:52 sandygao Exp $
*/
class XSDAttributeTraverser extends XSDAbstractTraverser {
@@ -167,6 +169,7 @@
if (defaultAtt != null && attrUse != null) {
// 2 if there is a {value constraint}, the canonical lexical representation of its value must be �valid� with respect to the {type definition} as defined in String Valid (�3.14.4).
+ fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
if (!checkDefaultValid(attrUse)) {
reportSchemaError ("a-props-correct.2", new Object[]{nameAtt, defaultAtt});
}
@@ -355,6 +358,7 @@
// 2 if there is a {value constraint}, the canonical lexical representation of its value must be �valid� with respect to the {type definition} as defined in String Valid (�3.14.4).
if (attribute.fDefault != null) {
+ fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
if (!checkDefaultValid(attribute)) {
reportSchemaError ("a-props-correct.2", new Object[]{nameAtt, defaultAtt});
}
@@ -394,7 +398,7 @@
//REVISIT: Our validators don't return Objects yet, instead return null
//
//attribute.fDefault = attribute.fType.validate((String)attribute.fDefault, null);
- attribute.fType.validate((String)attribute.fDefault, null);
+ attribute.fType.validate((String)attribute.fDefault, fValidationState);
} catch (InvalidDatatypeValueException ide) {
ret = false;
}
@@ -412,7 +416,7 @@
//REVISIT: Our validators don't return Objects yet, instead return null
//
//attrUse.fDefault = attrUse.fAttrDecl.fType.validate((String)attrUse.fDefault, null);
- attrUse.fAttrDecl.fType.validate((String)attrUse.fDefault, null);
+ attrUse.fAttrDecl.fType.validate((String)attrUse.fDefault, fValidationState);
} catch (InvalidDatatypeValueException ide) {
ret = false;
}
1.5 +5 -2 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Index: XSDComplexTypeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XSDComplexTypeTraverser.java 2001/11/02 23:01:08 1.4
+++ XSDComplexTypeTraverser.java 2001/11/28 18:40:52 1.5
@@ -89,7 +89,7 @@
* ((group | all | choice | sequence)?,
* ((attribute | attributeGroup)*, anyAttribute?))))
* </complexType>
- * @version $Id: XSDComplexTypeTraverser.java,v 1.4 2001/11/02 23:01:08 sandygao Exp $
+ * @version $Id: XSDComplexTypeTraverser.java,v 1.5 2001/11/28 18:40:52 sandygao Exp $
*/
class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
@@ -442,7 +442,10 @@
attrNode = fi.nodeAfterFacets;
}
-
+ fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
+ // REVISIT: after using the new simpleType interfaces, should be:
+ //stype = dvFactory.create(...);
+ //stype.applyFacets(..., fValidationState);
typeInfo.fDatatypeValidator = createRestrictedValidator(baseValidator,
fFacetData, fErrorReporter);
if (typeInfo.fDatatypeValidator == null) {
1.6 +4 -3 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
Index: XSDElementTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XSDElementTraverser.java 2001/11/13 22:30:12 1.5
+++ XSDElementTraverser.java 2001/11/28 18:40:52 1.6
@@ -96,7 +96,7 @@
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSDElementTraverser.java,v 1.5 2001/11/13 22:30:12 sandygao Exp $
+ * @version $Id: XSDElementTraverser.java,v 1.6 2001/11/28 18:40:52 sandygao Exp $
*/
class XSDElementTraverser extends XSDAbstractTraverser {
@@ -418,7 +418,8 @@
// 2 If there is a {value constraint}, the canonical lexical representation of its value must be �valid� with respect to the {type definition} as defined in Element Default Valid (Immediate) (�3.3.6).
if (element.fDefault != null) {
- Object actualValue = XSConstraints.ElementDefaultValidImmediate(element.fType, element.fDefault.toString());
+ fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
+ Object actualValue = XSConstraints.ElementDefaultValidImmediate(element.fType, element.fDefault.toString(), fValidationState);
if (actualValue == null) {
reportSchemaError ("e-props-correct.2", new Object[]{nameAtt, element.fDefault});
element.setConstraintType(XSElementDecl.NO_CONSTRAINT);
@@ -426,7 +427,7 @@
element.fDefault = actualValue;
}
- // 3 If there is an {substitution group affiliation}, the {type definition} of the element declaration must be validly derived from the {type definition} of the {substitution group affiliation}, given the value of the {substitution group exclusions} of the {substitution group affiliation}, as defined in Type Derivation OK (Complex) (�3.4.6) (if the {type definition} is complex) or as defined in Type Derivation OK (Simple) (�3.14.6) (if the {type definition} is simple).
+ // 3 If there is an {substitution group affiliation}, the {type definition} of the element declaration must be validly derived from the {type definition} of the {substitution group affiliation}, given the value of the {substitution group exclusions} of the {substitution group affiliation}, as defined in Type Derivation OK (Complex) (�3.4.6) (if the {type definition} is complex) or as defined in Type Derivation OK (Simple) (b3.14.6) (if the {type definition} is simple).
if (element.fSubGroup != null) {
if (!XSConstraints.checkTypeDerivationOk(element.fType, element.fSubGroup.fType, element.fSubGroup.fFinal)) {
reportSchemaError ("e-props-correct.3", new Object[]{nameAtt, subGroupAtt.prefix+":"+subGroupAtt.localpart});
1.4 +1 -11 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSDHandler.java 2001/11/13 22:30:12 1.3
+++ XSDHandler.java 2001/11/28 18:40:52 1.4
@@ -87,16 +87,6 @@
import java.util.Vector;
import java.io.IOException;
-// REVISIT: needed for the main method
-import org.apache.xerces.util.EntityResolverWrapper;
-import org.xml.sax.helpers.DefaultHandler;
-import java.util.Enumeration;
-import java.io.FileReader;
-import java.io.IOException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
/**
* The purpose of this class is to co-ordinate the construction of a
* grammar object corresponding to a schema. To do this, it must be
@@ -106,7 +96,7 @@
* schema, other grammars may be constructed as a side-effect.
*
* @author Neil Graham, IBM
- * @version $Id: XSDHandler.java,v 1.3 2001/11/13 22:30:12 sandygao Exp $
+ * @version $Id: XSDHandler.java,v 1.4 2001/11/28 18:40:52 sandygao Exp $
*/
public class XSDHandler {
1.3 +5 -1 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java
Index: XSDSimpleTypeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSDSimpleTypeTraverser.java 2001/10/29 17:09:50 1.2
+++ XSDSimpleTypeTraverser.java 2001/11/28 18:40:52 1.3
@@ -110,7 +110,7 @@
* </union>
*
* @author Elena Litani, IBM
- * @version $Id: XSDSimpleTypeTraverser.java,v 1.2 2001/10/29 17:09:50 sandygao Exp $
+ * @version $Id: XSDSimpleTypeTraverser.java,v 1.3 2001/11/28 18:40:52 sandygao Exp $
*/
class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
@@ -448,6 +448,10 @@
newDV = new ListDatatypeValidator(baseValidator, fFacetData, true, fErrorReporter);
}
else if (restriction) {
+ fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
+ // REVISIT: after using the new simpleType interfaces, should be:
+ //stype = dvFactory.create(...);
+ //stype.applyFacets(..., fValidationState);
newDV = createRestrictedValidator(baseValidator, fFacetData, fErrorReporter);
}
else { //union
1.2 +2 -1 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
Index: XSDocumentInfo.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDocumentInfo.java 2001/10/25 20:36:04 1.1
+++ XSDocumentInfo.java 2001/11/28 18:40:52 1.2
@@ -76,7 +76,7 @@
* affect the contents of that schema document alone.
*
* @author Neil Graham, IBM
- * @version $Id: XSDocumentInfo.java,v 1.1 2001/10/25 20:36:04 elena Exp $
+ * @version $Id: XSDocumentInfo.java,v 1.2 2001/11/28 18:40:52 sandygao Exp $
*/
class XSDocumentInfo {
@@ -134,6 +134,7 @@
fNamespaceSupportRoot = new SchemaNamespaceSupport(fNamespaceSupport);
fValidationContext.setNamespaceSupport(fNamespaceSupport);
+ fValidationContext.setSymbolTable(symbolTable);
// REVISIT: we can't return, becaues we can't pop fNamespaceSupport
//attrChecker.returnAttrArray(schemaAttrs, this);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org