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/22 17:42:29 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni XMLDTDContentModelHandler.java XMLDTDHandler.java XMLDocumentFragmentHandler.java XMLDocumentHandler.java
neilg 02/01/22 08:42:29
Modified: java/docs releases.xml
java/samples/ui DOMParserSaveEncoding.java
java/samples/xni DocumentTracer.java PSVIWriter.java
PassThroughFilter.java Writer.java
java/samples/xni/parser CSVConfiguration.java
java/src/org/apache/xerces/impl XMLDTDScannerImpl.java
XMLDocumentFragmentScannerImpl.java
XMLDocumentScannerImpl.java XMLEntityHandler.java
XMLEntityManager.java XMLNamespaceBinder.java
XMLScanner.java
java/src/org/apache/xerces/impl/dtd DTDGrammar.java
XMLDTDValidator.java
java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
java/src/org/apache/xerces/parsers AbstractDOMParser.java
AbstractSAXParser.java
AbstractXMLDocumentParser.java
java/src/org/apache/xerces/xni
XMLDTDContentModelHandler.java XMLDTDHandler.java
XMLDocumentFragmentHandler.java
XMLDocumentHandler.java
Added: java/src/org/apache/xerces/util
XMLResourceIdentifierImpl.java
Log:
committing some (slightly modified to take care of regressions) massive XNI changes on behalf of Andy Clark. These make use of XMLResourceIdentifier in start.*Entity calls, and add Augmentations to various DTD Handler callbacks. Things yet to do:
1. Make Augmentation callbacks consistent. They are null sometimes, not others; need to make them null by default.
2. Propagate XMLResourceIdentifier to remaining methods it could and is not being used in.
3. Tie XMLResourceIdentifier and XMLLocator together.
Revision Changes Path
1.98 +10 -1 xml-xerces/java/docs/releases.xml
Index: releases.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/releases.xml,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- releases.xml 12 Jan 2002 02:57:59 -0000 1.97
+++ releases.xml 22 Jan 2002 16:42:25 -0000 1.98
@@ -1,11 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?>
-<!-- $Id: releases.xml,v 1.97 2002/01/12 02:57:59 andyc Exp $ -->
+<!-- $Id: releases.xml,v 1.98 2002/01/22 16:42:25 neilg Exp $ -->
<!DOCTYPE releases SYSTEM 'dtd/releases.dtd'>
<releases>
<release version='NOT YET RELEASED'>
<desc>
</desc>
<changes>
+ <update>
+ <note>
+ Updated Xerces Native Interface to add augmentations to
+ document fragment handler, DTD handler, and the DTD content
+ model handler interfaces. Additional methods were also
+ renamed and/or modified.
+ </note>
+ <submitter name='Andy Clark'/>
+ </update>
<add>
<note>
Added ability to override default parser configuration.
1.4 +13 -9 xml-xerces/java/samples/ui/DOMParserSaveEncoding.java
Index: DOMParserSaveEncoding.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/ui/DOMParserSaveEncoding.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMParserSaveEncoding.java 23 Aug 2001 00:35:18 -0000 1.3
+++ DOMParserSaveEncoding.java 22 Jan 2002 16:42:25 -0000 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,14 +55,19 @@
* <http://www.apache.org/>.
*/
package ui;
+
+import org.apache.xerces.parsers.DOMParser;
+import org.apache.xerces.util.EncodingMap;
+import org.apache.xerces.xni.Augmentations;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+
import org.xml.sax.InputSource;
+
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.apache.xerces.util.EncodingMap;
-import org.apache.xerces.parsers.DOMParser;
-import org.apache.xerces.xni.XNIException;
/**
* The DOMParserSaveEncoding class extends DOMParser. It also provides
@@ -96,14 +101,13 @@
javaEncoding = "UTF8";
return(javaEncoding);
}
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs) throws XNIException {
if( encoding != null){
setMimeEncoding( encoding);
}
- super.startEntity(name, publicId, systemId, baseSystemId, encoding);
+ super.startGeneralEntity(name, identifier, encoding, augs);
}
}
1.9 +77 -107 xml-xerces/java/samples/xni/DocumentTracer.java
Index: DocumentTracer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/xni/DocumentTracer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DocumentTracer.java 7 Jan 2002 14:54:47 -0000 1.8
+++ DocumentTracer.java 22 Jan 2002 16:42:25 -0000 1.9
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2000,2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,7 @@
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLConfigurationException;
@@ -85,7 +86,7 @@
* @author Andy Clark, IBM
* @author Arnaud Le Hors, IBM
*
- * @version $Id: DocumentTracer.java,v 1.8 2002/01/07 14:54:47 elena Exp $
+ * @version $Id: DocumentTracer.java,v 1.9 2002/01/22 16:42:25 neilg Exp $
*/
public class DocumentTracer
extends XMLDocumentParser
@@ -407,25 +408,19 @@
} // endCDATA()
- /** Start entity. */
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding, Augmentations augs) throws XNIException {
+ /** Start entity. */
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
+ throws XNIException {
printIndent();
- fOut.print("startEntity(");
+ fOut.print("startGeneralEntity(");
fOut.print("name=");
printQuotedString(name);
fOut.print(',');
- fOut.print("publicId=");
- printQuotedString(publicId);
- fOut.print(',');
- fOut.print("systemId=");
- printQuotedString(systemId);
- fOut.print(',');
- fOut.print("baseSystemId=");
- printQuotedString(baseSystemId);
+ fOut.print("identifier=");
+ fOut.print(identifier);
fOut.print(',');
fOut.print("encoding=");
printQuotedString(encoding);
@@ -479,11 +474,11 @@
} // processingInstruction(String,XMLString)
/** End entity. */
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
fIndent--;
printIndent();
- fOut.print("endEntity(");
+ fOut.print("endGeneralEntity(");
fOut.print("name=");
printQuotedString(name);
fOut.println(')');
@@ -491,9 +486,6 @@
} // endEntity(String)
-
-
-
/** End document. */
public void endDocument(Augmentations augs) throws XNIException {
@@ -507,8 +499,9 @@
//
// XMLDTDHandler
//
+
/** Start DTD. */
- public void startDTD(XMLLocator locator) throws XNIException {
+ public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
printIndent();
fOut.print("startDTD(");
@@ -540,96 +533,66 @@
} // startDTD(XMLLocator)
-
-
- /** Characters.*/
- public void characters(XMLString text) throws XNIException {
+ /** Start external subset. */
+ public void startExternalSubset(Augmentations augs) throws XNIException {
printIndent();
- fOut.print("characters(");
- fOut.print("text=");
- printQuotedString(text.ch, text.offset, text.length);
- fOut.println(')');
- fOut.flush();
-
- } // characters(XMLString)
- /** Start entity. */
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
-
- printIndent();
- fOut.print("startEntity(");
- fOut.print("name=");
- printQuotedString(name);
- fOut.print(',');
- fOut.print("publicId=");
- printQuotedString(publicId);
- fOut.print(',');
- fOut.print("systemId=");
- printQuotedString(systemId);
- fOut.print(',');
- fOut.print("baseSystemId=");
- printQuotedString(baseSystemId);
- fOut.print(',');
- fOut.print("encoding=");
- printQuotedString(encoding);
- fOut.println(')');
+ fOut.println("startExternalSubset()");
fOut.flush();
fIndent++;
- } // startEntity(String,String,String,String)
+ } // startExternalSubset(Augmentations)
- /** Text declaration. */
- public void textDecl(String version, String encoding) throws XNIException {
+ /** End external subset. */
+ public void endExternalSubset(Augmentations augs) throws XNIException {
+ fIndent--;
printIndent();
- fOut.print("textDecl(");
- fOut.print("version=");
- printQuotedString(version);
- fOut.print(',');
- fOut.print("encoding=");
- printQuotedString(encoding);
- fOut.println(')');
+ fOut.println("endExternalSubset()");
fOut.flush();
- } // textDecl(String,String)
+ } // endExternalSubset(Augmentations)
- /** Comment. */
- public void comment(XMLString text) throws XNIException {
+ /** Characters.*/
+ public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
printIndent();
- fOut.print("comment(");
+ fOut.print("ignoredCharacters(");
fOut.print("text=");
printQuotedString(text.ch, text.offset, text.length);
fOut.println(')');
fOut.flush();
- } // comment(XMLText)
-
- /** Processing instruction. */
- public void processingInstruction(String target, XMLString data)
+ } // characters(XMLString)
+
+ /** Start entity. */
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
throws XNIException {
printIndent();
- fOut.print("processingInstruction(");
- fOut.print("target=");
- printQuotedString(target);
+ fOut.print("startParameterEntity(");
+ fOut.print("name=");
+ printQuotedString(name);
fOut.print(',');
- fOut.print("data=");
- printQuotedString(data.ch, data.offset, data.length);
+ fOut.print("identifier=");
+ fOut.print(identifier);
+ fOut.print(',');
+ fOut.print("encoding=");
+ printQuotedString(encoding);
fOut.println(')');
fOut.flush();
+ fIndent++;
- } // processingInstruction(String,XMLString)
+ } // startEntity(String,String,String,String)
/** End entity. */
- public void endEntity(String name) throws XNIException {
+ public void endParameterEntity(String name, Augmentations augs) throws XNIException {
fIndent--;
printIndent();
- fOut.print("endEntity(");
+ fOut.print("endParameterEntity(");
fOut.print("name=");
printQuotedString(name);
fOut.println(')');
@@ -637,8 +600,8 @@
} // endEntity(String)
- /** Element declaration. */
- public void elementDecl(String name, String contentModel)
+ /** Element declaration. */
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
printIndent();
@@ -654,7 +617,7 @@
} // elementDecl(String,String)
/** Start attribute list. */
- public void startAttlist(String elementName) throws XNIException {
+ public void startAttlist(String elementName, Augmentations augs) throws XNIException {
printIndent();
fOut.print("startAttlist(");
@@ -669,8 +632,8 @@
/** Attribute declaration. */
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
- throws XNIException {
+ String defaultType, XMLString defaultValue,
+ Augmentations augs) throws XNIException {
printIndent();
fOut.print("attributeDecl(");
@@ -715,7 +678,7 @@
} // attributeDecl(String,String,String,String[],String,XMLString)
/** End attribute list. */
- public void endAttlist() throws XNIException {
+ public void endAttlist(Augmentations augs) throws XNIException {
fIndent--;
printIndent();
@@ -726,7 +689,8 @@
/** Internal entity declaration. */
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
+ XMLString nonNormalizedText,
+ Augmentations augs)
throws XNIException {
printIndent();
@@ -748,7 +712,8 @@
/** External entity declaration. */
public void externalEntityDecl(String name,
String publicId, String systemId,
- String baseSystemId) throws XNIException {
+ String baseSystemId, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("externalEntityDecl(");
@@ -770,8 +735,8 @@
/** Unparsed entity declaration. */
public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notation)
- throws XNIException {
+ String systemId, String notation,
+ Augmentations augs) throws XNIException {
printIndent();
fOut.print("externalEntityDecl(");
@@ -792,8 +757,8 @@
} // unparsedEntityDecl(String,String,String,String)
/** Notation declaration. */
- public void notationDecl(String name, String publicId, String systemId)
- throws XNIException {
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augs) throws XNIException {
printIndent();
fOut.print("notationDecl(");
@@ -811,7 +776,8 @@
} // notationDecl(String,String,String)
/** Start conditional section. */
- public void startConditional(short type) throws XNIException {
+ public void startConditional(short type, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("startConditional(");
@@ -836,7 +802,7 @@
} // startConditional(short)
/** End conditional section. */
- public void endConditional() throws XNIException {
+ public void endConditional(Augmentations augs) throws XNIException {
fIndent--;
printIndent();
@@ -846,7 +812,7 @@
} // endConditional()
/** End DTD. */
- public void endDTD() throws XNIException {
+ public void endDTD(Augmentations augs) throws XNIException {
fIndent--;
printIndent();
@@ -860,7 +826,8 @@
//
/** Start content model. */
- public void startContentModel(String elementName) throws XNIException {
+ public void startContentModel(String elementName, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("startContentModel(");
@@ -873,7 +840,7 @@
} // startContentModel(String)
/** Any. */
- public void any() throws XNIException {
+ public void any(Augmentations augs) throws XNIException {
printIndent();
fOut.println("any()");
@@ -882,7 +849,7 @@
} // any()
/** Empty. */
- public void empty() throws XNIException {
+ public void empty(Augmentations augs) throws XNIException {
printIndent();
fOut.println("empty()");
@@ -891,7 +858,7 @@
} // empty()
/** Start group. */
- public void startGroup() throws XNIException {
+ public void startGroup(Augmentations augs) throws XNIException {
printIndent();
fOut.println("startGroup()");
@@ -901,7 +868,7 @@
} // childrenStartGroup()
/** #PCDATA. */
- public void pcdata() throws XNIException {
+ public void pcdata(Augmentations augs) throws XNIException {
printIndent();
fOut.println("pcdata()");
@@ -910,7 +877,8 @@
} // pcdata()
/** Element. */
- public void element(String elementName) throws XNIException {
+ public void element(String elementName, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("element(");
@@ -922,7 +890,8 @@
} // element(String)
/** separator. */
- public void separator(short separator) throws XNIException {
+ public void separator(short separator, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("separator(");
@@ -946,7 +915,8 @@
} // separator(short)
/** Occurrence. */
- public void occurrence(short occurrence) throws XNIException {
+ public void occurrence(short occurrence, Augmentations augs)
+ throws XNIException {
printIndent();
fOut.print("occurrence(");
@@ -974,7 +944,7 @@
} // occurrence(short)
/** End group. */
- public void endGroup() throws XNIException {
+ public void endGroup(Augmentations augs) throws XNIException {
fIndent--;
printIndent();
@@ -984,7 +954,7 @@
} // childrenEndGroup()
/** End content model. */
- public void endContentModel() throws XNIException {
+ public void endContentModel(Augmentations augs) throws XNIException {
fIndent--;
printIndent();
1.4 +13 -17 xml-xerces/java/samples/xni/PSVIWriter.java
Index: PSVIWriter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/xni/PSVIWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PSVIWriter.java 17 Dec 2001 17:50:21 -0000 1.3
+++ PSVIWriter.java 22 Jan 2002 16:42:25 -0000 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation.
+ * Copyright (c) 1999-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -57,8 +57,6 @@
package xni;
-
-
import org.apache.xerces.impl.Constants;
import org.apache.xerces.impl.XMLNamespaceBinder;
@@ -78,15 +76,15 @@
import org.apache.xml.serialize.Printer;
import org.apache.xml.serialize.LineSeparator;
-
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLString;
-import org.apache.xerces.xni.XMLLocator;
-import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.NamespaceContext;
+import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.XMLDocumentHandler;
+import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XMLString;
+import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.psvi.ItemPSVI;
import org.apache.xerces.xni.psvi.ElementPSVI;
@@ -108,7 +106,7 @@
* XML infoset and Post Schema Validation Infoset.
*
* @author Arun Yadav,Sun Miscrosystem.
- * @version $Id: PSVIWriter.java,v 1.3 2001/12/17 17:50:21 elena Exp $
+ * @version $Id: PSVIWriter.java,v 1.4 2002/01/22 16:42:25 neilg Exp $
*/
public class PSVIWriter
implements XMLComponent, XMLDocumentFilter {
@@ -344,14 +342,12 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
String encoding, Augmentations augs)
throws XNIException {
if (fDocumentHandler != null) {
- fDocumentHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding, augs);
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
}
} // startEntity(String,String,String,String,String)
@@ -759,9 +755,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
if (fDocumentHandler != null) {
- fDocumentHandler.endEntity(name, augs);
+ fDocumentHandler.endGeneralEntity(name, augs);
}
} // endEntity(String)
1.4 +13 -13 xml-xerces/java/samples/xni/PassThroughFilter.java
Index: PassThroughFilter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/xni/PassThroughFilter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PassThroughFilter.java 26 Nov 2001 21:45:50 -0000 1.3
+++ PassThroughFilter.java 22 Jan 2002 16:42:25 -0000 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,7 @@
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLDocumentHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
@@ -77,7 +78,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: PassThroughFilter.java,v 1.3 2001/11/26 21:45:50 elena Exp $
+ * @version $Id: PassThroughFilter.java,v 1.4 2002/01/22 16:42:25 neilg Exp $
*/
public class PassThroughFilter
implements XMLDocumentHandler {
@@ -298,15 +299,14 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId,
- String systemId, String baseSystemId,
- String encoding, Augmentations augs) throws XNIException {
- if (fDocumentHandler != null) {
- fDocumentHandler.startEntity(name, publicId,
- systemId, baseSystemId,
- encoding, augs);
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
+ throws XNIException {
+ if (fDocumentHandler != null) {
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
}
- } // startEntity(String,String,String,String,String)
+ } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
@@ -341,11 +341,11 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
if (fDocumentHandler != null) {
- fDocumentHandler.endEntity(name, augs);
+ fDocumentHandler.endGeneralEntity(name, augs);
}
- } // endEntity(String)
+ } // endGeneralEntity(String,Augmentations)
/**
* Character content.
1.8 +2 -2 xml-xerces/java/samples/xni/Writer.java
Index: Writer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/xni/Writer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Writer.java 9 Jan 2002 19:22:38 -0000 1.7
+++ Writer.java 22 Jan 2002 16:42:25 -0000 1.8
@@ -84,7 +84,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: Writer.java,v 1.7 2002/01/09 19:22:38 andyc Exp $
+ * @version $Id: Writer.java,v 1.8 2002/01/22 16:42:25 neilg Exp $
*/
public class Writer
extends XMLDocumentParser
@@ -290,7 +290,7 @@
fOut.print('\n');
}
fOut.print("<!--");
- normalizeAndPrint(text);
+ fOut.print(text.toString());
fOut.print("-->");
if (!fSeenRootElement) {
fOut.print('\n');
1.4 +38 -41 xml-xerces/java/samples/xni/parser/CSVConfiguration.java
Index: CSVConfiguration.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/xni/parser/CSVConfiguration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CSVConfiguration.java 26 Nov 2001 21:45:50 -0000 1.3
+++ CSVConfiguration.java 22 Jan 2002 16:42:25 -0000 1.4
@@ -104,7 +104,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: CSVConfiguration.java,v 1.3 2001/11/26 21:45:50 elena Exp $
+ * @version $Id: CSVConfiguration.java,v 1.4 2002/01/22 16:42:25 neilg Exp $
*/
public class CSVConfiguration
extends AbstractConfiguration {
@@ -125,9 +125,6 @@
/** An empty list of attributes. */
protected static final XMLAttributes EMPTY_ATTRS = new XMLAttributesImpl();
- /** An empty list of augmentations. */
- protected final Augmentations fAugmentations = new AugmentationsImpl();
-
/** A newline XMLString. */
private final XMLString NEWLINE = new XMLStringBuffer("\n");
@@ -189,73 +186,73 @@
// start document
if (fDocumentHandler != null) {
- fDocumentHandler.startDocument(null, "UTF-8", fAugmentations);
- fDocumentHandler.xmlDecl("1.0", "UTF-8", "true", fAugmentations);
- fDocumentHandler.doctypeDecl("csv", null, null, fAugmentations);
+ fDocumentHandler.startDocument(null, "UTF-8", null);
+ fDocumentHandler.xmlDecl("1.0", "UTF-8", "true", null);
+ fDocumentHandler.doctypeDecl("csv", null, null, null);
}
if (fDTDHandler != null) {
- fDTDHandler.startDTD(null);
- fDTDHandler.elementDecl("csv", "(row)*");
- fDTDHandler.elementDecl("row", "(col)*");
- fDTDHandler.elementDecl("col", "(#PCDATA)");
+ fDTDHandler.startDTD(null, null);
+ fDTDHandler.elementDecl("csv", "(row)*", null);
+ fDTDHandler.elementDecl("row", "(col)*", null);
+ fDTDHandler.elementDecl("col", "(#PCDATA)", null);
}
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel("csv");
- fDTDContentModelHandler.startGroup();
- fDTDContentModelHandler.element("row");
- fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.startContentModel("csv", null);
+ fDTDContentModelHandler.startGroup(null);
+ fDTDContentModelHandler.element("row", null);
+ fDTDContentModelHandler.endGroup(null);
short csvOccurs = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- fDTDContentModelHandler.occurrence(csvOccurs);
- fDTDContentModelHandler.endContentModel();
+ fDTDContentModelHandler.occurrence(csvOccurs, null);
+ fDTDContentModelHandler.endContentModel(null);
- fDTDContentModelHandler.startContentModel("row");
- fDTDContentModelHandler.startGroup();
- fDTDContentModelHandler.element("col");
- fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.startContentModel("row", null);
+ fDTDContentModelHandler.startGroup(null);
+ fDTDContentModelHandler.element("col", null);
+ fDTDContentModelHandler.endGroup(null);
short rowOccurs = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- fDTDContentModelHandler.occurrence(rowOccurs);
- fDTDContentModelHandler.endContentModel();
+ fDTDContentModelHandler.occurrence(rowOccurs, null);
+ fDTDContentModelHandler.endContentModel(null);
- fDTDContentModelHandler.startContentModel("col");
- fDTDContentModelHandler.startGroup();
- fDTDContentModelHandler.pcdata();
- fDTDContentModelHandler.endGroup();
- fDTDContentModelHandler.endContentModel();
+ fDTDContentModelHandler.startContentModel("col", null);
+ fDTDContentModelHandler.startGroup(null);
+ fDTDContentModelHandler.pcdata(null);
+ fDTDContentModelHandler.endGroup(null);
+ fDTDContentModelHandler.endContentModel(null);
}
if (fDTDHandler != null) {
- fDTDHandler.endDTD();
+ fDTDHandler.endDTD(null);
}
if (fDocumentHandler != null) {
- fDocumentHandler.startElement(CSV, EMPTY_ATTRS, fAugmentations);
+ fDocumentHandler.startElement(CSV, EMPTY_ATTRS, null);
}
// read lines
String line;
while ((line = bufferedReader.readLine()) != null) {
if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(NEWLINE_ONE_SPACE, fAugmentations);
- fDocumentHandler.startElement(ROW, EMPTY_ATTRS, fAugmentations);
+ fDocumentHandler.ignorableWhitespace(NEWLINE_ONE_SPACE, null);
+ fDocumentHandler.startElement(ROW, EMPTY_ATTRS, null);
StringTokenizer tokenizer = new StringTokenizer(line, ",");
while (tokenizer.hasMoreTokens()) {
- fDocumentHandler.ignorableWhitespace(NEWLINE_TWO_SPACES, fAugmentations);
- fDocumentHandler.startElement(COL, EMPTY_ATTRS, fAugmentations);
+ fDocumentHandler.ignorableWhitespace(NEWLINE_TWO_SPACES, null);
+ fDocumentHandler.startElement(COL, EMPTY_ATTRS, null);
String token = tokenizer.nextToken();
fStringBuffer.clear();
fStringBuffer.append(token);
- fDocumentHandler.characters(fStringBuffer, fAugmentations);
- fDocumentHandler.endElement(COL, fAugmentations);
+ fDocumentHandler.characters(fStringBuffer, null);
+ fDocumentHandler.endElement(COL, null);
}
- fDocumentHandler.ignorableWhitespace(NEWLINE_ONE_SPACE, fAugmentations);
- fDocumentHandler.endElement(ROW, fAugmentations);
+ fDocumentHandler.ignorableWhitespace(NEWLINE_ONE_SPACE, null);
+ fDocumentHandler.endElement(ROW, null);
}
}
bufferedReader.close();
// end document
if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(NEWLINE, fAugmentations);
- fDocumentHandler.endElement(CSV, fAugmentations);
- fDocumentHandler.endDocument(fAugmentations);
+ fDocumentHandler.ignorableWhitespace(NEWLINE, null);
+ fDocumentHandler.endElement(CSV, null);
+ fDocumentHandler.endDocument(null);
}
} // parse(XMLInputSource)
1.13 +71 -60 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XMLDTDScannerImpl.java 2 Jan 2002 20:35:14 -0000 1.12
+++ XMLDTDScannerImpl.java 22 Jan 2002 16:42:25 -0000 1.13
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation.
+ * Copyright (c) 1999-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,7 @@
import org.apache.xerces.impl.XMLErrorReporter;
import org.apache.xerces.impl.msg.XMLMessageFormatter;
+import org.apache.xerces.util.AugmentationsImpl;
import org.apache.xerces.util.XMLAttributesImpl;
import org.apache.xerces.util.XMLChar;
import org.apache.xerces.util.XMLStringBuffer;
@@ -72,6 +73,7 @@
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLDTDHandler;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
@@ -102,7 +104,7 @@
* @author Glenn Marcy, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDTDScannerImpl.java,v 1.12 2002/01/02 20:35:14 elena Exp $
+ * @version $Id: XMLDTDScannerImpl.java,v 1.13 2002/01/22 16:42:25 neilg Exp $
*/
public class XMLDTDScannerImpl
extends XMLScanner
@@ -333,7 +335,7 @@
if (fScannerState == SCANNER_STATE_TEXT_DECL) {
// call handler
if (fDTDHandler != null) {
- fDTDHandler.startDTD(fEntityScanner);
+ fDTDHandler.startDTD(fEntityScanner, null);
fStartDTDCalled = true;
}
// set starting state for internal subset
@@ -344,7 +346,7 @@
if (!scanDecls(complete)) {
// call handler
if (fDTDHandler != null && hasExternalSubset == false) {
- fDTDHandler.endDTD();
+ fDTDHandler.endDTD(null);
}
// we're done, set starting state for external subset
setScannerState(SCANNER_STATE_TEXT_DECL);
@@ -447,17 +449,18 @@
* @param encoding
*/
public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String encoding) throws XNIException {
- super.startEntity(name, publicId, systemId, baseSystemId, encoding);
+ super.startEntity(name, identifier, encoding);
- if (name.equals("[dtd]")) {
+ boolean dtdEntity = name.equals("[dtd]");
+ if (dtdEntity) {
// call handler
- if (fDTDHandler != null && fStartDTDCalled == false) {
- fDTDHandler.startDTD(fEntityScanner);
+ if (fDTDHandler != null && !fStartDTDCalled ) {
+ fDTDHandler.startDTD(fEntityScanner, null);
}
+ fDTDHandler.startExternalSubset(null);
fExtEntityDepth++;
}
else if (name.charAt(0) == '%') {
@@ -468,19 +471,19 @@
}
// call handler
- if (fDTDHandler != null && fReportEntity) {
- fDTDHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding);
+ if (fDTDHandler != null && !dtdEntity && fReportEntity) {
+ fDTDHandler.startParameterEntity(name, identifier, encoding, null);
}
- } // startEntity(String,String,String,String,String)
+ } // startEntity(String,XMLResourceIdentifier,String)
/**
* endEntity
*
* @param name
*/
- public void endEntity(String name) throws XNIException {
+ public void endEntity(String name)
+ throws XNIException {
super.endEntity(name);
@@ -508,19 +511,21 @@
}
// call handler
- if (fDTDHandler != null && reportEntity) {
- fDTDHandler.endEntity(name);
+ boolean dtdEntity = name.equals("[dtd]");
+ if (fDTDHandler != null && !dtdEntity && reportEntity) {
+ fDTDHandler.endParameterEntity(name, null);
}
// end DTD
- if (name.equals("[dtd]")) {
+ if (dtdEntity) {
if (fIncludeSectDepth != 0) {
reportFatalError("IncludeSectUnterminated", null);
}
fScannerState = SCANNER_STATE_END_OF_INPUT;
// call handler
if (fDTDHandler != null) {
- fDTDHandler.endDTD();
+ fDTDHandler.endExternalSubset(null);
+ fDTDHandler.endDTD(null);
}
fExtEntityDepth--;
}
@@ -641,7 +646,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.textDecl(version, encoding);
+ fDTDHandler.textDecl(version, encoding, null);
}
}
}
@@ -666,7 +671,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data);
+ fDTDHandler.processingInstruction(target, data, null);
}
} // scanPIData(String)
@@ -687,7 +692,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.comment(fStringBuffer);
+ fDTDHandler.comment(fStringBuffer, null);
}
} // scanComment()
@@ -726,7 +731,7 @@
// content model
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name);
+ fDTDContentModelHandler.startContentModel(name, null);
}
String contentModel = null;
fReportEntity = true;
@@ -734,14 +739,14 @@
contentModel = "EMPTY";
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.empty();
+ fDTDContentModelHandler.empty(null);
}
}
else if (fEntityScanner.skipString("ANY")) {
contentModel = "ANY";
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.any();
+ fDTDContentModelHandler.any(null);
}
}
else {
@@ -750,7 +755,7 @@
new Object[]{name});
}
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup();
+ fDTDContentModelHandler.startGroup(null);
}
fStringBuffer.clear();
fStringBuffer.append('(');
@@ -769,7 +774,7 @@
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endContentModel();
+ fDTDContentModelHandler.endContentModel(null);
}
fReportEntity = false;
@@ -783,7 +788,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel);
+ fDTDHandler.elementDecl(name, contentModel, null);
}
} // scanElementDecl()
@@ -809,14 +814,15 @@
fStringBuffer.append("#PCDATA");
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.pcdata();
+ fDTDContentModelHandler.pcdata(null);
}
skipSeparator(false, !scanningInternalSubset());
while (fEntityScanner.skipChar('|')) {
fStringBuffer.append('|');
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE);
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE,
+ null);
}
skipSeparator(false, !scanningInternalSubset());
@@ -828,7 +834,7 @@
fStringBuffer.append(childName);
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(childName);
+ fDTDContentModelHandler.element(childName, null);
}
skipSeparator(false, !scanningInternalSubset());
}
@@ -840,8 +846,9 @@
fStringBuffer.append(")*");
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup();
- fDTDContentModelHandler.occurrence(XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE);
+ fDTDContentModelHandler.endGroup(null);
+ fDTDContentModelHandler.occurrence(XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE,
+ null);
}
}
else if (childName != null) {
@@ -852,7 +859,7 @@
fStringBuffer.append(')');
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.endGroup(null);
}
}
else {
@@ -891,7 +898,7 @@
fStringBuffer.append('(');
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup();
+ fDTDContentModelHandler.startGroup(null);
}
// push current op on stack and reset it
pushContentStack(currentOp);
@@ -908,7 +915,7 @@
}
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(childName);
+ fDTDContentModelHandler.element(childName, null);
}
fStringBuffer.append(childName);
c = fEntityScanner.peekChar();
@@ -925,7 +932,7 @@
else {
oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
}
- fDTDContentModelHandler.occurrence(oc);
+ fDTDContentModelHandler.occurrence(oc, null);
}
fEntityScanner.scanChar();
fStringBuffer.append((char)c);
@@ -937,7 +944,8 @@
currentOp = c;
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_SEQUENCE);
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_SEQUENCE,
+ null);
}
fEntityScanner.scanChar();
fStringBuffer.append(',');
@@ -947,7 +955,8 @@
currentOp = c;
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE);
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE,
+ null);
}
fEntityScanner.scanChar();
fStringBuffer.append('|');
@@ -959,7 +968,7 @@
}
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.endGroup(null);
}
// restore previous op
currentOp = popContentStack();
@@ -974,7 +983,7 @@
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE;
- fDTDContentModelHandler.occurrence(oc);
+ fDTDContentModelHandler.occurrence(oc, null);
}
}
else if (fEntityScanner.skipString(")+")) {
@@ -982,7 +991,7 @@
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
- fDTDContentModelHandler.occurrence(oc);
+ fDTDContentModelHandler.occurrence(oc, null);
}
}
else if (fEntityScanner.skipString(")*")) {
@@ -990,7 +999,7 @@
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- fDTDContentModelHandler.occurrence(oc);
+ fDTDContentModelHandler.occurrence(oc, null);
}
}
else {
@@ -1035,7 +1044,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elName);
+ fDTDHandler.startAttlist(elName, null);
}
// spaces
@@ -1045,7 +1054,7 @@
// yes, stop here
// call handler
if (fDTDHandler != null) {
- fDTDHandler.endAttlist();
+ fDTDHandler.endAttlist(null);
}
fMarkUpDepth--;
return;
@@ -1096,12 +1105,12 @@
// REVISIT: should probably check whether fLiteral.ch is null instead. LM.
if (defaultType!=null && (defaultType.equals("#REQUIRED") ||
defaultType.equals("#IMPLIED"))) {
- fDTDHandler.attributeDecl(elName, name, type, enum,
- defaultType, null);
+ fDTDHandler.attributeDecl(elName, name, type, enum,
+ defaultType, null, null);
}
else {
- fDTDHandler.attributeDecl(elName, name, type, enum,
- defaultType, fLiteral);
+ fDTDHandler.attributeDecl(elName, name, type, enum,
+ defaultType, fLiteral, null);
}
}
skipSeparator(false, !scanningInternalSubset());
@@ -1109,7 +1118,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.endAttlist();
+ fDTDHandler.endAttlist(null);
}
fMarkUpDepth--;
fReportEntity = true;
@@ -1437,19 +1446,20 @@
}
if (fDTDHandler != null) {
if (notation != null) {
- fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation);
+ fDTDHandler.unparsedEntityDecl(name, publicId, systemId,
+ notation, null);
}
else {
String baseSystemId = fEntityScanner.getBaseSystemId();
fDTDHandler.externalEntityDecl(name, publicId, systemId,
- baseSystemId);
+ baseSystemId, null);
}
}
}
else {
fEntityManager.addInternalEntity(name, fLiteral.toString());
if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(name, fLiteral, fLiteral2);
+ fDTDHandler.internalEntityDecl(name, fLiteral, fLiteral2, null);
}
}
fReportEntity = true;
@@ -1627,7 +1637,7 @@
// call handler
if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, publicId, systemId);
+ fDTDHandler.notationDecl(name, publicId, systemId, null);
}
fReportEntity = true;
@@ -1663,8 +1673,8 @@
}
if (fDTDHandler != null) {
- fDTDHandler.startConditional(
- XMLDTDHandler.CONDITIONAL_INCLUDE);
+ fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_INCLUDE,
+ null);
}
fIncludeSectDepth++;
// just stop there and go back to the main loop
@@ -1674,7 +1684,8 @@
skipSeparator(false, !scanningInternalSubset());
// call handler
if (fDTDHandler != null) {
- fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_IGNORE);
+ fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_IGNORE,
+ null);
}
if (!fEntityScanner.skipChar('[')) {
reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
@@ -1730,8 +1741,8 @@
if (fDTDHandler != null) {
fLiteral.setValues(fIgnoreConditionalBuffer.ch, 0,
fIgnoreConditionalBuffer.length - 2);
- fDTDHandler.characters(fLiteral);
- fDTDHandler.endConditional();
+ fDTDHandler.ignoredCharacters(fLiteral, null);
+ fDTDHandler.endConditional(null);
}
return;
} else if(fDTDHandler != null) {
@@ -1826,7 +1837,7 @@
}
// call handler
if (fDTDHandler != null) {
- fDTDHandler.endConditional();
+ fDTDHandler.endConditional(null);
}
// decreaseMarkupDepth();
fIncludeSectDepth--;
1.6 +17 -24 xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentFragmentScannerImpl.java
Index: XMLDocumentFragmentScannerImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentFragmentScannerImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLDocumentFragmentScannerImpl.java 14 Dec 2001 20:50:45 -0000 1.5
+++ XMLDocumentFragmentScannerImpl.java 22 Jan 2002 16:42:25 -0000 1.6
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation.
+ * Copyright (c) 1999-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -76,6 +76,7 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLDocumentHandler;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
@@ -108,7 +109,7 @@
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDocumentFragmentScannerImpl.java,v 1.5 2001/12/14 20:50:45 lmartin Exp $
+ * @version $Id: XMLDocumentFragmentScannerImpl.java,v 1.6 2002/01/22 16:42:25 neilg Exp $
*/
public class XMLDocumentFragmentScannerImpl
extends XMLScanner
@@ -500,12 +501,7 @@
* general entities are just specified by their name.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
@@ -515,8 +511,7 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String encoding) throws XNIException {
// keep track of this entity before fEntityDepth is increased
@@ -527,17 +522,16 @@
}
fEntityStack[fEntityDepth] = fMarkupDepth;
- super.startEntity(name, publicId, systemId, baseSystemId, encoding);
+ super.startEntity(name, identifier, encoding);
// call handler
- if (fDocumentHandler != null) {
- if (!name.equals("[xml]") && !fScanningAttribute) {
- fDocumentHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding, fAugmentations);
+ if (fDocumentHandler != null && !fScanningAttribute) {
+ if (!name.equals("[xml]")) {
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, fAugmentations);
}
}
- } // startEntity(String,String,String,String,String)
+ } // startEntity(String,XMLResourceIdentifier,String)
/**
* This method notifies the end of an entity. The DTD has the pseudo-name
@@ -558,9 +552,9 @@
}
// call handler
- if (fDocumentHandler != null) {
- if (!name.equals("[xml]") && !fScanningAttribute) {
- fDocumentHandler.endEntity(name, fAugmentations);
+ if (fDocumentHandler != null && !fScanningAttribute) {
+ if (!name.equals("[xml]")) {
+ fDocumentHandler.endGeneralEntity(name, fAugmentations);
}
}
@@ -1002,12 +996,11 @@
// call handler
if (fDocumentHandler != null) {
if (fNotifyCharRefs) {
- fDocumentHandler.startEntity(fCharRefLiteral, null,
- null, null, null, fAugmentations);
+ fDocumentHandler.startGeneralEntity(fCharRefLiteral, null, null, fAugmentations);
}
fDocumentHandler.characters(fStringBuffer2, fAugmentations);
if (fNotifyCharRefs) {
- fDocumentHandler.endEntity(fCharRefLiteral, fAugmentations);
+ fDocumentHandler.endGeneralEntity(fCharRefLiteral, fAugmentations);
}
}
}
@@ -1083,7 +1076,7 @@
private void handleCharacter(char c, String entity) throws XNIException {
if (fDocumentHandler != null) {
if (fNotifyBuiltInRefs) {
- fDocumentHandler.startEntity(entity, null, null, null, null, fAugmentations);
+ fDocumentHandler.startGeneralEntity(entity, null, null, fAugmentations);
}
fSingleChar[0] = c;
@@ -1091,7 +1084,7 @@
fDocumentHandler.characters(fString, fAugmentations);
if (fNotifyBuiltInRefs) {
- fDocumentHandler.endEntity(entity, fAugmentations);
+ fDocumentHandler.endGeneralEntity(entity, fAugmentations);
}
}
} // handleCharacter(char)
1.10 +9 -13 xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java
Index: XMLDocumentScannerImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XMLDocumentScannerImpl.java 17 Dec 2001 16:41:12 -0000 1.9
+++ XMLDocumentScannerImpl.java 22 Jan 2002 16:42:26 -0000 1.10
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation.
+ * Copyright (c) 1999-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -74,6 +74,7 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLDocumentHandler;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
@@ -108,7 +109,7 @@
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDocumentScannerImpl.java,v 1.9 2001/12/17 16:41:12 neilg Exp $
+ * @version $Id: XMLDocumentScannerImpl.java,v 1.10 2002/01/22 16:42:26 neilg Exp $
*/
public class XMLDocumentScannerImpl
extends XMLDocumentFragmentScannerImpl {
@@ -406,11 +407,10 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String encoding) throws XNIException {
- super.startEntity(name, publicId, systemId, baseSystemId, encoding);
+ super.startEntity(name, identifier, encoding);
// prepare to look for a TextDecl if external general entity
if (!name.equals("[xml]") && fEntityScanner.isExternal()) {
@@ -418,10 +418,8 @@
}
// call handler
- if (fDocumentHandler != null) {
- if (name.equals("[xml]")) {
- fDocumentHandler.startDocument(fEntityScanner, encoding, fAugmentations);
- }
+ if (fDocumentHandler != null && name.equals("[xml]")) {
+ fDocumentHandler.startDocument(fEntityScanner, encoding, fAugmentations);
}
} // startEntity(String,String,String,String,String)
@@ -440,10 +438,8 @@
super.endEntity(name);
// call handler
- if (fDocumentHandler != null) {
- if (name.equals("[xml]")) {
- fDocumentHandler.endDocument(fAugmentations);
- }
+ if (fDocumentHandler != null && name.equals("[xml]")) {
+ fDocumentHandler.endDocument(fAugmentations);
}
} // endEntity(String)
1.4 +4 -9 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityHandler.java
Index: XMLEntityHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLEntityHandler.java 26 Nov 2001 21:45:50 -0000 1.3
+++ XMLEntityHandler.java 22 Jan 2002 16:42:26 -0000 1.4
@@ -57,6 +57,7 @@
package org.apache.xerces.impl;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XNIException;
/**
@@ -68,7 +69,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLEntityHandler.java,v 1.3 2001/11/26 21:45:50 elena Exp $
+ * @version $Id: XMLEntityHandler.java,v 1.4 2002/01/22 16:42:26 neilg Exp $
*/
public interface XMLEntityHandler {
@@ -82,12 +83,7 @@
* general entities are just specified by their name.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
@@ -97,8 +93,7 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String encoding) throws XNIException;
/**
1.18 +26 -28 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XMLEntityManager.java 16 Jan 2002 15:26:02 -0000 1.17
+++ XMLEntityManager.java 22 Jan 2002 16:42:26 -0000 1.18
@@ -79,6 +79,7 @@
import org.apache.xerces.util.SymbolTable;
import org.apache.xerces.util.URI;
import org.apache.xerces.util.XMLChar;
+import org.apache.xerces.util.XMLResourceIdentifierImpl;
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLString;
@@ -113,7 +114,7 @@
* @author Andy Clark, IBM
* @author Arnaud Le Hors, IBM
*
- * @version $Id: XMLEntityManager.java,v 1.17 2002/01/16 15:26:02 sandygao Exp $
+ * @version $Id: XMLEntityManager.java,v 1.18 2002/01/22 16:42:26 neilg Exp $
*/
public class XMLEntityManager
implements XMLComponent, XMLEntityResolver {
@@ -282,6 +283,11 @@
/** Shared declared entities. */
protected Hashtable fDeclaredEntities;
+ // temp vars
+
+ /** Resource identifer. */
+ private final XMLResourceIdentifierImpl fResourceIdentifier = new XMLResourceIdentifierImpl();
+
//
// Constructors
//
@@ -550,13 +556,9 @@
Entity entity = (Entity)fEntities.get(entityName);
if (entity == null) {
if (fEntityHandler != null) {
- final String publicId = null;
- final String systemId = null;
- final String baseSystemId = null;
- final String encoding = null;
- fEntityHandler.startEntity(entityName,
- publicId, systemId,
- baseSystemId, encoding);
+ String encoding = null;
+ fResourceIdentifier.clear();
+ fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding);
fEntityHandler.endEntity(entityName);
}
return;
@@ -571,19 +573,17 @@
if (unparsed || (general && !fExternalGeneralEntities) ||
(parameter && !fExternalParameterEntities)) {
if (fEntityHandler != null) {
- String publicId = null;
- String systemId = null;
- String baseSystemId = null;
+ fResourceIdentifier.clear();
final String encoding = null;
if (external) {
ExternalEntity externalEntity = (ExternalEntity)entity;
- publicId = externalEntity.publicId;
- systemId = externalEntity.systemId;
- baseSystemId = expandSystemId(systemId, externalEntity.baseSystemId);
+ String expandedSystemId = expandSystemId(externalEntity.systemId, externalEntity.baseSystemId);
+ fResourceIdentifier.setValues(externalEntity.publicId,
+ externalEntity.systemId,
+ externalEntity.baseSystemId,
+ expandedSystemId);
}
- fEntityHandler.startEntity(entityName,
- publicId, systemId,
- baseSystemId, encoding);
+ fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding);
fEntityHandler.endEntity(entityName);
}
return;
@@ -609,19 +609,17 @@
new Object[] { entityName, path },
XMLErrorReporter.SEVERITY_FATAL_ERROR);
if (fEntityHandler != null) {
- String publicId = null;
- String systemId = null;
- String baseSystemId = null;
+ fResourceIdentifier.clear();
final String encoding = null;
if (external) {
ExternalEntity externalEntity = (ExternalEntity)entity;
- publicId = externalEntity.publicId;
- systemId = externalEntity.systemId;
- baseSystemId = expandSystemId(systemId, externalEntity.baseSystemId);
+ String expandedSystemId = expandSystemId(externalEntity.systemId, externalEntity.baseSystemId);
+ fResourceIdentifier.setValues(externalEntity.publicId,
+ externalEntity.systemId,
+ externalEntity.baseSystemId,
+ expandedSystemId);
}
- fEntityHandler.startEntity(entityName,
- publicId, systemId,
- baseSystemId, encoding);
+ fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding);
fEntityHandler.endEntity(entityName);
}
return;
@@ -805,8 +803,8 @@
// call handler
if (fEntityHandler != null) {
- fEntityHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding);
+ fResourceIdentifier.setValues(publicId, systemId, baseSystemId, expandedSystemId);
+ fEntityHandler.startEntity(name, fResourceIdentifier, encoding);
}
} // startEntity(String,XMLInputSource)
1.12 +10 -11 xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java
Index: XMLNamespaceBinder.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLNamespaceBinder.java 26 Nov 2001 21:45:50 -0000 1.11
+++ XMLNamespaceBinder.java 22 Jan 2002 16:42:26 -0000 1.12
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2000,2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -71,6 +71,7 @@
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLDocumentHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
@@ -94,7 +95,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLNamespaceBinder.java,v 1.11 2001/11/26 21:45:50 elena Exp $
+ * @version $Id: XMLNamespaceBinder.java,v 1.12 2002/01/22 16:42:26 neilg Exp $
*/
public class XMLNamespaceBinder
implements XMLComponent, XMLDocumentFilter {
@@ -396,14 +397,12 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException {
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
+ throws XNIException {
if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding, augs);
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
}
} // startEntity(String,String,String,String,String)
@@ -715,9 +714,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.endEntity(name, augs);
+ fDocumentHandler.endGeneralEntity(name, augs);
}
} // endEntity(String)
1.9 +5 -10 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLScanner.java 26 Nov 2001 21:45:50 -0000 1.8
+++ XMLScanner.java 22 Jan 2002 16:42:26 -0000 1.9
@@ -67,6 +67,7 @@
import org.apache.xerces.util.XMLStringBuffer;
import org.apache.xerces.util.XMLChar;
import org.apache.xerces.xni.XMLAttributes;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
@@ -94,7 +95,7 @@
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLScanner.java,v 1.8 2001/11/26 21:45:50 elena Exp $
+ * @version $Id: XMLScanner.java,v 1.9 2002/01/22 16:42:26 neilg Exp $
*/
public abstract class XMLScanner
implements XMLComponent {
@@ -1050,12 +1051,7 @@
* specified by their name.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
@@ -1065,14 +1061,13 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
+ XMLResourceIdentifier identifier,
String encoding) throws XNIException {
// keep track of the entity depth
fEntityDepth++;
- } // startEntity(String,String,String,String,String)
+ } // startEntity(String,XMLResourceIdentifier,String)
/**
* This method notifies the end of an entity. The document entity has
1.6 +67 -61 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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DTDGrammar.java 17 Jan 2002 17:59:32 -0000 1.5
+++ DTDGrammar.java 22 Jan 2002 16:42:26 -0000 1.6
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000,2001 The Apache Software Foundation.
+ * Copyright (c) 1999-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,10 +75,12 @@
import org.apache.xerces.impl.dv.dtd.DatatypeValidatorFactoryImpl;
import org.apache.xerces.util.SymbolTable;
+import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
@@ -94,7 +96,7 @@
* @author Jeffrey Rodriguez, IBM
* @author Andy Clark, IBM
*
- * @version $Id: DTDGrammar.java,v 1.5 2002/01/17 17:59:32 neilg Exp $
+ * @version $Id: DTDGrammar.java,v 1.6 2002/01/22 16:42:26 neilg Exp $
*/
public class DTDGrammar
extends AbstractDTDGrammar
@@ -293,7 +295,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startDTD(XMLLocator locator) throws XNIException {
+ public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
//Initialize stack
fOpStack = null;
fNodeIndexStack = null;
@@ -323,28 +325,26 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
-
- if (name.startsWith("%")) {
- // keep track of this entity before fEntityDepth is increased
- if (fPEDepth == fPEntityStack.length) {
- boolean[] entityarray = new boolean[fPEntityStack.length * 2];
- System.arraycopy(fPEntityStack, 0, entityarray, 0, fPEntityStack.length);
- fPEntityStack = entityarray;
- }
- fPEntityStack[fPEDepth] = fReadingExternalDTD;
- fPEDepth++;
- }
-
- if ( name.equals("[dtd]") ||
- (name.startsWith("%") && systemId != null )) {
- fReadingExternalDTD = true;
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
+
+ // keep track of this entity before fEntityDepth is increased
+ if (fPEDepth == fPEntityStack.length) {
+ boolean[] entityarray = new boolean[fPEntityStack.length * 2];
+ System.arraycopy(fPEntityStack, 0, entityarray, 0, fPEntityStack.length);
+ fPEntityStack = entityarray;
}
+ fPEntityStack[fPEDepth] = fReadingExternalDTD;
+ fPEDepth++;
+
+ } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
- } // startEntity(String,String,String,String)
+ /** Start external subset. */
+ public void startExternalSubset(Augmentations augs) throws XNIException {
+ fReadingExternalDTD = true;
+ } // startExternalSubset(Augmentations)
/**
* This method notifies the end of an entity. The DTD has the pseudo-name
@@ -359,17 +359,17 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException {
+ public void endParameterEntity(String name, Augmentations augs) throws XNIException {
- if (name.equals("[dtd]")) {
- fReadingExternalDTD = false;
- }
- if (name.startsWith("%")) {
- fPEDepth--;
- fReadingExternalDTD = fPEntityStack[fPEDepth];
- }
+ fPEDepth--;
+ fReadingExternalDTD = fPEntityStack[fPEDepth];
+
+ } // endParameterEntity(String,Augmentations)
- } // endEntity(String)
+ /** End external subset. */
+ public void endExternalSubset(Augmentations augs) throws XNIException {
+ fReadingExternalDTD = false;
+ } // endExternalSubset(Augmentations)
/**
* An element declaration.
@@ -379,7 +379,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
XMLElementDecl tmpElementDecl = (XMLElementDecl) fElementDeclTab.get(name) ;
@@ -480,8 +480,8 @@
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
- throws XNIException {
+ String defaultType, XMLString defaultValue,
+ Augmentations augs) throws XNIException {
if ( this.fElementDeclTab.containsKey( (String) elementName) ) {
//if ElementDecl has already being created in the Grammar then remove from table,
@@ -607,8 +607,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
- throws XNIException {
+ XMLString nonNormalizedText,
+ Augmentations augs) throws XNIException {
XMLEntityDecl entityDecl = new XMLEntityDecl();
boolean isPE = name.startsWith("%");
@@ -640,7 +640,8 @@
*/
public void externalEntityDecl(String name,
String publicId, String systemId,
- String baseSystemId) throws XNIException {
+ String baseSystemId,
+ Augmentations augs) throws XNIException {
XMLEntityDecl entityDecl = new XMLEntityDecl();
boolean isPE = name.startsWith("%");
@@ -670,8 +671,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notation)
- throws XNIException {
+ String systemId, String notation,
+ Augmentations augs) throws XNIException {
XMLEntityDecl entityDecl = new XMLEntityDecl();
boolean isPE = name.startsWith("%");
@@ -698,8 +699,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId)
- throws XNIException {
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augs) throws XNIException {
XMLNotationDecl notationDecl = new XMLNotationDecl();
notationDecl.setValues(name,publicId,systemId);
@@ -716,7 +717,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException {
+ public void endDTD(Augmentations augs) throws XNIException {
// REVISIT: What is this for? -Ac
/*
@@ -755,7 +756,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void textDecl(String version, String encoding) throws XNIException {}
+ public void textDecl(String version, String encoding, Augmentations augs)
+ throws XNIException {}
/**
* A comment.
@@ -764,7 +766,7 @@
*
* @throws XNIException Thrown by application to signal an error.
*/
- public void comment(XMLString text) throws XNIException {}
+ public void comment(XMLString text, Augmentations augs) throws XNIException {}
/**
* A processing instruction. Processing instructions consist of a
@@ -782,7 +784,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void processingInstruction(String target, XMLString data) throws XNIException {}
+ public void processingInstruction(String target, XMLString data,
+ Augmentations augs) throws XNIException {}
/**
* The start of an attribute list.
@@ -792,14 +795,15 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName) throws XNIException {}
+ public void startAttlist(String elementName, Augmentations augs)
+ throws XNIException {}
/**
* The end of an attribute list.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endAttlist() throws XNIException {}
+ public void endAttlist(Augmentations augs) throws XNIException {}
/**
* The start of a conditional section.
@@ -812,21 +816,23 @@
* @see XMLDTDHandler#CONDITIONAL_INCLUDE
* @see XMLDTDHandler#CONDITIONAL_IGNORE
*/
- public void startConditional(short type) throws XNIException {}
+ public void startConditional(short type, Augmentations augs)
+ throws XNIException {}
/**
* Characters within an IGNORE conditional section.
*
* @param text The ignored text.
*/
- public void characters(XMLString text) throws XNIException {}
+ public void ignoredCharacters(XMLString text, Augmentations augs)
+ throws XNIException {}
/**
* The end of a conditional section.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endConditional() throws XNIException {}
+ public void endConditional(Augmentations augs) throws XNIException {}
//
// XMLDTDContentModelHandler methods
@@ -841,7 +847,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startContentModel(String elementName)
+ public void startContentModel(String elementName, Augmentations augs)
throws XNIException {
XMLElementDecl elementDecl = (XMLElementDecl) this.fElementDeclTab.get( elementName);
@@ -864,7 +870,7 @@
* @see #any
* @see #empty
*/
- public void startGroup() throws XNIException {
+ public void startGroup(Augmentations augs) throws XNIException {
fDepth++;
initializeContentModelStack();
fMixed = false;
@@ -879,7 +885,7 @@
*
* @see #startGroup
*/
- public void pcdata() throws XNIException {
+ public void pcdata(Augmentations augs) throws XNIException {
fMixed = true;
} // pcdata()
@@ -890,7 +896,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void element(String elementName) throws XNIException {
+ public void element(String elementName, Augmentations augs) throws XNIException {
if (fMixed) {
if (fNodeIndexStack[fDepth] == -1 ) {
fNodeIndexStack[fDepth] = addUniqueLeafNode(elementName);
@@ -917,7 +923,7 @@
* @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_CHOICE
* @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_SEQUENCE
*/
- public void separator(short separator) throws XNIException {
+ public void separator(short separator, Augmentations augs) throws XNIException {
if (!fMixed) {
if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_SEQ && separator == XMLDTDContentModelHandler.SEPARATOR_CHOICE ) {
@@ -950,7 +956,7 @@
* @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ZERO_OR_MORE
* @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ONE_OR_MORE
*/
- public void occurrence(short occurrence) throws XNIException {
+ public void occurrence(short occurrence, Augmentations augs) throws XNIException {
if (!fMixed) {
if (occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE ) {
@@ -969,7 +975,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endGroup() throws XNIException {
+ public void endGroup(Augmentations augs) throws XNIException {
if (!fMixed) {
if (fPrevNodeIndexStack[fDepth] != -1) {
@@ -991,7 +997,7 @@
* @see #empty
* @see #startGroup
*/
- public void any() throws XNIException {}
+ public void any(Augmentations augs) throws XNIException {}
/**
* A content model of EMPTY.
@@ -1001,14 +1007,14 @@
* @see #any
* @see #startGroup
*/
- public void empty() throws XNIException {}
+ public void empty(Augmentations augs) throws XNIException {}
/**
* The end of a content model.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endContentModel() throws XNIException {}
+ public void endContentModel(Augmentations augs) throws XNIException {}
//
// Grammar methods
1.10 +155 -215 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.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XMLDTDValidator.java 18 Jan 2002 00:06:32 -0000 1.9
+++ XMLDTDValidator.java 22 Jan 2002 16:42:26 -0000 1.10
@@ -86,6 +86,7 @@
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
import org.apache.xerces.xni.parser.XMLComponentManager;
@@ -123,7 +124,7 @@
* @author Andy Clark, IBM
* @author Jeffrey Rodriguez IBM
*
- * @version $Id: XMLDTDValidator.java,v 1.9 2002/01/18 00:06:32 neilg Exp $
+ * @version $Id: XMLDTDValidator.java,v 1.10 2002/01/22 16:42:26 neilg Exp $
*/
public class XMLDTDValidator
implements XMLComponent,
@@ -264,6 +265,9 @@
/** Skip validation. */
private boolean fSkipValidation;
+ /** True if in DTD. */
+ protected boolean fInDTD;
+
/** True if in an ignore conditional section of the DTD. */
protected boolean fInDTDIgnore;
@@ -519,6 +523,7 @@
fSeenDoctypeDecl = false;
fInCDATASection = false;
// initialize state
+ fInDTD = false;
fInDTDIgnore = false;
fStandaloneIsYes = false;
fSeenRootElement = false;
@@ -979,38 +984,32 @@
// XMLDocumentHandler and XMLDTDHandler methods
//
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entity names are just the entity name.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- *
- * @param augs Additional information that may include infoset augmentations
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException {
+ /** Start external subset. */
+ public void startExternalSubset(Augmentations augs) throws XNIException {
+ fDTDGrammar.startExternalSubset(augs);
+ }
+ /** End external subset. */
+ public void endExternalSubset(Augmentations augs) throws XNIException {
+ fDTDGrammar.startExternalSubset(augs);
+ }
+
+ /** Start general entity. */
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
+ checkStandaloneEntityRef(name);
+ if (fDocumentHandler != null) {
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
+ }
+ }
+
+ /** Check standalone entity reference. */
+ protected void checkStandaloneEntityRef(String name) throws XNIException {
// check VC: Standalone Document Declartion, entities references appear in the document.
if (fPerformValidation && fDTDGrammar != null) {
- if (fStandaloneIsYes && !name.startsWith("[")) {
+ if (fStandaloneIsYes) {
int entIndex = fDTDGrammar.getEntityDeclIndex(name);
if (entIndex > -1) {
fDTDGrammar.getEntityDecl(entIndex, fEntityDecl);
@@ -1022,42 +1021,7 @@
}
}
}
-
- if (fDocumentHandler != null) {
- fDocumentHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding, augs);
- }
-
-
- } // startEntity(String,String,String,String,String, Augmentations)
-
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
-
- if (fDocumentHandler != null) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
-
- } // textDecl(String,String)
-
+ }
/**
* A comment.
@@ -1070,8 +1034,16 @@
public void comment(XMLString text, Augmentations augs) throws XNIException {
// call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.comment(text, augs);
+ if (fInDTD) {
+ fDTDGrammar.comment(text, augs);
+ if (fDTDHandler != null) {
+ fDTDHandler.comment(text, augs);
+ }
+ }
+ else {
+ if (fDocumentHandler != null) {
+ fDocumentHandler.comment(text, augs);
+ }
}
} // comment(XMLString)
@@ -1098,35 +1070,28 @@
throws XNIException {
// call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.processingInstruction(target, data, augs);
+ if (fInDTD) {
+ fDTDGrammar.processingInstruction(target, data, augs);
+ if (fDTDHandler != null) {
+ fDTDHandler.processingInstruction(target, data, augs);
+ }
+ }
+ else {
+ if (fDocumentHandler != null) {
+ fDocumentHandler.processingInstruction(target, data, augs);
+ }
}
} // processingInstruction(String,XMLString)
- /**
- * This method notifies the end of an entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs) throws XNIException {
-
+ /** End general entity. */
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
// call handlers
if (fDocumentHandler != null) {
- fDocumentHandler.endEntity(name, augs);
+ fDocumentHandler.endGeneralEntity(name, augs);
}
-
} // endEntity(String)
-
-
//
// XMLDTDHandler methods
//
@@ -1136,7 +1101,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startDTD(XMLLocator locator) throws XNIException {
+ public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
+
+ fInDTD = true;
// initialize state
fNDataDeclNotations.clear();
@@ -1149,41 +1116,25 @@
fGrammarBucket.putGrammar("", fDTDGrammar);
// call handlers
- fDTDGrammar.startDTD(locator);
+ fDTDGrammar.startDTD(locator, augs);
if (fDTDHandler != null) {
- fDTDHandler.startDTD(locator);
+ fDTDHandler.startDTD(locator, augs);
}
} // startDTD(XMLLocator)
/**
- * A comment.
- *
- * @param text The text in the comment.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text) throws XNIException {
-
- // call handlers
- fDTDGrammar.comment(text);
- if (fDTDHandler != null) {
- fDTDHandler.comment(text);
- }
- }
-
- /**
* Character content.
*
* @param text The content.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void characters(XMLString text) throws XNIException {
+ public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
// ignored characters in DTD
if (fDTDHandler != null) {
- fDTDHandler.characters(text);
+ fDTDHandler.ignoredCharacters(text, augs);
}
}
@@ -1199,12 +1150,19 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void textDecl(String version, String encoding) throws XNIException {
+ public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.textDecl(version, encoding);
- if (fDTDHandler != null) {
- fDTDHandler.textDecl(version, encoding);
+ if (fInDTD) {
+ fDTDGrammar.textDecl(version, encoding, augs);
+ if (fDTDHandler != null) {
+ fDTDHandler.textDecl(version, encoding, augs);
+ }
+ }
+ else {
+ if (fDocumentHandler != null) {
+ fDocumentHandler.textDecl(version, encoding, augs);
+ }
}
}
@@ -1226,17 +1184,16 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
+ checkStandaloneEntityRef(name);
// call handlers
- fDTDGrammar.startEntity(name, publicId, systemId,
- baseSystemId, encoding);
+ fDTDGrammar.startParameterEntity(name, identifier, encoding, augs);
if (fDTDHandler != null) {
- fDTDHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding);
+ fDTDHandler.startParameterEntity(name, identifier, encoding, augs);
}
}
/**
@@ -1247,41 +1204,16 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException {
+ public void endParameterEntity(String name, Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.endEntity(name);
+ fDTDGrammar.endParameterEntity(name, augs);
if (fDTDHandler != null) {
- fDTDHandler.endEntity(name);
+ fDTDHandler.endParameterEntity(name, augs);
}
}
/**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data)
- throws XNIException {
-
- // call handlers
- fDTDGrammar.processingInstruction(target, data);
- if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data);
- }
- }
- /**
* An element declaration.
*
* @param name The name of the element.
@@ -1289,7 +1221,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
//check VC: Unique Element Declaration
@@ -1306,9 +1238,9 @@
}
// call handlers
- fDTDGrammar.elementDecl(name, contentModel);
+ fDTDGrammar.elementDecl(name, contentModel, augs);
if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel);
+ fDTDHandler.elementDecl(name, contentModel, augs);
}
} // elementDecl(String,String)
@@ -1321,12 +1253,13 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName) throws XNIException {
+ public void startAttlist(String elementName, Augmentations augs)
+ throws XNIException {
// call handlers
- fDTDGrammar.startAttlist(elementName);
+ fDTDGrammar.startAttlist(elementName, augs);
if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elementName);
+ fDTDHandler.startAttlist(elementName, augs);
}
} // startAttlist(String)
@@ -1354,8 +1287,8 @@
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
- throws XNIException {
+ String defaultType, XMLString defaultValue,
+ Augmentations augs) throws XNIException {
if (type != fCDATASymbol && defaultValue != null) {
normalizeDefaultAttrValue(defaultValue);
@@ -1489,11 +1422,11 @@
// call handlers
fDTDGrammar.attributeDecl(elementName, attributeName,
type, enumeration,
- defaultType, defaultValue);
+ defaultType, defaultValue, augs);
if (fDTDHandler != null) {
fDTDHandler.attributeDecl(elementName, attributeName,
type, enumeration,
- defaultType, defaultValue);
+ defaultType, defaultValue, augs);
}
} // attributeDecl(String,String,String,String[],String,XMLString)
@@ -1503,12 +1436,12 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endAttlist() throws XNIException {
+ public void endAttlist(Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.endAttlist();
+ fDTDGrammar.endAttlist(augs);
if (fDTDHandler != null) {
- fDTDHandler.endAttlist();
+ fDTDHandler.endAttlist(augs);
}
} // endAttlist()
@@ -1528,13 +1461,13 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
- throws XNIException {
+ XMLString nonNormalizedText,
+ Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.internalEntityDecl(name, text, nonNormalizedText);
+ fDTDGrammar.internalEntityDecl(name, text, nonNormalizedText, augs);
if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(name, text, nonNormalizedText);
+ fDTDHandler.internalEntityDecl(name, text, nonNormalizedText, augs);
}
} // internalEntityDecl(String,XMLString,XMLString)
@@ -1555,13 +1488,14 @@
*/
public void externalEntityDecl(String name,
String publicId, String systemId,
- String baseSystemId) throws XNIException {
+ String baseSystemId,
+ Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.externalEntityDecl(name, publicId, systemId, baseSystemId);
+ fDTDGrammar.externalEntityDecl(name, publicId, systemId, baseSystemId, augs);
if (fDTDHandler != null) {
fDTDHandler.externalEntityDecl(name, publicId, systemId,
- baseSystemId);
+ baseSystemId, augs);
}
} // externalEntityDecl(String,String,String,String)
@@ -1580,7 +1514,8 @@
*/
public void unparsedEntityDecl(String name,
String publicId, String systemId,
- String notation) throws XNIException {
+ String notation,
+ Augmentations augs) throws XNIException {
// VC: Notation declared, in the production of NDataDecl
if (fValidation) {
@@ -1588,9 +1523,9 @@
}
// call handlers
- fDTDGrammar.unparsedEntityDecl(name, publicId, systemId, notation);
+ fDTDGrammar.unparsedEntityDecl(name, publicId, systemId, notation, augs);
if (fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation);
+ fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation, augs);
}
} // unparsedEntityDecl(String,String,String,String)
@@ -1606,13 +1541,13 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId)
- throws XNIException {
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.notationDecl(name, publicId, systemId);
+ fDTDGrammar.notationDecl(name, publicId, systemId, augs);
if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, publicId, systemId);
+ fDTDHandler.notationDecl(name, publicId, systemId, augs);
}
} // notationDecl(String,String,String)
@@ -1628,15 +1563,15 @@
* @see XMLDTDHandler#CONDITIONAL_INCLUDE
* @see XMLDTDHandler#CONDITIONAL_IGNORE
*/
- public void startConditional(short type) throws XNIException {
+ public void startConditional(short type, Augmentations augs) throws XNIException {
// set state
fInDTDIgnore = type == XMLDTDHandler.CONDITIONAL_IGNORE;
// call handlers
- fDTDGrammar.startConditional(type);
+ fDTDGrammar.startConditional(type, augs);
if (fDTDHandler != null) {
- fDTDHandler.startConditional(type);
+ fDTDHandler.startConditional(type, augs);
}
} // startConditional(short)
@@ -1646,15 +1581,15 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endConditional() throws XNIException {
+ public void endConditional(Augmentations augs) throws XNIException {
// set state
fInDTDIgnore = false;
// call handlers
- fDTDGrammar.endConditional();
+ fDTDGrammar.endConditional(augs);
if (fDTDHandler != null) {
- fDTDHandler.endConditional();
+ fDTDHandler.endConditional(augs);
}
} // endConditional()
@@ -1664,10 +1599,12 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException {
+ public void endDTD(Augmentations augs) throws XNIException {
+
+ fInDTD = false;
// save grammar
- fDTDGrammar.endDTD();
+ fDTDGrammar.endDTD(augs);
// check VC: Notation declared, in the production of NDataDecl
if (fValidation) {
@@ -1708,7 +1645,7 @@
// call handlers
if (fDTDHandler != null) {
- fDTDHandler.endDTD();
+ fDTDHandler.endDTD(augs);
}
} // endDTD()
@@ -1718,7 +1655,8 @@
//
/** Start content model. */
- public void startContentModel(String elementName) throws XNIException {
+ public void startContentModel(String elementName, Augmentations augs)
+ throws XNIException {
if (fValidation) {
fDTDElementDeclName = elementName;
@@ -1726,52 +1664,52 @@
}
// call handlers
- fDTDGrammar.startContentModel(elementName);
+ fDTDGrammar.startContentModel(elementName, augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(elementName);
+ fDTDContentModelHandler.startContentModel(elementName, augs);
}
} // startContentModel(String)
/** ANY. */
- public void any() throws XNIException {
- fDTDGrammar.any();
+ public void any(Augmentations augs) throws XNIException {
+ fDTDGrammar.any(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.any();
+ fDTDContentModelHandler.any(augs);
}
} // any()
/** EMPTY. */
- public void empty() throws XNIException {
- fDTDGrammar.empty();
+ public void empty(Augmentations augs) throws XNIException {
+ fDTDGrammar.empty(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.empty();
+ fDTDContentModelHandler.empty(augs);
}
} // empty()
/** Start group. */
- public void startGroup() throws XNIException {
+ public void startGroup(Augmentations augs) throws XNIException {
fMixed = false;
// call handlers
- fDTDGrammar.startGroup();
+ fDTDGrammar.startGroup(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup();
+ fDTDContentModelHandler.startGroup(augs);
}
} // startGroup()
/** #PCDATA. */
- public void pcdata() {
+ public void pcdata(Augmentations augs) {
fMixed = true;
- fDTDGrammar.pcdata();
+ fDTDGrammar.pcdata(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.pcdata();
+ fDTDContentModelHandler.pcdata(augs);
}
} // pcdata()
/** Element. */
- public void element(String elementName) throws XNIException {
+ public void element(String elementName, Augmentations augs) throws XNIException {
// check VC: No duplicate Types, in a single mixed-content declaration
if (fMixed && fValidation) {
@@ -1787,53 +1725,55 @@
}
// call handlers
- fDTDGrammar.element(elementName);
+ fDTDGrammar.element(elementName, augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(elementName);
+ fDTDContentModelHandler.element(elementName, augs);
}
} // childrenElement(String)
/** Separator. */
- public void separator(short separator) throws XNIException {
+ public void separator(short separator, Augmentations augs)
+ throws XNIException {
// call handlers
- fDTDGrammar.separator(separator);
+ fDTDGrammar.separator(separator, augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(separator);
+ fDTDContentModelHandler.separator(separator, augs);
}
} // separator(short)
/** Occurrence. */
- public void occurrence(short occurrence) throws XNIException {
+ public void occurrence(short occurrence, Augmentations augs)
+ throws XNIException {
// call handlers
- fDTDGrammar.occurrence(occurrence);
+ fDTDGrammar.occurrence(occurrence, augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.occurrence(occurrence);
+ fDTDContentModelHandler.occurrence(occurrence, augs);
}
} // occurrence(short)
/** End group. */
- public void endGroup() throws XNIException {
+ public void endGroup(Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.endGroup();
+ fDTDGrammar.endGroup(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.endGroup(augs);
}
} // endGroup()
/** End content model. */
- public void endContentModel() throws XNIException {
+ public void endContentModel(Augmentations augs) throws XNIException {
// call handlers
- fDTDGrammar.endContentModel();
+ fDTDGrammar.endContentModel(augs);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endContentModel();
+ fDTDContentModelHandler.endContentModel(augs);
}
} // endContentModel()
1.34 +9 -10 xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Index: XMLSchemaValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- XMLSchemaValidator.java 17 Jan 2002 23:54:59 -0000 1.33
+++ XMLSchemaValidator.java 22 Jan 2002 16:42:26 -0000 1.34
@@ -91,6 +91,7 @@
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
import org.apache.xerces.xni.parser.XMLComponentManager;
@@ -127,7 +128,7 @@
* @author Elena Litani IBM
* @author Andy Clark IBM
* @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: XMLSchemaValidator.java,v 1.33 2002/01/17 23:54:59 neilg Exp $
+ * @version $Id: XMLSchemaValidator.java,v 1.34 2002/01/22 16:42:26 neilg Exp $
*/
public class XMLSchemaValidator
implements XMLComponent, XMLDocumentFilter, FieldActivator {
@@ -699,16 +700,14 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException {
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
// call handlers
if (fDocumentHandler != null) {
- fDocumentHandler.startEntity(name, publicId, systemId,
- baseSystemId, encoding, augs);
+ fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
}
} // startEntity(String,String,String,String,String)
@@ -798,11 +797,11 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
// call handlers
if (fDocumentHandler != null) {
- fDocumentHandler.endEntity(name, augs);
+ fDocumentHandler.endGeneralEntity(name, augs);
}
} // endEntity(String)
1.27 +32 -62 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.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- AbstractDOMParser.java 11 Jan 2002 22:07:18 -0000 1.26
+++ AbstractDOMParser.java 22 Jan 2002 16:42:27 -0000 1.27
@@ -74,6 +74,7 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLParserConfiguration;
@@ -102,7 +103,7 @@
* @author Andy Clark, IBM
* @author Elena Litani, IBM
*
- * @version $Id: AbstractDOMParser.java,v 1.26 2002/01/11 22:07:18 elena Exp $
+ * @version $Id: AbstractDOMParser.java,v 1.27 2002/01/22 16:42:27 neilg Exp $
*/
public abstract class AbstractDOMParser
extends AbstractXMLDocumentParser {
@@ -389,16 +390,16 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException {
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
+ throws XNIException {
// REVISIT: investigate fInDTD & fInDocument flags
// this method now only called by DocumentHandler
// comment(), endEntity(), processingInstruction(), textDecl()
// REVISIT: need to set the Entity.actualEncoding somehow
- if (fInDocument && !fInDTD && fCreateEntityRefNodes ) {
+ if (fCreateEntityRefNodes) {
if (!fDeferNodeExpansion) {
EntityReference er = fDocument.createEntityReference(name);
// we don't need synchronization now, because entity ref will be
@@ -952,9 +953,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- if (fInDocument && !fInDTD && fCreateEntityRefNodes) {
+ if (fCreateEntityRefNodes) {
if (!fDeferNodeExpansion) {
if (fDocumentType != null) {
NamedNodeMap entities = fDocumentType.getEntities();
@@ -1018,8 +1019,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startDTD(XMLLocator locator) throws XNIException {
- super.startDTD(locator);
+ public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
+ super.startDTD(locator, augs);
if (fDeferNodeExpansion || fDocumentImpl != null) {
fInternalSubset = new StringBuffer(1024);
}
@@ -1030,8 +1031,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException {
- super.endDTD();
+ public void endDTD(Augmentations augs) throws XNIException {
+ super.endDTD(augs);
String internalSubset = fInternalSubset != null && fInternalSubset.length() > 0
? fInternalSubset.toString() : null;
if (fDeferNodeExpansion) {
@@ -1046,48 +1047,15 @@
}
} // endDTD()
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" and parameter entity names start with '%'.
- * <p>
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
- if (name.equals("[dtd]")) {
- fInDTDExternalSubset = true;
- }
- } // startEntity(String,String,String,String,String)
+ /** Start external subset. */
+ public void startExternalSubset(Augmentations augs) throws XNIException {
+ fInDTDExternalSubset = true;
+ } // startExternalSubset(Augmentations)
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" and parameter entity names start with '%'.
- * <p>
- *
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name) throws XNIException {
- if (name.equals("[dtd]")) {
- fInDTDExternalSubset = false;
- }
- } // endEntity(String)
+ /** End external subset. */
+ public void endExternalSubset(Augmentations augs) throws XNIException {
+ fInDTDExternalSubset = false;
+ } // endExternalSubset(Augmentations)
/**
* An internal entity declaration.
@@ -1104,8 +1072,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
- throws XNIException {
+ XMLString nonNormalizedText,
+ Augmentations augs) throws XNIException {
// internal subset string
if (fInternalSubset != null && !fInDTDExternalSubset) {
@@ -1183,7 +1151,8 @@
*/
public void externalEntityDecl(String name,
String publicId, String systemId,
- String baseSystemId) throws XNIException {
+ String baseSystemId,
+ Augmentations augs) throws XNIException {
// internal subset string
if (fInternalSubset != null && !fInDTDExternalSubset) {
@@ -1265,7 +1234,8 @@
*/
public void unparsedEntityDecl(String name,
String publicId, String systemId,
- String notation) throws XNIException {
+ String notation, Augmentations augs)
+ throws XNIException {
// internal subset string
if (fInternalSubset != null && !fInDTDExternalSubset) {
@@ -1341,8 +1311,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId)
- throws XNIException {
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augs) throws XNIException {
// internal subset string
if (fInternalSubset != null && !fInDTDExternalSubset) {
@@ -1409,7 +1379,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
// internal subset string
@@ -1446,8 +1416,8 @@
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
- throws XNIException {
+ String defaultType, XMLString defaultValue,
+ Augmentations augs) throws XNIException {
// internal subset string
if (fInternalSubset != null && !fInDTDExternalSubset) {
1.14 +56 -84 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- AbstractSAXParser.java 10 Jan 2002 06:34:23 -0000 1.13
+++ AbstractSAXParser.java 22 Jan 2002 16:42:27 -0000 1.14
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation.
+ * Copyright (c) 2001-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -73,6 +73,7 @@
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLParseException;
@@ -110,7 +111,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractSAXParser.java,v 1.13 2002/01/10 06:34:23 twl Exp $
+ * @version $Id: AbstractSAXParser.java,v 1.14 2002/01/22 16:42:27 neilg Exp $
*/
public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
@@ -310,11 +311,11 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId, String systemId,
- String baseSystemId, String encoding, Augmentations augs)
+ public void startGeneralEntity(String name, XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
throws XNIException {
- startEntity(name, publicId, systemId, baseSystemId, encoding);
+ startParameterEntity(name, identifier, encoding, augs);
} // startEntity(String,String,String,String,String)
@@ -337,9 +338,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException {
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- endEntity(name);
+ endParameterEntity(name, augs);
} // endEntity(String)
@@ -589,65 +590,17 @@
*/
public void comment(XMLString text, Augmentations augs) throws XNIException {
- comment (text);
-
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- processingInstruction (target, data);
-
- } // processingInstruction(String,XMLString)
-
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
-
try {
- // SAX1
- if (fDocumentHandler != null) {
- fDocumentHandler.endDocument();
- }
-
- // SAX2
- if (fContentHandler != null) {
- fContentHandler.endDocument();
+ // SAX2 extension
+ if (fLexicalHandler != null) {
+ fLexicalHandler.comment(text.ch, 0, text.length);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
- } // endDocument()
-
-
- //
- // XMLDTDHandler methods
- //
-
+ } // comment(XMLString)
/**
* A processing instruction. Processing instructions consist of a
@@ -662,10 +615,11 @@
*
* @param target The target.
* @param data The data or null if none specified.
+ * @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void processingInstruction(String target, XMLString data)
+ public void processingInstruction(String target, XMLString data, Augmentations augs)
throws XNIException {
//
@@ -693,28 +647,44 @@
} // processingInstruction(String,XMLString)
-
/**
- * A comment.
- *
- * @param text The text in the comment.
+ * The end of the document.
+ * @param augs Additional information that may include infoset augmentations
*
- * @throws XNIException Thrown by application to signal an error.
+ * @throws XNIException Thrown by handler to signal an error.
*/
- public void comment(XMLString text) throws XNIException {
+ public void endDocument(Augmentations augs) throws XNIException {
try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.comment(text.ch, 0, text.length);
+ // SAX1
+ if (fDocumentHandler != null) {
+ fDocumentHandler.endDocument();
+ }
+
+ // SAX2
+ if (fContentHandler != null) {
+ fContentHandler.endDocument();
}
}
catch (SAXException e) {
throw new XNIException(e);
}
- } // comment(XMLString)
+ } // endDocument()
+
+ //
+ // XMLDTDHandler methods
+ //
+ /** Start external subset. */
+ public void startExternalSubset(Augmentations augs) throws XNIException {
+ startParameterEntity("[dtd]", null, null, augs);
+ }
+
+ /** End external subset. */
+ public void endExternalSubset(Augmentations augs) throws XNIException {
+ endParameterEntity("[dtd]", augs);
+ }
/**
* This method notifies of the start of an entity. The DTD has the
@@ -742,8 +712,9 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId, String systemId,
- String baseSystemId, String encoding)
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding, Augmentations augs)
throws XNIException {
try {
@@ -776,7 +747,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException {
+ public void endParameterEntity(String name, Augmentations augs) throws XNIException {
try {
// SAX2 extension
@@ -798,7 +769,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
try {
@@ -836,8 +807,8 @@
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
- throws XNIException {
+ String defaultType, XMLString defaultValue,
+ Augmentations augs) throws XNIException {
try {
// SAX2 extension
@@ -888,8 +859,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
- throws XNIException {
+ XMLString nonNormalizedText,
+ Augmentations augs) throws XNIException {
try {
// SAX2 extensions
@@ -917,7 +888,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void externalEntityDecl(String name, String publicId,
- String systemId, String baseSystemId) throws XNIException {
+ String systemId, String baseSystemId,
+ Augmentations augs) throws XNIException {
try {
// SAX2 extension
@@ -944,8 +916,8 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notation)
- throws XNIException {
+ String systemId, String notation,
+ Augmentations augs) throws XNIException {
try {
// SAX2 extension
@@ -971,8 +943,8 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId)
- throws XNIException {
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augs) throws XNIException {
try {
// SAX1 and SAX2
@@ -991,7 +963,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException {
+ public void endDTD(Augmentations augs) throws XNIException {
fInDTD = false;
try {
1.6 +84 -136 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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AbstractXMLDocumentParser.java 10 Jan 2002 06:34:23 -0000 1.5
+++ AbstractXMLDocumentParser.java 22 Jan 2002 16:42:27 -0000 1.6
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation.
+ * Copyright (c) 2001-2002 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,6 +66,7 @@
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XMLLocator;
+import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLParserConfiguration;
@@ -84,7 +85,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractXMLDocumentParser.java,v 1.5 2002/01/10 06:34:23 twl Exp $
+ * @version $Id: AbstractXMLDocumentParser.java,v 1.6 2002/01/22 16:42:27 neilg Exp $
*/
public abstract class AbstractXMLDocumentParser
extends XMLParser
@@ -303,13 +304,7 @@
* appearing as part of attribute values.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId
- * The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
@@ -317,15 +312,13 @@
* parsed from a java.io.Reader).
* @param augs Additional information that may include infoset augmentations
*
- * @exception XNIException
- * Thrown by handler to signal an error.
+ * @exception XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException{
- }
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
+ } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
@@ -360,10 +353,9 @@
* @exception XNIException
* Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException{
- }
-
-
+ public void endGeneralEntity(String name, Augmentations augs)
+ throws XNIException {
+ } // endGeneralEntity(String,Augmentations)
/**
* A comment.
@@ -409,128 +401,84 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startDTD(XMLLocator locator) throws XNIException {
+ public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
fInDTD = true;
} // startDTD(XMLLocator)
/**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
+ * The start of the DTD external subset.
+ *
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
*/
- public void characters(XMLString text) throws XNIException{
- }
+ public void startExternalSubset(Augmentations augmentations)
+ throws XNIException {
+ } // startExternalSubset(Augmentations)
/**
- * This method notifies of the start of an entity. The document entity
- * has the pseudo-name of "[xml]"; The DTD has the pseudo-name of "[dtd]"
- * parameter entity names start with '%'; and general entity names are
- * just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the start of the document entity by calling the
- * startEntity method with the entity name "[xml]" <em>before</em> calling
- * the startDocument method. When exposing entity boundaries through the
- * XNI API, the document entity is never reported, however.
+ * The end of the DTD external subset.
+ *
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
+ */
+ public void endExternalSubset(Augmentations augmentations)
+ throws XNIException {
+ } // endExternalSubset(Augmentations)
+
+ /**
+ * This method notifies the start of an entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
* @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- *
- * @throws XNIException Thrown by handler to signal an error.
+ * internal entities or a document entity that is
+ * parsed from a java.io.Reader).
+ * @param augs Additional information that may include infoset augmentations
+ *
+ * @exception XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException {
- } // startEntity(String,String,String,String,String)
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException {
+ } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
/**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
+ * This method notifies the end of an entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding) throws XNIException {
- } // textDecl(String,String)
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text) throws XNIException {
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- *
- * @throws XNIException Thrown by handler to signal an error.
+ * @param name The name of the entity.
+ * @param augs Additional information that may include infoset augmentations
+ *
+ * @exception XNIException
+ * Thrown by handler to signal an error.
*/
- public void processingInstruction(String target, XMLString data)
+ public void endParameterEntity(String name, Augmentations augs)
throws XNIException {
- } // processingInstruction(String,XMLString)
-
+ } // endParameterEntity(String,Augmentations)
+
/**
- * This method notifies the end of an entity. The document entity has
- * the pseudo-name of "[xml]"; the DTD has the pseudo-name of "[dtd]"
- * parameter entity names start with '%'; and general entity names are
- * just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the end of the document entity by calling the
- * endEntity method with the entity name "[xml]" <em>after</em> calling
- * the endDocument method. When exposing entity boundaries through the
- * XNI API, the document entity is never reported, however.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
+ * Character content.
*
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
+ * @param text The content.
+ * @param augs Additional information that may include infoset augmentations
+ *
+ * @exception XNIException
+ * Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException {
- } // endEntity(String)
+ public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {}
/**
* An element declaration.
@@ -540,7 +488,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
} // elementDecl(String,String)
@@ -552,7 +500,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName) throws XNIException {
+ public void startAttlist(String elementName, Augmentations augs) throws XNIException {
} // startAttlist(String)
/**
@@ -578,7 +526,7 @@
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
+ String defaultType, XMLString defaultValue, Augmentations augs)
throws XNIException {
} // attributeDecl(String,String,String,String[],String,XMLString)
@@ -587,7 +535,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endAttlist() throws XNIException {
+ public void endAttlist(Augmentations augs) throws XNIException {
} // endAttlist()
/**
@@ -605,7 +553,7 @@
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
+ XMLString nonNormalizedText, Augmentations augs)
throws XNIException {
} // internalEntityDecl(String,XMLString,XMLString)
@@ -625,7 +573,7 @@
*/
public void externalEntityDecl(String name,
String publicId, String systemId,
- String baseSystemId) throws XNIException {
+ String baseSystemId, Augmentations augs) throws XNIException {
} // externalEntityDecl(String,String,String,String)
/**
@@ -642,7 +590,7 @@
*/
public void unparsedEntityDecl(String name,
String publicId, String systemId,
- String notation) throws XNIException {
+ String notation, Augmentations augs) throws XNIException {
} // unparsedEntityDecl(String,String,String,String)
/**
@@ -656,7 +604,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void notationDecl(String name, String publicId, String systemId)
+ public void notationDecl(String name, String publicId, String systemId, Augmentations augs)
throws XNIException {
} // notationDecl(String,String,String)
@@ -671,7 +619,7 @@
* @see XMLDTDHandler#CONDITIONAL_INCLUDE
* @see XMLDTDHandler#CONDITIONAL_IGNORE
*/
- public void startConditional(short type) throws XNIException {
+ public void startConditional(short type, Augmentations augs) throws XNIException {
} // startConditional(short)
/**
@@ -679,7 +627,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endConditional() throws XNIException {
+ public void endConditional(Augmentations augs) throws XNIException {
} // endConditional()
/**
@@ -687,7 +635,7 @@
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException {
+ public void endDTD(Augmentations augs) throws XNIException {
fInDTD = false;
} // endDTD()
@@ -696,34 +644,34 @@
//
/** Start content model. */
- public void startContentModel(String elementName) throws XNIException {}
+ public void startContentModel(String elementName, Augmentations augs) throws XNIException {}
/** ANY. */
- public void any() throws XNIException {}
+ public void any(Augmentations augs) throws XNIException {}
/** EMPTY. */
- public void empty() throws XNIException {}
+ public void empty(Augmentations augs) throws XNIException {}
/** Start group. */
- public void startGroup() throws XNIException {}
+ public void startGroup(Augmentations augs) throws XNIException {}
/** #PCDATA. */
- public void pcdata() throws XNIException {}
+ public void pcdata(Augmentations augs) throws XNIException {}
/** Element. */
- public void element(String elementName) throws XNIException {}
+ public void element(String elementName, Augmentations augs) throws XNIException {}
/** Separator. */
- public void separator(short separator) throws XNIException {}
+ public void separator(short separator, Augmentations augs) throws XNIException {}
/** Occurrence. */
- public void occurrence(short occurrence) throws XNIException {}
+ public void occurrence(short occurrence, Augmentations augs) throws XNIException {}
/** End group. */
- public void endGroup() throws XNIException {}
+ public void endGroup(Augmentations augs) throws XNIException {}
/** End content model. */
- public void endContentModel() throws XNIException {}
+ public void endContentModel(Augmentations augs) throws XNIException {}
//
// Protected methods
1.1 xml-xerces/java/src/org/apache/xerces/util/XMLResourceIdentifierImpl.java
Index: XMLResourceIdentifierImpl.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* 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
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* 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,
* if and wherever such third-party acknowledgments normally appear.
*
* 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
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.apache.org. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xerces.util;
import org.apache.xerces.xni.XMLResourceIdentifier;
/**
* The XMLResourceIdentifierImpl class is an implementation of the
* XMLResourceIdentifier interface which defines the location identity
* of a resource.
*
* @author Andy Clark
*
* @version $Id: XMLResourceIdentifierImpl.java,v 1.1 2002/01/22 16:42:27 neilg Exp $
*/
public class XMLResourceIdentifierImpl
implements XMLResourceIdentifier {
//
// Data
//
/** The public identifier. */
protected String fPublicId;
/** The literal system identifier. */
protected String fLiteralSystemId;
/** The base system identifier. */
protected String fBaseSystemId;
/** The expanded system identifier. */
protected String fExpandedSystemId;
//
// Constructors
//
/** Constructs an empty resource identifier. */
public XMLResourceIdentifierImpl() {} // <init>()
/**
* Constructs a resource identifier.
*
* @param publicId The public identifier.
* @param literalSystemId The literal system identifier.
* @param baseSystemId The base system identifier.
* @param expandedSystemId The expanded system identifier.
*/
public XMLResourceIdentifierImpl(String publicId,
String literalSystemId, String baseSystemId,
String expandedSystemId) {
setValues(publicId, literalSystemId, baseSystemId, expandedSystemId);
} // <init>(String,String,String,String)
//
// Public methods
//
/** Sets the values of the resource identifier. */
public void setValues(String publicId, String literalSystemId,
String baseSystemId, String expandedSystemId) {
fPublicId = publicId;
fLiteralSystemId = literalSystemId;
fBaseSystemId = baseSystemId;
fExpandedSystemId = expandedSystemId;
} // setValues(String,String,String,String)
/** Clears the values. */
public void clear() {
fPublicId = null;
fLiteralSystemId = null;
fBaseSystemId = null;
fExpandedSystemId = null;
} // clear()
/** Sets the public identifier. */
public void setPublicId(String publicId) {
fPublicId = publicId;
} // setPublicId(String)
/** Sets the literal system identifier. */
public void setLiteralSystemId(String literalSystemId) {
fLiteralSystemId = literalSystemId;
} // setLiteralSystemId(String)
/** Sets the base system identifier. */
public void setBaseSystemId(String baseSystemId) {
fBaseSystemId = baseSystemId;
} // setBaseSystemId(String)
/** Sets the expanded system identifier. */
public void setExpandedSystemId(String expandedSystemId) {
fExpandedSystemId = expandedSystemId;
} // setExpandedSystemId(String)
//
// XMLResourceIdentifier methods
//
/** Returns the public identifier. */
public String getPublicId() {
return fPublicId;
} // getPublicId():String
/** Returns the literal system identifier. */
public String getLiteralSystemId() {
return fLiteralSystemId;
} // getLiteralSystemId():String
/**
* Returns the base URI against which the literal SystemId is to be resolved.
*/
public String getBaseSystemId() {
return fBaseSystemId;
} // getBaseSystemId():String
/** Returns the expanded system identifier. */
public String getExpandedSystemId() {
return fExpandedSystemId;
} // getExpandedSystemId():String
//
// Object methods
//
/** Returns a hash code for this object. */
public int hashCode() {
int code = 0;
if (fPublicId != null) {
code += fPublicId.hashCode();
}
if (fLiteralSystemId != null) {
code += fLiteralSystemId.hashCode();
}
if (fBaseSystemId != null) {
code += fBaseSystemId.hashCode();
}
if (fExpandedSystemId != null) {
code += fExpandedSystemId.hashCode();
}
return code;
} // hashCode():int
/** Returns a string representation of this object. */
public String toString() {
StringBuffer str = new StringBuffer();
if (fPublicId != null) {
str.append(fPublicId);
}
str.append(':');
if (fLiteralSystemId != null) {
str.append(fLiteralSystemId);
}
str.append(':');
if (fBaseSystemId != null) {
str.append(fBaseSystemId);
}
str.append(':');
if (fExpandedSystemId != null) {
str.append(fExpandedSystemId);
}
return str.toString();
} // toString():String
} // class XMLAttributesImpl
1.3 +41 -12 xml-xerces/java/src/org/apache/xerces/xni/XMLDTDContentModelHandler.java
Index: XMLDTDContentModelHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/XMLDTDContentModelHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLDTDContentModelHandler.java 23 Aug 2001 00:35:36 -0000 1.2
+++ XMLDTDContentModelHandler.java 22 Jan 2002 16:42:28 -0000 1.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2000,2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLDTDContentModelHandler.java,v 1.2 2001/08/23 00:35:36 lehors Exp $
+ * @version $Id: XMLDTDContentModelHandler.java,v 1.3 2002/01/22 16:42:28 neilg Exp $
*/
public interface XMLDTDContentModelHandler {
@@ -171,31 +171,39 @@
* startContentModel method and the call to the endContentModel method.
*
* @param elementName The name of the element.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startContentModel(String elementName)
+ public void startContentModel(String elementName, Augmentations augmentations)
throws XNIException;
/**
* A content model of ANY.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*
* @see #empty
* @see #startGroup
*/
- public void any() throws XNIException;
+ public void any(Augmentations augmentations) throws XNIException;
/**
* A content model of EMPTY.
*
* @throws XNIException Thrown by handler to signal an error.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @see #any
* @see #startGroup
*/
- public void empty() throws XNIException;
+ public void empty(Augmentations augmentations) throws XNIException;
/**
* A start of either a mixed or children content model. A mixed
@@ -203,45 +211,57 @@
* <code>pcdata()</code> method. A children content model will
* contain additional groups and/or elements.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*
* @see #any
* @see #empty
*/
- public void startGroup() throws XNIException;
+ public void startGroup(Augmentations augmentations) throws XNIException;
/**
* The appearance of "#PCDATA" within a group signifying a
* mixed content model. This method will be the first called
* following the content model's <code>startGroup()</code>.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*
* @see #startGroup
*/
- public void pcdata() throws XNIException;
+ public void pcdata(Augmentations augmentations) throws XNIException;
/**
* A referenced element in a mixed or children content model.
*
* @param elementName The name of the referenced element.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void element(String elementName) throws XNIException;
+ public void element(String elementName, Augmentations augmentations)
+ throws XNIException;
/**
* The separator between choices or sequences of a mixed or children
* content model.
*
* @param separator The type of children separator.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*
* @see #SEPARATOR_CHOICE
* @see #SEPARATOR_SEQUENCE
*/
- public void separator(short separator) throws XNIException;
+ public void separator(short separator, Augmentations augmentations)
+ throws XNIException;
/**
* The occurrence count for a child in a children content model or
@@ -249,6 +269,8 @@
*
* @param occurrence The occurrence count for the last element
* or group.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*
@@ -256,20 +278,27 @@
* @see #OCCURS_ZERO_OR_MORE
* @see #OCCURS_ONE_OR_MORE
*/
- public void occurrence(short occurrence) throws XNIException;
+ public void occurrence(short occurrence, Augmentations augmentations)
+ throws XNIException;
/**
* The end of a group for mixed or children content models.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endGroup() throws XNIException;
+ public void endGroup(Augmentations augmentations) throws XNIException;
/**
* The end of a content model.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endContentModel() throws XNIException;
+ public void endContentModel(Augmentations augmentations) throws XNIException;
} // interface XMLDTDContentModelHandler
1.5 +107 -37 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLDTDHandler.java 26 Nov 2001 21:45:51 -0000 1.4
+++ XMLDTDHandler.java 22 Jan 2002 16:42:28 -0000 1.5
@@ -68,7 +68,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLDTDHandler.java,v 1.4 2001/11/26 21:45:51 elena Exp $
+ * @version $Id: XMLDTDHandler.java,v 1.5 2002/01/22 16:42:28 neilg Exp $
*/
public interface XMLDTDHandler {
@@ -103,34 +103,33 @@
* recommended that a locator be supplied that can
* at least report the base system identifier of the
* DTD.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startDTD(XMLLocator locator) throws XNIException;
+ public void startDTD(XMLLocator locator, Augmentations augmentations)
+ throws XNIException;
/**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" and parameter entity names start with '%'.
- * <p>
+ * This method notifies of the start of a parameter entity. The parameter
+ * entity name start with a '%' character.
*
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param name The name of the parameter entity.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
* internal parameter entities).
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException;
+ public void startParameterEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augmentations) throws XNIException;
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
@@ -141,30 +140,60 @@
*
* @param version The XML version, or null if not specified.
* @param encoding The IANA encoding name of the entity.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void textDecl(String version, String encoding) throws XNIException;
+ public void textDecl(String version, String encoding,
+ Augmentations augmentations) throws XNIException;
/**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" and parameter entity names start with '%'.
- * <p>
+ * This method notifies the end of a parameter entity. Parameter entity
+ * names begin with a '%' character.
*
- * @param name The name of the entity.
+ * @param name The name of the parameter entity.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
+ */
+ public void endParameterEntity(String name, Augmentations augmentations)
+ throws XNIException;
+
+ /**
+ * The start of the DTD external subset.
+ *
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
+ */
+ public void startExternalSubset(Augmentations augmentations)
+ throws XNIException;
+
+ /**
+ * The end of the DTD external subset.
+ *
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException;
+ public void endExternalSubset(Augmentations augmentations)
+ throws XNIException;
/**
* A comment.
*
* @param text The text in the comment.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by application to signal an error.
*/
- public void comment(XMLString text) throws XNIException;
+ public void comment(XMLString text, Augmentations augmentations)
+ throws XNIException;
/**
* A processing instruction. Processing instructions consist of a
@@ -179,10 +208,13 @@
*
* @param target The target.
* @param data The data or null if none specified.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void processingInstruction(String target, XMLString data)
+ public void processingInstruction(String target, XMLString data,
+ Augmentations augmentations)
throws XNIException;
/**
@@ -190,10 +222,13 @@
*
* @param name The name of the element.
* @param contentModel The element content model.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void elementDecl(String name, String contentModel)
+ public void elementDecl(String name, String contentModel,
+ Augmentations augmentations)
throws XNIException;
/**
@@ -201,10 +236,13 @@
*
* @param elementName The name of the element that this attribute
* list is associated with.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName) throws XNIException;
+ public void startAttlist(String elementName,
+ Augmentations augmentations) throws XNIException;
/**
* An attribute declaration.
@@ -224,20 +262,26 @@
* "#REQUIRED", or null.
* @param defaultValue The attribute default value, or null if no
* default value is specified.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void attributeDecl(String elementName, String attributeName,
String type, String[] enumeration,
- String defaultType, XMLString defaultValue)
+ String defaultType, XMLString defaultValue,
+ Augmentations augmentations)
throws XNIException;
/**
* The end of an attribute list.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endAttlist() throws XNIException;
+ public void endAttlist(Augmentations augmentations) throws XNIException;
/**
* An internal entity declaration.
@@ -250,11 +294,14 @@
* value contains the same sequence of characters that was in
* the internal entity declaration, without any entity
* references expanded.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText)
+ XMLString nonNormalizedText,
+ Augmentations augmentations)
throws XNIException;
/**
@@ -268,12 +315,16 @@
* @param systemId The system identifier of the entity.
* @param baseSystemId The base system identifier where this entity
* is declared.
+ * @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) throws XNIException;
+ String baseSystemId,
+ Augmentations augmentations)
+ throws XNIException;
/**
* An unparsed entity declaration.
@@ -284,12 +335,15 @@
* @param systemId The system identifier of the entity, or null if not
* specified.
* @param notation The name of the notation.
+ * @param augmentations 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 notation) throws XNIException;
+ String notation, Augmentations augmentations)
+ throws XNIException;
/**
* A notation declaration
@@ -299,44 +353,60 @@
* specified.
* @param systemId The system identifier of the notation, or null if not
* specified.
+ * @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)
- throws XNIException;
+ public void notationDecl(String name, String publicId, String systemId,
+ Augmentations augmentations) throws XNIException;
/**
* The start of a conditional section.
*
* @param type The type of the conditional section. This value will
* either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*
* @see #CONDITIONAL_INCLUDE
* @see #CONDITIONAL_IGNORE
*/
- public void startConditional(short type) throws XNIException;
+ public void startConditional(short type, Augmentations augmentations)
+ throws XNIException;
/**
* Characters within an IGNORE conditional section.
*
* @param text The ignored text.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
*/
- public void characters(XMLString text) throws XNIException;
+ public void ignoredCharacters(XMLString text, Augmentations augmentations)
+ throws XNIException;
/**
* The end of a conditional section.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endConditional() throws XNIException;
+ public void endConditional(Augmentations augmentations) throws XNIException;
/**
* The end of the DTD.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDTD() throws XNIException;
+ public void endDTD(Augmentations augmentations) throws XNIException;
} // interface XMLDTDHandler
1.4 +75 -33 xml-xerces/java/src/org/apache/xerces/xni/XMLDocumentFragmentHandler.java
Index: XMLDocumentFragmentHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/XMLDocumentFragmentHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLDocumentFragmentHandler.java 25 Sep 2001 06:30:29 -0000 1.3
+++ XMLDocumentFragmentHandler.java 22 Jan 2002 16:42:28 -0000 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,7 @@
* @see XMLDocumentHandler
*
* @author Andy Clark, IBM
- * @version $Id: XMLDocumentFragmentHandler.java,v 1.3 2001/09/25 06:30:29 andyc Exp $
+ * @version $Id: XMLDocumentFragmentHandler.java,v 1.4 2002/01/22 16:42:28 neilg Exp $
*/
public interface XMLDocumentFragmentHandler {
@@ -92,38 +92,38 @@
* for copying the namespace bindings from the
* the current context (and its parent contexts)
* if that information is important.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void startDocumentFragment(XMLLocator locator,
- NamespaceContext namespaceContext)
+ NamespaceContext namespaceContext,
+ Augmentations augmentations)
throws XNIException;
/**
- * This method notifies the start of an entity.
+ * This method notifies the start of a general entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param name The name of the general entity.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
* internal entities or a document entity that is
* parsed from a java.io.Reader).
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding) throws XNIException;
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augmentations) throws XNIException;
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
@@ -138,31 +138,40 @@
*
* @param version The XML version, or null if not specified.
* @param encoding The IANA encoding name of the entity.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void textDecl(String version, String encoding) throws XNIException;
+ public void textDecl(String version, String encoding,
+ Augmentations augmentations) throws XNIException;
/**
- * This method notifies the end of an entity.
+ * This method notifies the end of a general entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
- * @param name The name of the entity.
+ * @param name The name of the general entity.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endEntity(String name) throws XNIException;
+ public void endGeneralEntity(String name, Augmentations augmentations)
+ throws XNIException;
/**
* A comment.
*
* @param text The text in the comment.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by application to signal an error.
*/
- public void comment(XMLString text) throws XNIException;
+ public void comment(XMLString text, Augmentations augmentations)
+ throws XNIException;
/**
* A processing instruction. Processing instructions consist of a
@@ -177,10 +186,13 @@
*
* @param target The target.
* @param data The data or null if none specified.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void processingInstruction(String target, XMLString data)
+ public void processingInstruction(String target, XMLString data,
+ Augmentations augmentations)
throws XNIException;
/**
@@ -189,10 +201,13 @@
*
* @param prefix The namespace prefix.
* @param uri The URI bound to the prefix.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startPrefixMapping(String prefix, String uri)
+ public void startPrefixMapping(String prefix, String uri,
+ Augmentations augmentations)
throws XNIException;
/**
@@ -200,31 +215,38 @@
*
* @param element The name of the element.
* @param attributes The element attributes.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startElement(QName element, XMLAttributes attributes)
- throws XNIException;
+ public void startElement(QName element, XMLAttributes attributes,
+ Augmentations augmentations) throws XNIException;
/**
* An empty element.
*
* @param element The name of the element.
* @param attributes The element attributes.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void emptyElement(QName element, XMLAttributes attributes)
- throws XNIException;
+ public void emptyElement(QName element, XMLAttributes attributes,
+ Augmentations augmentations) throws XNIException;
/**
* Character content.
*
* @param text The content.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void characters(XMLString text) throws XNIException;
+ public void characters(XMLString text, Augmentations augmentations)
+ throws XNIException;
/**
* Ignorable whitespace. For this method to be called, the document
@@ -235,49 +257,69 @@
* content model.
*
* @param text The ignorable whitespace.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void ignorableWhitespace(XMLString text) throws XNIException;
+ public void ignorableWhitespace(XMLString text,
+ Augmentations augmentations)
+ throws XNIException;
/**
* The end of an element.
*
* @param element The name of the element.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endElement(QName element) throws XNIException;
+ public void endElement(QName element, Augmentations augmentations)
+ throws XNIException;
/**
* The end of a namespace prefix mapping. This method will only be
* called when namespace processing is enabled.
*
* @param prefix The namespace prefix.
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endPrefixMapping(String prefix) throws XNIException;
+ public void endPrefixMapping(String prefix, Augmentations augmentations)
+ throws XNIException;
/**
* The start of a CDATA section.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void startCDATA() throws XNIException;
+ public void startCDATA(Augmentations augmentations) throws XNIException;
/**
* The end of a CDATA section.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endCDATA() throws XNIException;
+ public void endCDATA(Augmentations augmentations) throws XNIException;
/**
* The end of the document fragment.
*
+ * @param augmentations Additional information that may include infoset
+ * augmentations.
+ *
* @throws XNIException Thrown by handler to signal an error.
*/
- public void endDocumentFragment() throws XNIException;
+ public void endDocumentFragment(Augmentations augmentations)
+ throws XNIException;
} // interface XMLDocumentFragmentHandler
1.4 +11 -19 xml-xerces/java/src/org/apache/xerces/xni/XMLDocumentHandler.java
Index: XMLDocumentHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/XMLDocumentHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLDocumentHandler.java 26 Nov 2001 21:45:51 -0000 1.3
+++ XMLDocumentHandler.java 22 Jan 2002 16:42:28 -0000 1.4
@@ -66,7 +66,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLDocumentHandler.java,v 1.3 2001/11/26 21:45:51 elena Exp $
+ * @version $Id: XMLDocumentHandler.java,v 1.4 2002/01/22 16:42:28 neilg Exp $
*/
public interface XMLDocumentHandler {
@@ -202,19 +202,13 @@
throws XNIException;
/**
- * This method notifies the start of an entity.
+ * This method notifies the start of a general entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param baseSystemId
- * The base system identifier of the entity if
- * the entity is external, null otherwise.
+ * @param name The name of the general entity.
+ * @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
@@ -222,14 +216,12 @@
* parsed from a java.io.Reader).
* @param augs Additional information that may include infoset augmentations
*
- * @exception XNIException
- * Thrown by handler to signal an error.
+ * @exception XNIException Thrown by handler to signal an error.
*/
- public void startEntity(String name,
- String publicId, String systemId,
- String baseSystemId,
- String encoding,
- Augmentations augs) throws XNIException;
+ public void startGeneralEntity(String name,
+ XMLResourceIdentifier identifier,
+ String encoding,
+ Augmentations augs) throws XNIException;
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
@@ -252,7 +244,7 @@
public void textDecl(String version, String encoding, Augmentations augs) throws XNIException;
/**
- * This method notifies the end of an entity.
+ * This method notifies the end of a general entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
@@ -263,7 +255,7 @@
* @exception XNIException
* Thrown by handler to signal an error.
*/
- public void endEntity(String name, Augmentations augs) throws XNIException;
+ public void endGeneralEntity(String name, Augmentations augs) throws XNIException;
/**
* Character content.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org