You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/10/06 19:50:09 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/parsers XMLDocumentParser.java SAXParser.java
andyc 00/10/06 10:50:08
Modified: java/design Tag: xerces_j_2 design.html design.zip
java/design/xml Tag: xerces_j_2 design.xml
java/src/org/apache/xerces/impl Tag: xerces_j_2
XMLDocumentScanner.java XMLValidator.java
java/src/org/apache/xerces/xni Tag: xerces_j_2
XMLDocumentHandler.java
java/src/org/apache/xerces/parsers Tag: xerces_j_2
XMLDocumentParser.java SAXParser.java
Log:
Changed the XMLDocumnetHandler#characters method to *not*
pass in a boolean parameter stating whether the characters
contain nothing but whitespace. Updated all of the sources
and handler classes to comply.
When I originally put this method into the design, I was
trying to optimize the ability of the validator to see
that a range of characters from the scanner was only
whitespace so that it could turn around and call the
XMLDocumentHandler#ignorableWhitespace method without
having to check the characters. However, this makes the
design less clean *and* makes everyone pay for that work
even when they're not validating.
Revision Changes Path
No revision
No revision
1.1.2.10 +2 -3 xml-xerces/java/design/Attic/design.html
Index: design.html
===================================================================
RCS file: /home/cvs/xml-xerces/java/design/Attic/design.html,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- design.html 2000/10/02 01:23:15 1.1.2.9
+++ design.html 2000/10/06 17:49:51 1.1.2.10
@@ -129,8 +129,7 @@
<LI>
<SPAN class="method-title">characters</SPAN> ( <SPAN
class="class-title">XMLString</SPAN> <SPAN
- class="param-title">text</SPAN>, boolean <SPAN
- class="param-title">whitespace</SPAN> )
+ class="param-title">text</SPAN> )
<LI>
<SPAN class="method-title">ignorableWhitespace</SPAN> (
<SPAN class="class-title">XMLString</SPAN> <SPAN
@@ -1774,5 +1773,5 @@
class="param-title">s</SPAN> )
</UL>
</DL>
- </A></BLOCKQUOTE> Last modified: $Date: 2000/10/02 01:23:15 $</BODY>
+ </A></BLOCKQUOTE> Last modified: $Date: 2000/10/06 17:49:51 $</BODY>
</HTML>
1.1.2.9 +265 -306 xml-xerces/java/design/Attic/design.zip
<<Binary file>>
No revision
No revision
1.1.2.8 +2 -5 xml-xerces/java/design/xml/Attic/design.xml
Index: design.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/design/xml/Attic/design.xml,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- design.xml 2000/10/02 01:23:18 1.1.2.7
+++ design.xml 2000/10/06 17:49:57 1.1.2.8
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='US-ASCII'?>
-<!-- $Id: design.xml,v 1.1.2.7 2000/10/02 01:23:18 andyc Exp $ -->
+<!-- $Id: design.xml,v 1.1.2.8 2000/10/06 17:49:57 andyc Exp $ -->
<!DOCTYPE design SYSTEM 'design.dtd' [
<!ENTITY package 'org.apache.xerces'>
]>
-<design name='Xerces-J 2.0' date='$Date: 2000/10/02 01:23:18 $'>
+<design name='Xerces-J 2.0' date='$Date: 2000/10/06 17:49:57 $'>
<!-- TYPES -->
<types>
@@ -437,9 +437,6 @@
<method name='characters'>
<param name='text'>
<reference idref='string'/>
- </param>
- <param name='whitespace'>
- <primitive type='boolean'/>
</param>
<throws>
<reference idref='sax-exception'/>
No revision
No revision
1.1.2.12 +3 -14 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDocumentScanner.java
Index: XMLDocumentScanner.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDocumentScanner.java,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -r1.1.2.11 -r1.1.2.12
--- XMLDocumentScanner.java 2000/10/06 03:49:33 1.1.2.11
+++ XMLDocumentScanner.java 2000/10/06 17:50:00 1.1.2.12
@@ -100,7 +100,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLDocumentScanner.java,v 1.1.2.11 2000/10/06 03:49:33 andyc Exp $
+ * @version $Id: XMLDocumentScanner.java,v 1.1.2.12 2000/10/06 17:50:00 andyc Exp $
*/
public class XMLDocumentScanner
extends XMLScanner
@@ -1023,18 +1023,7 @@
int c = fEntityScanner.scanContent(fString);
if (fDocumentHandler != null) {
- /*** REVISIT: Should we remove the whitespace param? -Ac
- boolean whitespace = true;
- for (int i = 0; i < fString.length; i++) {
- if (!XMLChar.isSpace(fString.ch[fString.offset + i])) {
- whitespace = false;
- break;
- }
- }
- fDocumentHandler.characters(fString, whitespace);
- /***/
- fDocumentHandler.characters(fString, false);
- /***/
+ fDocumentHandler.characters(fString);
}
return c;
@@ -1106,7 +1095,7 @@
if (fDocumentHandler != null) {
fSingleChar[0] = (char)value;
fString.setValues(fSingleChar, 0, 1);
- fDocumentHandler.characters(fString, XMLChar.isSpace(value));
+ fDocumentHandler.characters(fString);
}
} // scanCharReference()
1.1.2.6 +2 -4 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java
Index: XMLValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- XMLValidator.java 2000/10/05 01:59:29 1.1.2.5
+++ XMLValidator.java 2000/10/06 17:50:01 1.1.2.6
@@ -74,7 +74,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLValidator.java,v 1.1.2.5 2000/10/05 01:59:29 andyc Exp $
+ * @version $Id: XMLValidator.java,v 1.1.2.6 2000/10/06 17:50:01 andyc Exp $
*/
public class XMLValidator
implements XMLComponent, XMLDocumentFilter {
@@ -260,10 +260,8 @@
* characters
*
* @param text
- * @param whitespace
*/
- public void characters(XMLString text, boolean whitespace)
- throws SAXException {
+ public void characters(XMLString text) throws SAXException {
} // characters
/**
No revision
No revision
1.1.2.4 +2 -4 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java
Index: XMLDocumentHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XMLDocumentHandler.java 2000/10/05 01:59:30 1.1.2.3
+++ XMLDocumentHandler.java 2000/10/06 17:50:03 1.1.2.4
@@ -65,7 +65,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
- * @version $Id: XMLDocumentHandler.java,v 1.1.2.3 2000/10/05 01:59:30 andyc Exp $
+ * @version $Id: XMLDocumentHandler.java,v 1.1.2.4 2000/10/06 17:50:03 andyc Exp $
*/
public interface XMLDocumentHandler
extends XMLEntityHandler {
@@ -137,10 +137,8 @@
* characters
*
* @param text
- * @param whitespace
*/
- public void characters(XMLString text, boolean whitespace)
- throws SAXException;
+ public void characters(XMLString text) throws SAXException;
/**
* ignorableWhitespace
No revision
No revision
1.1.2.15 +2 -4 xml-xerces/java/src/org/apache/xerces/parsers/Attic/XMLDocumentParser.java
Index: XMLDocumentParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/XMLDocumentParser.java,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -r1.1.2.14 -r1.1.2.15
--- XMLDocumentParser.java 2000/10/06 03:49:35 1.1.2.14
+++ XMLDocumentParser.java 2000/10/06 17:50:05 1.1.2.15
@@ -77,7 +77,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
* @author Arnaud Le Hors, IBM
- * @version $Id: XMLDocumentParser.java,v 1.1.2.14 2000/10/06 03:49:35 andyc Exp $
+ * @version $Id: XMLDocumentParser.java,v 1.1.2.15 2000/10/06 17:50:05 andyc Exp $
*/
public abstract class XMLDocumentParser
extends XMLParser
@@ -264,10 +264,8 @@
* characters
*
* @param text
- * @param whitespace
*/
- public void characters(XMLString text, boolean whitespace)
- throws SAXException {
+ public void characters(XMLString text) throws SAXException {
} // characters
/**
1.12.2.9 +6 -12 xml-xerces/java/src/org/apache/xerces/parsers/SAXParser.java
Index: SAXParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/SAXParser.java,v
retrieving revision 1.12.2.8
retrieving revision 1.12.2.9
diff -u -r1.12.2.8 -r1.12.2.9
--- SAXParser.java 2000/10/02 00:40:12 1.12.2.8
+++ SAXParser.java 2000/10/06 17:50:06 1.12.2.9
@@ -82,7 +82,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: SAXParser.java,v 1.12.2.8 2000/10/02 00:40:12 lehors Exp $
+ * @version $Id: SAXParser.java,v 1.12.2.9 2000/10/06 17:50:06 andyc Exp $
*/
public class SAXParser
extends XMLDocumentParser
@@ -167,18 +167,12 @@
}
}
- public void characters(XMLString text, boolean whitespace)
- throws SAXException {
- if (whitespace) {
- ignorableWhitespace(text);
+ public void characters(XMLString text) throws SAXException {
+ if (fDocumentHandler != null) {
+ fDocumentHandler.characters(text.ch, text.offset, text.length);
}
- else {
- if (fDocumentHandler != null) {
- fDocumentHandler.characters(text.ch, text.offset, text.length);
- }
- if (fContentHandler != null) {
- fContentHandler.characters(text.ch, text.offset, text.length);
- }
+ if (fContentHandler != null) {
+ fContentHandler.characters(text.ch, text.offset, text.length);
}
}