You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2002/01/29 21:44:03 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni XMLDTDHandler.java
neilg 02/01/29 12:44:03
Modified: java/src/org/apache/xerces/impl XMLDTDScannerImpl.java
XMLScanner.java
java/src/org/apache/xerces/impl/dtd DTDGrammar.java
XMLDTDValidator.java
java/src/org/apache/xerces/parsers AbstractDOMParser.java
AbstractSAXParser.java
AbstractXMLDocumentParser.java
java/src/org/apache/xerces/xni XMLDTDHandler.java
Log:
last of the pre-gold XNI changes. replaced publicId, systemId and baseSystemId on various XMLDTDHandler calls with XMLResourceIdentifier. This should also fix some bugs in the SAX DTDHandler as well.
Revision Changes Path
1.18 +8 -6 xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java
Index: XMLDTDScannerImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XMLDTDScannerImpl.java 28 Jan 2002 19:33:34 -0000 1.17
+++ XMLDTDScannerImpl.java 29 Jan 2002 20:44:02 -0000 1.18
@@ -103,7 +103,7 @@
* @author Glenn Marcy, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDTDScannerImpl.java,v 1.17 2002/01/28 19:33:34 lehors Exp $
+ * @version $Id: XMLDTDScannerImpl.java,v 1.18 2002/01/29 20:44:02 neilg Exp $
*/
public class XMLDTDScannerImpl
extends XMLScanner
@@ -1445,6 +1445,7 @@
}
if (systemId != null) {
String baseSystemId = fEntityScanner.getBaseSystemId();
+ String expandedSystemId = XMLEntityManager.expandSystemId(systemId, baseSystemId);
if (notation != null) {
fEntityManager.addUnparsedEntity(name, publicId, systemId, baseSystemId, notation);
}
@@ -1453,13 +1454,13 @@
baseSystemId);
}
if (fDTDHandler != null) {
+ fResourceIdentifier.setValues(publicId, systemId, baseSystemId, XMLEntityManager.expandSystemId(systemId, baseSystemId));
if (notation != null) {
- fDTDHandler.unparsedEntityDecl(name, publicId, systemId,
- baseSystemId, notation, null);
+ fDTDHandler.unparsedEntityDecl(name, fResourceIdentifier,
+ notation, null);
}
else {
- fDTDHandler.externalEntityDecl(name, publicId, systemId,
- baseSystemId, null);
+ fDTDHandler.externalEntityDecl(name, fResourceIdentifier, null);
}
}
}
@@ -1645,7 +1646,8 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, publicId, systemId, baseSystemId, null);
+ fResourceIdentifier.setValues(publicId, systemId, baseSystemId, XMLEntityManager.expandSystemId(systemId, baseSystemId));
+ fDTDHandler.notationDecl(name, fResourceIdentifier, null);
}
fReportEntity = true;
1.12 +6 -1 xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java
Index: XMLScanner.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLScanner.java 29 Jan 2002 01:15:09 -0000 1.11
+++ XMLScanner.java 29 Jan 2002 20:44:02 -0000 1.12
@@ -65,6 +65,7 @@
import org.apache.xerces.impl.msg.XMLMessageFormatter;
import org.apache.xerces.util.SymbolTable;
import org.apache.xerces.util.XMLStringBuffer;
+import org.apache.xerces.util.XMLResourceIdentifierImpl;
import org.apache.xerces.util.XMLChar;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLResourceIdentifier;
@@ -95,7 +96,7 @@
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLScanner.java,v 1.11 2002/01/29 01:15:09 lehors Exp $
+ * @version $Id: XMLScanner.java,v 1.12 2002/01/29 20:44:02 neilg Exp $
*/
public abstract class XMLScanner
implements XMLComponent {
@@ -222,6 +223,9 @@
/** String buffer. */
private XMLStringBuffer fStringBuffer3 = new XMLStringBuffer();
+ // temporary location for Resource identification information.
+ protected XMLResourceIdentifierImpl fResourceIdentifier = new XMLResourceIdentifierImpl();
+
//
// XMLComponent methods
//
@@ -248,6 +252,7 @@
// initialize vars
fEntityDepth = 0;
fReportEntity = true;
+ fResourceIdentifier.clear();
// save built-in entity names
fVersionSymbol = fSymbolTable.addSymbol("version");
1.11 +23 -30 xml-xerces/java/src/org/apache/xerces/impl/dtd/DTDGrammar.java
Index: DTDGrammar.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/DTDGrammar.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DTDGrammar.java 29 Jan 2002 13:52:15 -0000 1.10
+++ DTDGrammar.java 29 Jan 2002 20:44:02 -0000 1.11
@@ -95,7 +95,7 @@
* @author Jeffrey Rodriguez, IBM
* @author Andy Clark, IBM
*
- * @version $Id: DTDGrammar.java,v 1.10 2002/01/29 13:52:15 neeraj Exp $
+ * @version $Id: DTDGrammar.java,v 1.11 2002/01/29 20:44:02 neilg Exp $
*/
public class DTDGrammar
extends AbstractDTDGrammar
@@ -652,26 +652,23 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier An object containing all location information
+ * pertinent to this external entity declaration.
* @param augs Additional information that may include infoset
* augmentations.
* @throws XNIException Thrown by handler to signal an error.
*/
public void externalEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
XMLEntityDecl entityDecl = new XMLEntityDecl();
boolean isPE = name.startsWith("%");
boolean inExternal = fReadingExternalDTD;
- entityDecl.setValues(name, publicId, systemId, baseSystemId,
- null, null, isPE, inExternal);
+ entityDecl.setValues(name, identifier.getPublicId(), identifier.getLiteralSystemId(),
+ identifier.getBaseSystemId(),
+ null, null, isPE, inExternal);
int entityIndex = getEntityDeclIndex(name);
if (entityIndex == -1) {
@@ -679,65 +676,61 @@
setEntityDecl(entityIndex, entityDecl);
}
- } // externalEntityDecl(String,String,String)
+ } // externalEntityDecl(String, XMLResourceIdentifier, Augmentations)
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId the URI of the entity that referred to this one.
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param notation The name of the notation.
* @param augs Additional information that may include infoset
* augmentations.
* @throws XNIException Thrown by handler to signal an error.
*/
- public void unparsedEntityDecl(String name, String publicId,
- String systemId, String baseSystemId, String notation,
+ public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
+ String notation,
Augmentations augs) throws XNIException {
XMLEntityDecl entityDecl = new XMLEntityDecl();
boolean isPE = name.startsWith("%");
boolean inExternal = fReadingExternalDTD;
- entityDecl.setValues(name,publicId,systemId, baseSystemId, notation,
- null, isPE, inExternal);
+ entityDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
+ identifier.getBaseSystemId(), notation,
+ null, isPE, inExternal);
int entityIndex = getEntityDeclIndex(name);
if (entityIndex == -1) {
entityIndex = createEntityDecl();
setEntityDecl(entityIndex, entityDecl);
}
- } // unparsedEntityDecl(String,String,String,String)
+ } // unparsedEntityDecl(String,StringXMLResourceIdentifier,Augmentations)
/**
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId the URI of the entity that referred to this one.
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId,
- String baseSystemId, Augmentations augs) throws XNIException {
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs) throws XNIException {
XMLNotationDecl notationDecl = new XMLNotationDecl();
- notationDecl.setValues(name,publicId,systemId, baseSystemId);
+ notationDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
+ identifier.getBaseSystemId());
int notationIndex = getNotationDeclIndex(name);
if (notationIndex == -1) {
notationIndex = createNotationDecl();
setNotationDecl(notationIndex, notationDecl);
}
- } // notationDecl(String,String,String)
+ } // notationDecl(String,XMLResourceIdentifier,Augmentations)
/**
* The end of the DTD.
1.17 +21 -34 xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java
Index: XMLDTDValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- XMLDTDValidator.java 29 Jan 2002 13:52:15 -0000 1.16
+++ XMLDTDValidator.java 29 Jan 2002 20:44:02 -0000 1.17
@@ -123,7 +123,7 @@
* @author Andy Clark, IBM
* @author Jeffrey Rodriguez IBM
*
- * @version $Id: XMLDTDValidator.java,v 1.16 2002/01/29 13:52:15 neeraj Exp $
+ * @version $Id: XMLDTDValidator.java,v 1.17 2002/01/29 20:44:02 neilg Exp $
*/
public class XMLDTDValidator
implements XMLComponent,
@@ -1620,48 +1620,38 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this external entity.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId,
+ public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.externalEntityDecl(name, publicId, systemId, baseSystemId, augs);
+ fDTDGrammar.externalEntityDecl(name, identifier, augs);
if (fDTDHandler != null) {
- fDTDHandler.externalEntityDecl(name, publicId, systemId,
- baseSystemId, augs);
+ fDTDHandler.externalEntityDecl(name, identifier, augs);
}
- } // externalEntityDecl(String,String,String,String)
+ } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param notation The name of the notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void unparsedEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId, String notation,
+ public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
+ String notation,
Augmentations augs) throws XNIException {
// VC: Notation declared, in the production of NDataDecl
@@ -1670,37 +1660,34 @@
}
// call handlers
- fDTDGrammar.unparsedEntityDecl(name, publicId, systemId, baseSystemId, notation, augs);
+ fDTDGrammar.unparsedEntityDecl(name, identifier, notation, augs);
if (fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(name, publicId, systemId, baseSystemId, notation, augs);
+ fDTDHandler.unparsedEntityDecl(name, identifier, notation, augs);
}
- } // unparsedEntityDecl(String,String,String,String,String,Augmentations)
+ } // unparsedEntityDecl(String,XMLResourceIdentifier,String,Augmentations)
/**
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId,
- String baseSystemId, Augmentations augs) throws XNIException {
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.notationDecl(name, publicId, systemId, baseSystemId, augs);
+ fDTDGrammar.notationDecl(name, identifier, augs);
if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, publicId, systemId, baseSystemId, augs);
+ fDTDHandler.notationDecl(name, identifier, augs);
}
- } // notationDecl(String,String,String, String, Augmentations)
+ } // notationDecl(String,XMLResourceIdentifier, Augmentations)
/**
* The start of a conditional section.
1.37 +34 -40 xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
Index: AbstractDOMParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- AbstractDOMParser.java 29 Jan 2002 01:15:17 -0000 1.36
+++ AbstractDOMParser.java 29 Jan 2002 20:44:02 -0000 1.37
@@ -105,7 +105,7 @@
* @author Andy Clark, IBM
* @author Elena Litani, IBM
*
- * @version $Id: AbstractDOMParser.java,v 1.36 2002/01/29 01:15:17 lehors Exp $
+ * @version $Id: AbstractDOMParser.java,v 1.37 2002/01/29 20:44:02 neilg Exp $
*/
public abstract class AbstractDOMParser
extends AbstractXMLDocumentParser {
@@ -1259,22 +1259,19 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId,
+ public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
// internal subset string
+ String publicId = identifier.getPublicId();
+ String literalSystemId = identifier.getLiteralSystemId();
if (fInternalSubset != null && !fInDTDExternalSubset) {
fInternalSubset.append("<!ENTITY ");
if (name.startsWith("%")) {
@@ -1293,7 +1290,7 @@
else {
fInternalSubset.append("SYSTEM '");
}
- fInternalSubset.append(systemId);
+ fInternalSubset.append(literalSystemId);
fInternalSubset.append("'>\n");
}
@@ -1311,7 +1308,7 @@
if (entity == null) {
entity = (EntityImpl)fDocumentImpl.createEntity(name);
entity.setPublicId(publicId);
- entity.setSystemId(systemId);
+ entity.setSystemId(literalSystemId);
entities.setNamedItem(entity);
}
}
@@ -1333,34 +1330,32 @@
}
if (!found) {
int entityIndex = fDeferredDocumentImpl.createDeferredEntity(
- name, publicId, systemId, null);
+ name, publicId, literalSystemId, null);
fDeferredDocumentImpl.appendChild(fDocumentTypeIndex, entityIndex);
}
}
- } // externalEntityDecl(String,String,String,String)
+ } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this one was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param notation The name of the notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void unparsedEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId, String notation, Augmentations augs)
+ public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
+ String notation, Augmentations augs)
throws XNIException {
// internal subset string
+ String publicId = identifier.getPublicId();
+ String literalSystemId = identifier.getLiteralSystemId();
if (fInternalSubset != null && !fInDTDExternalSubset) {
fInternalSubset.append("<!ENTITY ");
fInternalSubset.append(name);
@@ -1368,14 +1363,14 @@
if (publicId != null) {
fInternalSubset.append("PUBLIC '");
fInternalSubset.append(publicId);
- if (systemId != null) {
+ if (literalSystemId != null) {
fInternalSubset.append("' '");
- fInternalSubset.append(systemId);
+ fInternalSubset.append(literalSystemId);
}
}
else {
fInternalSubset.append("SYSTEM '");
- fInternalSubset.append(systemId);
+ fInternalSubset.append(literalSystemId);
}
fInternalSubset.append("' NDATA ");
fInternalSubset.append(notation);
@@ -1393,7 +1388,7 @@
if (entity == null) {
entity = (EntityImpl)fDocumentImpl.createEntity(name);
entity.setPublicId(publicId);
- entity.setSystemId(systemId);
+ entity.setSystemId(literalSystemId);
entity.setNotationName(notation);
entities.setNamedItem(entity);
}
@@ -1416,44 +1411,43 @@
}
if (!found) {
int entityIndex = fDeferredDocumentImpl.createDeferredEntity(
- name, publicId, systemId, notation);
+ name, publicId, literalSystemId, notation);
fDeferredDocumentImpl.appendChild(fDocumentTypeIndex, entityIndex);
}
}
- } // unparsedEntityDecl(String,String,String,String, String, Augmentations)
+ } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
/**
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId The base system identifier where this entity
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId,
- String baseSystemId, Augmentations augs) throws XNIException {
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs) throws XNIException {
// internal subset string
+ String publicId = identifier.getPublicId();
+ String literalSystemId = identifier.getLiteralSystemId();
if (fInternalSubset != null && !fInDTDExternalSubset) {
fInternalSubset.append("<!NOTATION ");
if (publicId != null) {
fInternalSubset.append("PUBLIC '");
fInternalSubset.append(publicId);
- if (systemId != null) {
+ if (literalSystemId != null) {
fInternalSubset.append("' '");
- fInternalSubset.append(systemId);
+ fInternalSubset.append(literalSystemId);
}
}
else {
fInternalSubset.append("SYSTEM '");
- fInternalSubset.append(systemId);
+ fInternalSubset.append(literalSystemId);
}
fInternalSubset.append("'>\n");
}
@@ -1468,7 +1462,7 @@
if (notations.getNamedItem(name) == null) {
NotationImpl notation = (NotationImpl)fDocumentImpl.createNotation(name);
notation.setPublicId(publicId);
- notation.setSystemId(systemId);
+ notation.setSystemId(literalSystemId);
notations.setNamedItem(notation);
}
}
@@ -1490,12 +1484,12 @@
}
if (!found) {
int notationIndex = fDeferredDocumentImpl.createDeferredNotation(
- name, publicId, systemId);
+ name, publicId, literalSystemId);
fDeferredDocumentImpl.appendChild(fDocumentTypeIndex, notationIndex);
}
}
- } // notationDecl(String,String,String, String, Augmentations)
+ } // notationDecl(String,XMLResourceIdentifier, Augmentations)
/**
* An element declaration.
1.21 +24 -29 xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java
Index: AbstractSAXParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- AbstractSAXParser.java 29 Jan 2002 01:15:17 -0000 1.20
+++ AbstractSAXParser.java 29 Jan 2002 20:44:02 -0000 1.21
@@ -112,7 +112,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractSAXParser.java,v 1.20 2002/01/29 01:15:17 lehors Exp $
+ * @version $Id: AbstractSAXParser.java,v 1.21 2002/01/29 20:44:02 neilg Exp $
*/
public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
@@ -964,41 +964,36 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The baseSystem identifier of the entity.
- *
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name, String publicId,
- String systemId, String baseSystemId,
+ public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
+ String publicId = identifier.getPublicId();
+ String literalSystemId = identifier.getLiteralSystemId();
try {
// SAX2 extension
if (fDeclHandler != null) {
- fDeclHandler.externalEntityDecl(name, publicId, systemId);
+ fDeclHandler.externalEntityDecl(name, publicId, literalSystemId);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
- } // externalEntityDecl(String,String,String,String)
+ } // externalEntityDecl(String,,XMLResourceIdentifier, Augmentations)
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this one was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param notation The name of the notation.
*
* @param augs Additional information that may include infoset
@@ -1006,52 +1001,52 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void unparsedEntityDecl(String name, String publicId,
- String systemId, String baseSyseemId, String notation,
+ public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
+ String notation,
Augmentations augs) throws XNIException {
+ String publicId = identifier.getPublicId();
+ String expandedSystemId = identifier.getExpandedSystemId();
try {
// SAX2 extension
if (fDTDHandler != null) {
fDTDHandler.unparsedEntityDecl(name, publicId,
- systemId, notation);
+ expandedSystemId, notation);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
- } // unparsedEntityDecl(String,String,String,String)
+ } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
/**
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId The baseSystem identifier of the entity.
- *
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId,
- String baseSystemId, Augmentations augs) throws XNIException {
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs) throws XNIException {
+ String publicId = identifier.getPublicId();
+ String expandedSystemId = identifier.getExpandedSystemId();
try {
// SAX1 and SAX2
if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, publicId, systemId);
+ fDTDHandler.notationDecl(name, publicId, expandedSystemId);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
- } // notationDecl(String,String,String, String, Augmentations)
+ } // notationDecl(String,XMLResourceIdentifier, Augmentations)
/**
* The end of the DTD.
1.11 +46 -47 xml-xerces/java/src/org/apache/xerces/parsers/AbstractXMLDocumentParser.java
Index: AbstractXMLDocumentParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractXMLDocumentParser.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AbstractXMLDocumentParser.java 29 Jan 2002 01:15:17 -0000 1.10
+++ AbstractXMLDocumentParser.java 29 Jan 2002 20:44:03 -0000 1.11
@@ -84,7 +84,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractXMLDocumentParser.java,v 1.10 2002/01/29 01:15:17 lehors Exp $
+ * @version $Id: AbstractXMLDocumentParser.java,v 1.11 2002/01/29 20:44:03 neilg Exp $
*/
public abstract class AbstractXMLDocumentParser
extends XMLParser
@@ -337,9 +337,9 @@
* @exception XNIException
* Thrown by handler to signal an error.
*/
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException{
- }
-
+ public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
+ } // textDecl(String, String, Augmentations)
+
/**
* This method notifies the end of an entity.
* <p>
@@ -365,8 +365,8 @@
* @exception XNIException
* Thrown by application to signal an error.
*/
- public void comment(XMLString text, Augmentations augs) throws XNIException{
- }
+ public void comment(XMLString text, Augmentations augs) throws XNIException {
+ } // comment (XMLString, Augmentations)
/**
* A processing instruction. Processing instructions consist of a
@@ -387,9 +387,8 @@
* Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException{
- }
-
+ throws XNIException {
+ } // processingInstruction(String, XMLString, Augmentations)
//
// XMLDTDHandler methods
@@ -486,7 +485,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {}
+ public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
+ } // ignoredCharacters(XMLString, Augmentations)
/**
* An element declaration.
@@ -585,59 +585,48 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId, Augmentations augs) throws XNIException {
- } // externalEntityDecl(String,String,String,String)
+ public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs) throws XNIException {
+ } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this one was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this entity.
* @param notation The name of the notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void unparsedEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId, String notation, Augmentations augs) throws XNIException {
- } // unparsedEntityDecl(String,String,String,String, String, Augmentations)
+ public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
+ String notation, Augmentations augs) throws XNIException {
+ } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
/**
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId URI of the entity by which this one was referenced
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId,
- String systemId, String baseSystemId, Augmentations augs)
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
+ Augmentations augs)
throws XNIException {
- } // notationDecl(String,String,String, String, Augmentations)
+ } // notationDecl(String,XMLResourceIdentifier, Augmentations)
/**
* The start of a conditional section.
@@ -652,7 +641,7 @@
* @see #CONDITIONAL_INCLUDE
* @see #CONDITIONAL_IGNORE
*/
- public void startConditional(short type, Augmentations augs) throws XNIException {
+ public void startConditional(short type, Augmentations augs) throws XNIException {
} // startConditional(short)
/**
@@ -693,7 +682,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startContentModel(String elementName, Augmentations augs) throws XNIException {}
+ public void startContentModel(String elementName, Augmentations augs) throws XNIException {
+ } // startContentModel(String, Augmentations)
/**
* A content model of ANY.
@@ -706,7 +696,8 @@
* @see #empty
* @see #startGroup
*/
- public void any(Augmentations augs) throws XNIException {}
+ public void any(Augmentations augs) throws XNIException {
+ } // any(Augmentations)
/**
* A content model of EMPTY.
@@ -719,7 +710,8 @@
* @see #any
* @see #startGroup
*/
- public void empty(Augmentations augs) throws XNIException {}
+ public void empty(Augmentations augs) throws XNIException {
+ } // empty(Augmentations)
/**
* A start of either a mixed or children content model. A mixed
@@ -735,7 +727,8 @@
* @see #any
* @see #empty
*/
- public void startGroup(Augmentations augs) throws XNIException {}
+ public void startGroup(Augmentations augs) throws XNIException {
+ } // stargGroup(Augmentations)
/**
* The appearance of "#PCDATA" within a group signifying a
@@ -749,7 +742,8 @@
*
* @see #startGroup
*/
- public void pcdata(Augmentations augs) throws XNIException {}
+ public void pcdata(Augmentations augs) throws XNIException {
+ } // pcdata(Augmentations)
/**
* A referenced element in a mixed or children content model.
@@ -760,7 +754,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void element(String elementName, Augmentations augs) throws XNIException {}
+ public void element(String elementName, Augmentations augs) throws XNIException {
+ } // element(String, Augmentations)
/**
* The separator between choices or sequences of a mixed or children
@@ -775,7 +770,8 @@
* @see #SEPARATOR_CHOICE
* @see #SEPARATOR_SEQUENCE
*/
- public void separator(short separator, Augmentations augs) throws XNIException {}
+ public void separator(short separator, Augmentations augs) throws XNIException {
+ } // separator(short, Augmentations)
/**
* The occurrence count for a child in a children content model or
@@ -792,7 +788,8 @@
* @see #OCCURS_ZERO_OR_MORE
* @see #OCCURS_ONE_OR_MORE
*/
- public void occurrence(short occurrence, Augmentations augs) throws XNIException {}
+ public void occurrence(short occurrence, Augmentations augs) throws XNIException {
+ } // occurence(short, Augmentations)
/**
* The end of a group for mixed or children content models.
@@ -802,7 +799,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endGroup(Augmentations augs) throws XNIException {}
+ public void endGroup(Augmentations augs) throws XNIException {
+ } // endGroup(Augmentations)
/**
* The end of a content model.
@@ -812,7 +810,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endContentModel(Augmentations augs) throws XNIException {}
+ public void endContentModel(Augmentations augs) throws XNIException {
+ } // endContentModel(Augmentations)
//
// Protected methods
1.9 +10 -24 xml-xerces/java/src/org/apache/xerces/xni/XMLDTDHandler.java
Index: XMLDTDHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/XMLDTDHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLDTDHandler.java 29 Jan 2002 01:15:19 -0000 1.8
+++ XMLDTDHandler.java 29 Jan 2002 20:44:03 -0000 1.9
@@ -67,7 +67,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLDTDHandler.java,v 1.8 2002/01/29 01:15:19 lehors Exp $
+ * @version $Id: XMLDTDHandler.java,v 1.9 2002/01/29 20:44:03 neilg Exp $
*/
public interface XMLDTDHandler {
@@ -311,19 +311,15 @@
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
- * @param publicId The public identifier of the entity or null if the
- * the entity was specified with SYSTEM.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this external entity.
* @param augmentations Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void externalEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
Augmentations augmentations)
throws XNIException;
@@ -331,12 +327,8 @@
* An unparsed entity declaration.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity, or null if not
- * specified.
- * @param systemId The system identifier of the entity, or null if not
- * specified.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this unparsed entity declaration.
* @param notation The name of the notation.
* @param augmentations Additional information that may include infoset
* augmentations.
@@ -344,8 +336,7 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String notation, Augmentations augmentations)
throws XNIException;
@@ -353,19 +344,14 @@
* A notation declaration
*
* @param name The name of the notation.
- * @param publicId The public identifier of the notation, or null if not
- * specified.
- * @param systemId The system identifier of the notation, or null if not
- * specified.
- * @param baseSystemId The base system identifier where this entity
- * is declared.
+ * @param identifier An object containing all location information
+ * pertinent to this notation.
* @param augmentations Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId,
- String baseSystemId,
+ public void notationDecl(String name, XMLResourceIdentifier identifier,
Augmentations augmentations) throws XNIException;
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org