You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/05/05 22:53:11 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/validators/dtd DTDGrammar.java DTDImporter.java
andyc 00/05/05 13:53:11
Modified: java/src/org/apache/xerces/validators/common Tag: schemawork
XMLAttributeDecl.java
java/src/org/apache/xerces/validators/dtd Tag: schemawork
DTDGrammar.java DTDImporter.java
Log:
Revision Changes Path
No revision
No revision
1.1.2.6 +10 -12 xml-xerces/java/src/org/apache/xerces/validators/common/Attic/XMLAttributeDecl.java
Index: XMLAttributeDecl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/Attic/XMLAttributeDecl.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- XMLAttributeDecl.java 2000/05/05 01:52:38 1.1.2.5
+++ XMLAttributeDecl.java 2000/05/05 20:53:09 1.1.2.6
@@ -61,7 +61,7 @@
import org.apache.xerces.validators.datatype.DatatypeValidator;
/**
- * @version $Id: XMLAttributeDecl.java,v 1.1.2.5 2000/05/05 01:52:38 andyc Exp $
+ * @version $Id: XMLAttributeDecl.java,v 1.1.2.6 2000/05/05 20:53:09 andyc Exp $
*/
public class XMLAttributeDecl {
@@ -73,24 +73,22 @@
public static final int TYPE_CDATA = 0;
public static final int TYPE_ENTITY = 1;
- //public static final int TYPE_ENTITIES = 2;
- public static final int TYPE_ENUMERATION = 3;
- public static final int TYPE_ID = 4;
- public static final int TYPE_IDREF = 5;
- //public static final int TYPE_IDREFS = 6;
- public static final int TYPE_NMTOKEN = 7;
- //public static final int TYPE_NMTOKENS = 8;
+ public static final int TYPE_ENUMERATION = 2;
+ public static final int TYPE_ID = 3;
+ public static final int TYPE_IDREF = 4;
+ public static final int TYPE_NMTOKEN = 5;
+ public static final int TYPE_NOTATION = 6;
// schema
- public static final int TYPE_SIMPLE = 9;
- //public static final int TYPE_LIST = 10;
+ public static final int TYPE_SIMPLE = 7;
// default type
- public static final int DEFAULT_TYPE_NOTHING = 0;
+ public static final int DEFAULT_TYPE_IMPLIED = 0;
public static final int DEFAULT_TYPE_FIXED = 1;
public static final int DEFAULT_TYPE_REQUIRED = 2;
+ public static final int DEFAULT_TYPE_DEFAULT = 3;
//
// Data
@@ -137,7 +135,7 @@
datatypeValidator = null;
type = -1;
list = false;
- defaultType = DEFAULT_TYPE_NOTHING;
+ defaultType = DEFAULT_TYPE_IMPLIED;
defaultValue = null;
}
No revision
No revision
1.1.2.4 +6 -4 xml-xerces/java/src/org/apache/xerces/validators/dtd/Attic/DTDGrammar.java
Index: DTDGrammar.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/dtd/Attic/DTDGrammar.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- DTDGrammar.java 2000/05/04 22:25:41 1.1.2.3
+++ DTDGrammar.java 2000/05/05 20:53:10 1.1.2.4
@@ -84,7 +84,7 @@
* SAX2 DeclHandler callbacks.)
*
* @author Andy Clark
- * @version $Id: DTDGrammar.java,v 1.1.2.3 2000/05/04 22:25:41 andyc Exp $
+ * @version $Id: DTDGrammar.java,v 1.1.2.4 2000/05/05 20:53:10 andyc Exp $
*/
public class DTDGrammar
extends Grammar
@@ -422,7 +422,7 @@
* @exception java.lang.Exception
*/
public int addAttDef(QName elementDecl, QName attributeDecl,
- int attType, int enumeration,
+ int attType, boolean attList, int enumeration,
int attDefaultType, int attDefaultValue)
throws Exception {
@@ -447,8 +447,10 @@
// set attribute decl values
fAttributeDecl.clear();
fAttributeDecl.name.setValues(attributeDecl);
+ fAttributeDecl.type = attType;
+ fAttributeDecl.list = attList;
// REVISIT: Set the datatype validator
- // REVISIT: Don't forget attribute decl type, and enumeration
+ // REVISIT: Don't forget the enumeration
fAttributeDecl.defaultValue = fStringPool.toString(attDefaultValue);
int elementDeclIndex = getElementDeclIndex(elementDecl.localpart, -1);
@@ -458,7 +460,7 @@
if (fDTDEventHandler != null) {
int mapping = fDTDEventHandler.addAttDef(elementDecl,
attributeDecl,
- attType, enumeration,
+ attType, attList, enumeration,
attDefaultType,
attDefaultValue);
int chunk = attributeDeclIndex >> CHUNK_SHIFT;
1.1.2.2 +0 -133 xml-xerces/java/src/org/apache/xerces/validators/dtd/DTDImporter.java
Index: DTDImporter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/dtd/DTDImporter.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DTDImporter.java 2000/04/17 23:18:18 1.1.2.1
+++ DTDImporter.java 2000/05/05 20:53:10 1.1.2.2
@@ -163,19 +163,6 @@
fDeclsAreExternal = fStandaloneReader != -1 && readerId != fStandaloneReader;
}
- public boolean scanDoctypeDecl(boolean standalone) throws Exception {
- fStandaloneReader = standalone ? fEntityHandler.getReaderId() : -1;
- fDeclsAreExternal = false;
- if (!fDTDScanner.scanDoctypeDecl()) {
- return false;
- }
- if (fDTDScanner.getReadingExternalEntity()) {
- fDTDScanner.scanDecls(true);
- }
- fDTDHandler.endDTD();
- return true;
- }
-
//
// XMLDTDScanner.EventHandler interface
//
@@ -214,15 +201,6 @@
// public int scanDefaultAttValue(int elementType, int attrName, int attType, int enumeration) throws Exception;
// public void internalSubset(int internalSubset) throws Exception;
//
- public boolean validVersionNum(String version) {
- return XMLCharacterProperties.validVersionNum(version);
- }
- public boolean validEncName(String encoding) {
- return XMLCharacterProperties.validEncName(encoding);
- }
- public int validPublicId(String publicId) {
- return XMLCharacterProperties.validPublicId(publicId);
- }
public void callTextDecl(int version, int encoding) throws Exception {
fDTDHandler.textDecl(version, encoding);
}
@@ -231,14 +209,6 @@
fValidator.setRootElementType(rootElement);
fDTDHandler.startDTD(rootElement, publicId, systemId);
}
- public void startReadingFromExternalSubset(int publicId, int systemId) throws Exception {
- fEntityHandler.startReadingFromExternalSubset(fStringPool.toString(publicId),
- fStringPool.toString(systemId),
- fDTDScanner.markupDepth());
- }
- public void stopReadingFromExternalSubset() throws Exception {
- fEntityHandler.stopReadingFromExternalSubset();
- }
/** Adds an element declaration. */
public int addElementDecl(QName elementDecl) throws Exception {
@@ -378,109 +348,6 @@
fDTDHandler.processingInstruction(target, data);
}
- public void scanElementType(XMLEntityHandler.EntityReader entityReader,
- char fastchar, QName element) throws Exception {
-
- if (!fNamespacesEnabled) {
- element.clear();
- element.localpart = entityReader.scanName(fastchar);
- element.rawname = element.localpart;
- return;
- }
- entityReader.scanQName(fastchar, element);
- if (entityReader.lookingAtChar(':', false)) {
- fErrorReporter.reportError(fErrorReporter.getLocator(),
- XMLMessages.XML_DOMAIN,
- XMLMessages.MSG_TWO_COLONS_IN_QNAME,
- XMLMessages.P5_INVALID_CHARACTER,
- null,
- XMLErrorReporter.ERRORTYPE_FATAL_ERROR);
- entityReader.skipPastNmtoken(' ');
- }
-
- } // scanElementType(XMLEntityHandler.EntityReader,char,QName)
-
- public void checkForElementTypeWithPEReference(XMLEntityHandler.EntityReader entityReader,
- char fastchar, QName element) throws Exception {
-
- if (!fNamespacesEnabled) {
- element.clear();
- element.localpart = entityReader.scanName(fastchar);
- element.rawname = element.localpart;
- return;
- }
- entityReader.scanQName(fastchar, element);
- if (entityReader.lookingAtChar(':', false)) {
- fErrorReporter.reportError(fErrorReporter.getLocator(),
- XMLMessages.XML_DOMAIN,
- XMLMessages.MSG_TWO_COLONS_IN_QNAME,
- XMLMessages.P5_INVALID_CHARACTER,
- null,
- XMLErrorReporter.ERRORTYPE_FATAL_ERROR);
- entityReader.skipPastNmtoken(' ');
- }
-
- } // checkForElementTypeWithPEReference(XMLEntityHandler.EntityReader,char,QName)
-
- public void checkForAttributeNameWithPEReference(XMLEntityHandler.EntityReader entityReader,
- char fastchar, QName attribute) throws Exception {
-
- if (!fNamespacesEnabled) {
- attribute.clear();
- attribute.localpart = entityReader.scanName(fastchar);
- attribute.rawname = attribute.localpart;
- return;
- }
-
- entityReader.scanQName(fastchar, attribute);
- if (entityReader.lookingAtChar(':', false)) {
- fErrorReporter.reportError(fErrorReporter.getLocator(),
- XMLMessages.XML_DOMAIN,
- XMLMessages.MSG_TWO_COLONS_IN_QNAME,
- XMLMessages.P5_INVALID_CHARACTER,
- null,
- XMLErrorReporter.ERRORTYPE_FATAL_ERROR);
- entityReader.skipPastNmtoken(' ');
- }
-
- } // checkForAttributeNameWithPEReference(XMLEntityHandler.EntityReader,char,QName)
-
- public int checkForNameWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) throws Exception {
- //
- // REVISIT - what does this have to do with PE references?
- //
- int valueIndex = entityReader.scanName(fastcheck);
- return valueIndex;
- }
- public int checkForNmtokenWithPEReference(XMLEntityHandler.EntityReader entityReader, char fastcheck) throws Exception {
- //
- // REVISIT - what does this have to do with PE references?
- //
- int nameOffset = entityReader.currentOffset();
- entityReader.skipPastNmtoken(fastcheck);
- int nameLength = entityReader.currentOffset() - nameOffset;
- if (nameLength == 0)
- return -1;
- int valueIndex = entityReader.addSymbol(nameOffset, nameLength);
- return valueIndex;
- }
- public int scanDefaultAttValue(QName element, QName attribute,
- int attType, int enumeration) throws Exception {
- if (fValidating && attType == fIDSymbol) {
- reportRecoverableXMLError(XMLMessages.MSG_ID_DEFAULT_TYPE_INVALID,
- XMLMessages.VC_ID_ATTRIBUTE_DEFAULT,
- attribute.rawname);
- }
- int defaultAttValue = fDTDScanner.scanDefaultAttValue(element, attribute);
- if (defaultAttValue == -1)
- return -1;
- if (attType != fCDATASymbol) {
- // REVISIT: Validation. Should we pass in the element or is this
- // default attribute value normalization?
- defaultAttValue = fValidator.normalizeAttValue(null, attribute, defaultAttValue, attType, enumeration);
- }
- return defaultAttValue;
- }
public void internalSubset(int internalSubset) throws Exception {
fDTDHandler.internalSubset(internalSubset);
}