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/08/25 01:00:36 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/v2 XSDAbstractParticleTraverser.java XSDAbstractTraverser.java XSDAttributeGroupTraverser.java XSDAttributeTraverser.java XSDComplexTypeTraverser.java XSDElementTraverser.java XSDGroupTraverser.java XSDHandler.java XSDNotationTraverser.java XSDSimpleTypeTraverser.java XSDWildcardTraverser.java XSDocumentInfo.java
sandygao 01/08/24 16:00:36
Modified: java/src/org/apache/xerces/impl/v2
XSDAbstractParticleTraverser.java
XSDAbstractTraverser.java
XSDAttributeGroupTraverser.java
XSDAttributeTraverser.java
XSDComplexTypeTraverser.java
XSDElementTraverser.java XSDGroupTraverser.java
XSDHandler.java XSDNotationTraverser.java
XSDSimpleTypeTraverser.java
XSDWildcardTraverser.java XSDocumentInfo.java
Log:
Removed some of the syntax errors.
Revision Changes Path
1.2 +9 -9 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAbstractParticleTraverser.java
Index: XSDAbstractParticleTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAbstractParticleTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDAbstractParticleTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDAbstractParticleTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
-package org.apache.xerces.impl.v2;
+package org.apache.xerces.impl.v2;
import org.w3c.dom.Element;
@@ -73,7 +73,7 @@
* </all>
**/
int traverseAll(Element allDecl,
- XSDocument schemaDoc,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
return -1;
}
@@ -92,8 +92,8 @@
* </sequence>
*
**/
- int traverseSequence (Element seqDecl,
- XSDocument schemaDoc,
+ int traverseSequence (Element seqDecl,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
//call traverse* methods;
return -1;
@@ -114,7 +114,7 @@
*
**/
int traverseChoice (Element choiceDecl,
- XSDocument schemaDoc,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
}
1.3 +2 -1 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAbstractTraverser.java
Index: XSDAbstractTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAbstractTraverser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSDAbstractTraverser.java 2001/08/24 22:21:52 1.2
+++ XSDAbstractTraverser.java 2001/08/24 23:00:36 1.3
@@ -61,13 +61,14 @@
import org.apache.xerces.util.SymbolTable;
import org.w3c.dom.Element;
import java.util.Hashtable;
+import org.apache.xerces.util.XMLManipulator;
/**
* Class <code>XSDAbstractTraverser</code> serves as the base class for all
* other <code>XSD???Traverser</code>s. It holds the common data and provide
* a unified way to initialize these data.
*
- * @version $Id: XSDAbstractTraverser.java,v 1.2 2001/08/24 22:21:52 sandygao Exp $
+ * @version $Id: XSDAbstractTraverser.java,v 1.3 2001/08/24 23:00:36 sandygao Exp $
*/
abstract class XSDAbstractTraverser {
1.2 +14 -14 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAttributeGroupTraverser.java
Index: XSDAttributeGroupTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAttributeGroupTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDAttributeGroupTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDAttributeGroupTraverser.java 2001/08/24 23:00:36 1.2
@@ -3,7 +3,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -19,7 +19,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -27,7 +27,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -62,29 +62,29 @@
/**
* The attribute group definition schema component traverser.
- *
- * <attributeGroup
- * id = ID
- * name = NCName
- * ref = QName
+ *
+ * <attributeGroup
+ * id = ID
+ * name = NCName
+ * ref = QName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
* </attributeGroup>
- * @version $Id: XSDAttributeGroupTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ * @version $Id: XSDAttributeGroupTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDAttributeGroupTraverser extends XSDAbstractTraverser{
XSDAttributeGroupTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
- //REVISIT: what should we return?
+ //REVISIT: what should we return?
// should we store attribute group in the grammar?
- int traverse(Element elmNode,
- XSDocument schemaDoc,
+ int traverse(Element elmNode,
+ XSDocumentInfo schemaDoc,
ComplexTypeInfo typeInfo,
Vector anyAttDecls) throws Exception {
1.2 +20 -20 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAttributeTraverser.java
Index: XSDAttributeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDAttributeTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDAttributeTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDAttributeTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -64,35 +64,35 @@
/**
* The attribute declaration schema component traverser.
- *
- * <attribute
- * default = string
- * fixed = string
+ *
+ * <attribute
+ * default = string
+ * fixed = string
* form = (qualified | unqualified)
- * id = ID
- * name = NCName
- * ref = QName
- * type = QName
+ * id = ID
+ * name = NCName
+ * ref = QName
+ * type = QName
* use = (optional | prohibited | required) : optional
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (simpleType?))
* </attribute>
- *
- * @version $Id: XSDAttributeTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ *
+ * @version $Id: XSDAttributeTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDAttributeTraverser extends XSDAbstractTraverser {
- public XSDAttributeTraverser (XSHandler handler,
+ public XSDAttributeTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
//REVISIT: should we pass typeInfo, referredTo?
- protected int traverse(Element elmNode,
- XSDocument schemaDoc,
+ protected int traverse(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar,
ComplexTypeInfo typeInfo,
boolean referredTo) {
@@ -100,8 +100,8 @@
return -1;
}
- protected int traverseGlobal(Element elmNode,
- XSDocument schemaDoc,
+ protected int traverseGlobal(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar,
ComplexTypeInfo typeInfo,
boolean referredTo) {
1.2 +19 -19 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDComplexTypeTraverser.java
Index: XSDComplexTypeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDComplexTypeTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDComplexTypeTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDComplexTypeTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -66,18 +66,18 @@
/**
* A complex type definition schema component traverser.
- *
- * <complexType
+ *
+ * <complexType
* abstract = boolean : false
- * block = (#all | List of (extension | restriction))
- * final = (#all | List of (extension | restriction))
- * id = ID
+ * block = (#all | List of (extension | restriction))
+ * final = (#all | List of (extension | restriction))
+ * id = ID
* mixed = boolean : false
- * name = NCName
+ * name = NCName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
* </complexType>
- * @version $Id: XSDComplexTypeTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ * @version $Id: XSDComplexTypeTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
@@ -86,26 +86,26 @@
- XSDComplexTypeTraverser (XSDHandler handler,
+ XSDComplexTypeTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
- int traverse(Element elmNode,
- XSDocument schemaDoc,
+ int traverse(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar,
Stack currentGroupNameStack) {
- return -1;
+ return -1;
}
- int traverseGlobal (Element elmNode,
- XSDocument schemaDoc,
+ int traverseGlobal (Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar,
Stack currentGroupNameStack){
- return -1;
+ return -1;
}
1.2 +25 -25 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDElementTraverser.java
Index: XSDElementTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDElementTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDElementTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDElementTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -63,50 +63,50 @@
/**
* The element declaration schema component traverser.
- * <element
+ * <element
* abstract = boolean : false
- * block = (#all | List of (extension | restriction | substitution))
- * default = string
- * final = (#all | List of (extension | restriction))
- * fixed = string
+ * block = (#all | List of (extension | restriction | substitution))
+ * default = string
+ * final = (#all | List of (extension | restriction))
+ * fixed = string
* form = (qualified | unqualified)
- * id = ID
+ * id = ID
* maxOccurs = (nonNegativeInteger | unbounded) : 1
* minOccurs = nonNegativeInteger : 1
- * name = NCName
+ * name = NCName
* nillable = boolean : false
- * ref = QName
- * substitutionGroup = QName
- * type = QName
+ * ref = QName
+ * substitutionGroup = QName
+ * type = QName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
* </element>
- *
- * @version $Id: XSDElementTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ *
+ * @version $Id: XSDElementTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDElementTraverser extends XSDAbstractTraverser{
-
+
//
- // REVISIT: we should be able to acces
+ // REVISIT: we should be able to acces
// SubstitutionGroupHandler
//
XSDElementTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
- int traverse(Element elmDecl,
- XSDocument schemaDoc,
- XSGrammar grammar) {
+ int traverse(Element elmDecl,
+ XSDocumentInfo schemaDoc,
+ SchemaGrammar grammar) {
return -1;
}
- int traverseGlobal(Element elmDecl,
- XSDocument schemaDoc,
- XSGrammar grammar) {
+ int traverseGlobal(Element elmDecl,
+ XSDocumentInfo schemaDoc,
+ SchemaGrammar grammar) {
return -1;
}
1.2 +13 -12 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDGroupTraverser.java
Index: XSDGroupTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDGroupTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDGroupTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDGroupTraverser.java 2001/08/24 23:00:36 1.2
@@ -3,7 +3,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -19,7 +19,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -27,7 +27,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -57,35 +57,36 @@
*/
package org.apache.xerces.impl.v2;
+import org.apache.xerces.impl.XMLErrorReporter;
import org.w3c.dom.Element;
/**
* The model group schema component traverser.
- *
- * <group
+ *
+ * <group
* name = NCName>
* Content: (annotation?, (all | choice | sequence))
* </group>
- * @version $Id: XSDGroupTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ * @version $Id: XSDGroupTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDGroupTraverser extends XSDAbstractParticleTraverser{
-
+
private Stack fCurrentGroupNameStack;
private Hashtable fGroupNameRegistry;
XSDGroupTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
//
- // REVISIT:
+ // REVISIT:
// what should we return?
// should we store group decls in the grammar?
- int traverse(Element elmNode,
- XSDocument schemaDoc) {
+ int traverse(Element elmNode,
+ XSDocumentInfo schemaDoc) {
return -1;
}
1.3 +47 -39 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDHandler.java
Index: XSDHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSDHandler.java 2001/08/24 22:30:00 1.2
+++ XSDHandler.java 2001/08/24 23:00:36 1.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -57,16 +57,24 @@
package org.apache.xerces.impl.v2;
+import org.apache.xerces.impl.v2.datatypes.*;
+
import org.apache.xerces.impl.XMLErrorReporter;
+import org.apache.xerces.parsers.DOMParser;
+import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.util.SymbolTable;
-import GrammarResolver?;
+import org.apache.xerces.util.XMLManipulator;
+//import GrammarResolver;???
import org.w3c.dom.Document;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import java.util.Hashtable;
+import java.util.Vector;
+
// 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
// prepared to parse several schema documents (for instance if the
@@ -94,10 +102,10 @@
// These tables correspond to the symbol spaces defined in the
// spec.
- // They are keyed with a QName (that is, String("URI,localpart) and
- // their values are nodes corresponding to the given name's decl.
+ // They are keyed with a QName (that is, String("URI,localpart) and
+ // their values are nodes corresponding to the given name's decl.
// By asking the node for its ownerDocument and looking in
- // XSDocumentInfoRegistry we can easily get the corresponding
+ // XSDocumentInfoRegistry we can easily get the corresponding
// XSDocumentInfo object.
private Hashtable fUnparsedAttributeRegistry = new Hashtable();
private Hashtable fUnparsedAttributeGroupRegistry = new Hashtable();
@@ -109,9 +117,9 @@
// this is keyed with a documentNode (or the schemaRoot nodes
// contained in the XSDocumentInfo objects) and its value is the
- // XSDocumentInfo object corresponding to that document.
- // Basically, the function of this registry is to be a link
- // between the nodes we fetch from calls to the fUnparsed*
+ // XSDocumentInfo object corresponding to that document.
+ // Basically, the function of this registry is to be a link
+ // between the nodes we fetch from calls to the fUnparsed*
// arrays and the XSDocumentInfos they live in.
private Hashtable fXSDocumentInfoRegistry = new Hashtable();
@@ -126,11 +134,11 @@
private Vector fTraversed = new Vector();
// the primary XSDocumentInfo we were called to parse
- private XSDocumentInfo fRoot = null;
+ private XSDocumentInfo fRoot = null;
// the XMLErrorReporter
private XMLErrorReporter fErrorReporter;
-
+
// the XMLEntityResolver
private XMLEntityResolver fEntityResolver;
@@ -143,22 +151,22 @@
// REVISIT: old kind of DatatypeValidator...
private DatatypeValidatorFactoryImpl fDatatypeRegistry = null;
- //************ Traversers **********
+ //************ Traversers **********
XSDAttributeGroupTraverser fAttributeGroupTraverser;
XSDAttributeTraverser fAttributeTraverser;
XSDComplexTypeTraverser fComplexTypeTraverser;
- XXSDElementTraverser fElementTraverser;
+ XSDElementTraverser fElementTraverser;
XSDGroupTraverser fGroupTraverser;
XSDNotationTraverser fNotationTraverser;
XSDSimpleTypeTraverser fSimpleTypeTraverser;
XSDWildcardTraverser fWildCardTraverser;
// Constructors
-
+
// it should be possible to use the same XSDHandler to parse
// multiple schema documents; this will allow one to be
// constructed.
- XSDHandler (GrammarResolver gResolver,
+ XSDHandler (GrammarResolver gResolver,
XMLErrorReporter errorReporter,
XMLEntityResolver entityResolver,
SymbolTable symbolTable) {
@@ -184,7 +192,7 @@
Document schemaRoot = getSchema(schemaNamespace, schemaHint);
fRoot = constructTrees(schemaRoot);
- // second phase: fill global registries.
+ // second phase: fill global registries.
buildGlobalNameRegistries();
// third phase: call traversers
@@ -199,8 +207,8 @@
// reset all traversers and SchemaHandler
reset();
- // and return.
- return fGrammarResolver.get(fRoot.fTargetNamespace));
+ // and return.
+ return fGrammarResolver.get(fRoot.fTargetNamespace);
} // end parseSchema
// may wish to have setter methods for ErrorHandler,
@@ -218,14 +226,14 @@
XSDocumentInfo currSchemaInfo = new
XSDocumentInfo(schemaRoot);
Vector dependencies = new Vector();
- Element rootNode = XMLManipulator.getRoot(schemaInfo);
+ Element rootNode = XMLManipulator.getRoot(schemaRoot);
String schemaNamespace;
String schemaHint;
Document newSchemaRoot = null;
- forElement child =
- XMLManipulator.getFirstChild(rootNode);
+ for (Element child =
+ XMLManipulator.getFirstChildElement(rootNode);
child != null;
- child = XMLManipulator.getNextSibling(child)) {
+ child = XMLManipulator.getNextSiblingElement(child)) {
String localName = XMLManipulator.getLocalName(child);
if(localName.equals(SchemaSymbols.ELT_ANNOTATION))
continue;
@@ -239,7 +247,7 @@
// make sure TNS is right (don't care about redef contents
// yet).
newSchemaRoot = getSchema(schemaNamespace, schemaHint);
- } else
+ } else {
// no more possibility of schema references in well-formed
// schema...
break;
@@ -252,7 +260,7 @@
}
dependencies.addElement(newSchemaInfo);
newSchemaRoot = null;
- }
+ }
fDependencyMap.put(currSchemaInfo, dependencies);
} // end constructTrees
@@ -273,14 +281,14 @@
// Beginning at the first schema processing was requested for
// (fRoot), this method
// examines each child (global schema information item) of each
- // schema document (and of each <redefine> element)
+ // schema document (and of each <redefine> element)
// corresponding to an XSDocumentInfo object. If the
// readOnly field on that node has not been set, it calls an
// appropriate traverser to traverse it. Once all global decls in
// an XSDocumentInfo object have been traversed, it marks that object
// as traversed (or hidden) in order to avoid infinite loops. It completes
// when it has visited all XSDocumentInfo objects in the
- // DependencyMap and marked them as traversed.
+ // DependencyMap and marked them as traversed.
protected void traverseSchemas() {
} // end traverseSchemas
@@ -300,19 +308,19 @@
// This method returns whatever the traverser it called returned;
// since this will depend on the type of the traverser in
// question, this needs to be an Object.
- protected Object callTraverser(XSDocumentInfo currSchema,
- int declType,
+ protected Object callTraverser(XSDocumentInfo currSchema,
+ int declType,
QName declToTraverse) {
} // end callTraverser
// Since ID constraints can occur in local elements, unless we
// wish to completely traverse all our DOM trees looking for ID
// constraints while we're building our global name registries,
- // which seems terribly inefficient, we need to resolve keyrefs
+ // which seems terribly inefficient, we need to resolve keyrefs
// after all parsing is complete. This we can simply do by running through
// fIdentityConstraintRegistry and calling traverseKeyRef on all
// of the KeyRef nodes. This unfortunately removes this knowledge
- // from the elementTraverser class (which must ignore keyrefs),
+ // from the elementTraverser class (which must ignore keyrefs),
// but there seems to be no efficient way around this...
protected void resolveKeyRefs() {
} // end resolveKeyRefs
@@ -328,8 +336,8 @@
XMLInputSource schemaSource = fEntityResolver.resolveEntity(schemaNamespace, schemaHint, null);
if(schemaSource != null) {
DOMParser schemaParser = new DOMParser(fSymbolTable);
- // set ErrorHandler and EntityResolver (doesn't seem that
- // XMLErrorHandler or XMLEntityResolver will work with
+ // set ErrorHandler and EntityResolver (doesn't seem that
+ // XMLErrorHandler or XMLEntityResolver will work with
// standard DOMParser...
// set appropriate features
@@ -337,8 +345,8 @@
return schemaParser.getDocument();
}
} // getSchema(String, String): Document
-
- // initialize all the traversers.
+
+ // initialize all the traversers.
private void createTraversers() {
fAttributeChecker = new
XSDAttributeChecker(fDatatypeRegistry, fErrorReporter);
@@ -362,7 +370,7 @@
// this method clears all the global structs of this object
// (except those passed in via the constructor).
- reset() {
+ void reset() {
fUnparsedAttributeRegistry.clear();
fUnparsedAttributeGroupRegistry.clear();
fUnparsedElementRegistry.clear();
@@ -372,9 +380,9 @@
fUnparsedTypeRegistry.clear();
fXSDocumentInfoRegistry.clear();
- fDependencyMap.clear();
+ fDependencyMap.clear();
fTraversed.removeAllElements();
- fRoot = null;
+ fRoot = null;
fDatatypeRegistry = null;
1.2 +17 -16 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDNotationTraverser.java
Index: XSDNotationTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDNotationTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDNotationTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDNotationTraverser.java 2001/08/24 23:00:36 1.2
@@ -3,7 +3,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -19,7 +19,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -27,7 +27,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -57,34 +57,35 @@
*/
package org.apache.xerces.impl.v2;
+import org.apache.xerces.impl.XMLErrorReporter;
import org.w3c.dom.Element;
/**
* The notation declaration schema component traverser.
- *
- * <notation
- * id = ID
- * name = NCName
- * public = anyURI
- * system = anyURI
+ *
+ * <notation
+ * id = ID
+ * name = NCName
+ * public = anyURI
+ * system = anyURI
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?)
* </notation>
- *
- * @version $Id: XSDNotationTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ *
+ * @version $Id: XSDNotationTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDNotationTraverser extends XSDAbstractTraverser{
- XSDNotationTraverser (XSHandler handler,
+ XSDNotationTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
//REVISIT: what should be the return type?
- String traverse(Element elmNode,
- XSDocument schemaDoc,
+ String traverse(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
}
1.2 +27 -26 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDSimpleTypeTraverser.java
Index: XSDSimpleTypeTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDSimpleTypeTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDSimpleTypeTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDSimpleTypeTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -57,40 +57,41 @@
package org.apache.xerces.impl.v2;
+import org.apache.xerces.impl.XMLErrorReporter;
import org.w3c.dom.Element;
/**
* The simple type definition schema component traverser.
- *
- * <simpleType
- * final = (#all | (list | union | restriction))
- * id = ID
- * name = NCName
+ *
+ * <simpleType
+ * final = (#all | (list | union | restriction))
+ * id = ID
+ * name = NCName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (restriction | list | union))
* </simpleType>
- *
- * <restriction
- * base = QName
- * id = ID
+ *
+ * <restriction
+ * base = QName
+ * id = ID
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*))
* </restriction>
- *
- * <list
- * id = ID
- * itemType = QName
+ *
+ * <list
+ * id = ID
+ * itemType = QName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (simpleType?))
* </list>
- *
- * <union
- * id = ID
- * memberTypes = List of QName
+ *
+ * <union
+ * id = ID
+ * memberTypes = List of QName
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?, (simpleType*))
* </union>
- * @version $Id: XSDSimpleTypeTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ * @version $Id: XSDSimpleTypeTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDSimpleTypeTraverser extends XSDAbstractTraverser{
@@ -99,15 +100,15 @@
// circular definitions..
private Stack fSimpleTypeNameStack;
- XSDSimpleTypeTraverser (XSHandler handler,
+ XSDSimpleTypeTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
//return success or failure?
- int traverse(Element elmNode,
- XSDocument schemaDoc,
+ int traverse(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
}
1.2 +18 -18 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDWildcardTraverser.java
Index: XSDWildcardTraverser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDWildcardTraverser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDWildcardTraverser.java 2001/08/24 12:06:40 1.1
+++ XSDWildcardTraverser.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -66,7 +66,7 @@
/**
* The wildcard schema component traverser.
- *
+ *
* <any
* id = ID
* maxOccurs = (nonNegativeInteger | unbounded) : 1
@@ -76,39 +76,39 @@
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?)
* </any>
- *
- *
- * <anyAttribute
- * id = ID
+ *
+ *
+ * <anyAttribute
+ * id = ID
* namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
* processContents = (lax | skip | strict) : strict
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?)
* </anyAttribute>
- * @version $Id: XSDWildcardTraverser.java,v 1.1 2001/08/24 12:06:40 elena Exp $
+ * @version $Id: XSDWildcardTraverser.java,v 1.2 2001/08/24 23:00:36 sandygao Exp $
*/
class XSDWildcardTraverser extends XSDAbstractTraverser {
- XSDWildcardTraverser (XSDHandler handler,
+ XSDWildcardTraverser (XSDHandler handler,
XMLErrorReporter errorReporter,
- GeneralAttrCheck gAttrCheck) {
+ XSAttributeChecker gAttrCheck) {
super(handler, errorReporter, gAttrCheck);
}
- int traverseAny(Element elmNode,
- XSDocument schemaDoc,
+ int traverseAny(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
- return -1;
+ return -1;
}
- int traverseAnyAttribute(Element elmNode,
- XSDocument schemaDoc,
+ int traverseAnyAttribute(Element elmNode,
+ XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
- return -1;
+ return -1;
}
1.2 +6 -6 xml-xerces/java/src/org/apache/xerces/impl/v2/XSDocumentInfo.java
Index: XSDocumentInfo.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDocumentInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSDocumentInfo.java 2001/08/24 22:28:16 1.1
+++ XSDocumentInfo.java 2001/08/24 23:00:36 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -74,7 +74,7 @@
*/
class XSDocumentInfo {
-
+
// Data
protected NamespaceSupport fNamespaceSupport;
@@ -86,7 +86,7 @@
// [block | final]Default
protected int fBlockDefault;
- protected fFinalDefault;
+ protected int fFinalDefault;
// targetNamespace
protected String fTargetNamespace;
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org