You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by je...@locus.apache.org on 2000/06/23 22:29:33 UTC
cvs commit: xml-xerces/java/samples/sax SAX2Count.java SAXCount.java
jeffreyr 00/06/23 13:29:33
Modified: java/samples/sax SAX2Count.java SAXCount.java
Log:
validation message should default to false
Revision Changes Path
1.4 +10 -11 xml-xerces/java/samples/sax/SAX2Count.java
Index: SAX2Count.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/sax/SAX2Count.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SAX2Count.java 2000/06/23 05:23:08 1.3
+++ SAX2Count.java 2000/06/23 20:29:30 1.4
@@ -73,7 +73,7 @@
* register a SAX2 ContentHandler and receive the callbacks in
* order to print information about the document.
*
- * @version $Id: SAX2Count.java,v 1.3 2000/06/23 05:23:08 jeffreyr Exp $
+ * @version $Id: SAX2Count.java,v 1.4 2000/06/23 20:29:30 jeffreyr Exp $
*/
public class SAX2Count
extends DefaultHandler {
@@ -130,17 +130,14 @@
//if (validate)
// parser.setFeature("http://xml.org/sax/features/validation", true);
- if ( parser instanceof XMLReader ){
- ((XMLReader)parser).setFeature( "http://xml.org/sax/features/validation",
- setValidation);
- ((XMLReader)parser).setFeature( "http://xml.org/sax/features/namespaces",
- setNameSpaces );
- ((XMLReader)parser).setFeature( "http://apache.org/xml/features/validation/schema",
- setSchemaSupport );
+ parser.setFeature( "http://xml.org/sax/features/validation",
+ validate);
- }
-
+ parser.setFeature( "http://xml.org/sax/features/namespaces",
+ setNameSpaces );
+ parser.setFeature( "http://apache.org/xml/features/validation/schema",
+ setSchemaSupport );
if (warmup) {
parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true);
@@ -305,7 +302,7 @@
"options:",
" -p name Specify SAX parser by name.",
" -n | -N Turn on/off namespace [default=on]",
- " -v | -V Turn on/off validation [default=on]",
+ " -v | -V Turn on/off validation [default=off]",
" -s | -S Turn on/off Schema support [default=on]",
" -d | -D Turn on/off deferred DOM [default=on]",
" -w Warmup the parser before timing.",
@@ -327,7 +324,9 @@
String arg = null;
while ( ( arg = argopt.getlistFiles() ) != null ) {
outer:
+
while ( (c = argopt.getArguments()) != -1 ){
+ System.out.println( "c =" + c );
switch (c) {
case 'v':
setValidation = true;
1.6 +2 -2 xml-xerces/java/samples/sax/SAXCount.java
Index: SAXCount.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/samples/sax/SAXCount.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SAXCount.java 2000/06/23 05:23:08 1.5
+++ SAXCount.java 2000/06/23 20:29:31 1.6
@@ -131,7 +131,7 @@
//if (validate && parser instanceof XMLReader)
if ( parser instanceof XMLReader ){
((XMLReader)parser).setFeature( "http://xml.org/sax/features/validation",
- setValidation);
+ validate);
((XMLReader)parser).setFeature( "http://xml.org/sax/features/namespaces",
setNameSpaces );
((XMLReader)parser).setFeature( "http://apache.org/xml/features/validation/schema",
@@ -306,7 +306,7 @@
"options:",
" -p name Specify SAX parser by name.",
" -n | -N Turn on/off namespace [default=on]",
- " -v | -V Turn on/off validation [default=on]",
+ " -v | -V Turn on/off validation [default=off]",
" -s | -S Turn on/off Schema support [default=on]",
" -d | -D Turn on/off deferred DOM [default=on]",
" -w Warmup the parser before timing.",