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...@apache.org on 2001/07/02 08:04:53 UTC

cvs commit: xml-xerces/java/samples/xni Counter.java

andyc       01/07/01 23:04:53

  Modified:    java/samples/dom Tag: xerces_j_2 Counter.java
               java/samples/sax Tag: xerces_j_2 Counter.java
               java/samples/xni Tag: xerces_j_2 Counter.java
  Log:
  Added new feature to counter samples to allow a repetition parameter.
  The counter will run X times and display an average parse time. This
  is useful for small files where the timing is not fine-grained enough
  to tell much difference.
  Also added a parameter to allow the user to turn on/off namespace
  prefixes in SAX/XNI.
  Fixed super minor problems in samples.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +74 -14    xml-xerces/java/samples/dom/Attic/Counter.java
  
  Index: Counter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/Attic/Counter.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- Counter.java	2001/04/16 05:42:21	1.1.2.4
  +++ Counter.java	2001/07/02 06:04:51	1.1.2.5
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -87,7 +87,7 @@
    *
    * @author Andy Clark, IBM
    *
  - * @version $Id: Counter.java,v 1.1.2.4 2001/04/16 05:42:21 andyc Exp $
  + * @version $Id: Counter.java,v 1.1.2.5 2001/07/02 06:04:51 andyc Exp $
    */
   public class Counter {
   
  @@ -100,6 +100,9 @@
       /** Namespaces feature id (http://xml.org/sax/features/namespaces). */
       protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
       
  +    /** Namespace prefixes feature id (http://xml.org/sax/features/namespace-prefixes). */
  +    protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes";
  +
       /** Validation feature id (http://xml.org/sax/features/validation). */
       protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
   
  @@ -111,9 +114,15 @@
       /** Default parser name (dom.wrappers.Xerces). */
       protected static final String DEFAULT_PARSER_NAME = "dom.wrappers.Xerces";
   
  +    /** Default repetition (1). */
  +    protected static final int DEFAULT_REPETITION = 1;
  +
       /** Default namespaces support (true). */
       protected static final boolean DEFAULT_NAMESPACES = true;
   
  +    /** Default namespace prefixes (false). */
  +    protected static final boolean DEFAULT_NAMESPACE_PREFIXES = false;
  +
       /** Default validation support (false). */
       protected static final boolean DEFAULT_VALIDATION = false;
       
  @@ -210,15 +219,25 @@
   
       /** Prints the results. */
       public void printResults(PrintWriter out, String uri, 
  -                             long parse, long traverse1, long traverse2) {
  +                             long parse, long traverse1, long traverse2,
  +                             int repetition) {
   
           // filename.xml: 631/200/100 ms (4 elems, 0 attrs, 78 spaces, 0 chars)
           out.print(uri);
           out.print(": ");
  -        out.print(parse);
  -        out.print('/');
  +        if (repetition == 1) {
  +            out.print(parse);
  +        }
  +        else {
  +            out.print(parse);
  +            out.print('/');
  +            out.print(repetition);
  +            out.print('=');
  +            out.print(parse/repetition);
  +        }
  +        out.print(';');
           out.print(traverse1);
  -        out.print('/');
  +        out.print(';');
           out.print(traverse2);
           out.print(" ms (");
           out.print(fElements);
  @@ -251,7 +270,9 @@
           Counter counter = new Counter();
           PrintWriter out = new PrintWriter(System.out);
           ParserWrapper parser = null;
  +        int repetition = DEFAULT_REPETITION;
           boolean namespaces = DEFAULT_NAMESPACES;
  +        boolean namespacePrefixes = DEFAULT_NAMESPACE_PREFIXES;
           boolean validation = DEFAULT_VALIDATION;
           boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
           
  @@ -277,10 +298,33 @@
                       }
                       continue;
                   }
  +                if (option.equals("x")) {
  +                    if (++i == argv.length) {
  +                        System.err.println("error: Missing argument to -x option.");
  +                        continue;
  +                    }
  +                    String number = argv[i];
  +                    try {
  +                        int value = Integer.parseInt(number);
  +                        if (value < 1) {
  +                            System.err.println("error: Repetition must be at least 1.");
  +                            continue;
  +                        }
  +                        repetition = value;
  +                    }
  +                    catch (NumberFormatException e) {
  +                        System.err.println("error: invalid number ("+number+").");
  +                    }
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("n")) {
                       namespaces = option.equals("n");
                       continue;
                   }
  +                if (option.equalsIgnoreCase("np")) {
  +                    namespacePrefixes = option.equals("np");
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("v")) {
                       validation = option.equals("v");
                       continue;
  @@ -316,6 +360,12 @@
                   System.err.println("warning: Parser does not support feature ("+NAMESPACES_FEATURE_ID+")");
               }
               try {
  +                parser.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, namespacePrefixes);
  +            }
  +            catch (SAXException e) {
  +                System.err.println("warning: Parser does not support feature ("+NAMESPACE_PREFIXES_FEATURE_ID+")");
  +            }
  +            try {
                   parser.setFeature(VALIDATION_FEATURE_ID, validation);
               }
               catch (SAXException e) {
  @@ -331,7 +381,10 @@
               // parse file
               try {
                   long beforeParse = System.currentTimeMillis();
  -                Document document = parser.parse(arg);
  +                Document document = null;
  +                for (int j = 0; j < repetition; j++) {
  +                    document = parser.parse(arg);
  +                }
                   long afterParse = System.currentTimeMillis();
                   long parse = afterParse - beforeParse;
   
  @@ -347,7 +400,8 @@
                   counter.count(document);
                   long afterTraverse2 = System.currentTimeMillis();
                   long traverse2 = afterTraverse2 - beforeTraverse2;
  -                counter.printResults(out, arg, parse, traverse1, traverse2);
  +                counter.printResults(out, arg, parse, traverse1, traverse2,
  +                                     repetition);
               }
               catch (SAXParseException e) {
                   // ignore
  @@ -374,18 +428,24 @@
           System.err.println();
           
           System.err.println("options:");
  -        System.err.println("  -p name  Select parser by name.");
  -        System.err.println("  -n | -N  Turn on/off namespace processing.");
  -        System.err.println("  -v | -V  Turn on/off validation.");
  -        System.err.println("  -s | -S  Turn on/off Schema validation support.");
  -        System.err.println("           NOTE: Not supported by all parsers.");
  -        System.err.println("  -h       This help screen.");
  +        System.err.println("  -p name     Select parser by name.");
  +        System.err.println("  -x number   Select number of repetitions.");
  +        System.err.println("  -n  | -N    Turn on/off namespace processing.");
  +        System.err.println("  -np | -NP   Turn on/off namespace prefixes.");
  +        System.err.println("              NOTE: Requires use of -n.");
  +        System.err.println("  -v  | -V    Turn on/off validation.");
  +        System.err.println("  -s  | -S    Turn on/off Schema validation support.");
  +        System.err.println("              NOTE: Not supported by all parsers.");
  +        System.err.println("  -h          This help screen.");
           System.err.println();
   
           System.err.println("defaults:");
           System.err.println("  Parser:     "+DEFAULT_PARSER_NAME);
  +        System.err.println("  Repetition: "+DEFAULT_REPETITION);
           System.err.print("  Namespaces: ");
           System.err.println(DEFAULT_NAMESPACES ? "on" : "off");
  +        System.err.print("  Prefixes:   ");
  +        System.err.println(DEFAULT_NAMESPACE_PREFIXES ? "on" : "off");
           System.err.print("  Validation: ");
           System.err.println(DEFAULT_VALIDATION ? "on" : "off");
           System.err.print("  Schema:     ");
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +78 -19    xml-xerces/java/samples/sax/Attic/Counter.java
  
  Index: Counter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/sax/Attic/Counter.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- Counter.java	2001/06/15 04:44:17	1.1.2.6
  +++ Counter.java	2001/07/02 06:04:52	1.1.2.7
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -90,7 +90,7 @@
    *
    * @author Andy Clark, IBM
    *
  - * @version $Id: Counter.java,v 1.1.2.6 2001/06/15 04:44:17 andyc Exp $
  + * @version $Id: Counter.java,v 1.1.2.7 2001/07/02 06:04:52 andyc Exp $
    */
   public class Counter
       extends DefaultHandler {
  @@ -104,6 +104,9 @@
       /** Namespaces feature id (http://xml.org/sax/features/namespaces). */
       protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
       
  +    /** Namespace prefixes feature id (http://xml.org/sax/features/namespace-prefixes). */
  +    protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes";
  +
       /** Validation feature id (http://xml.org/sax/features/validation). */
       protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
   
  @@ -115,9 +118,15 @@
       /** Default parser name. */
       protected static final String DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
   
  +    /** Default repetition (1). */
  +    protected static final int DEFAULT_REPETITION = 1;
  +
       /** Default namespaces support (true). */
       protected static final boolean DEFAULT_NAMESPACES = true;
   
  +    /** Default namespace prefixes (false). */
  +    protected static final boolean DEFAULT_NAMESPACE_PREFIXES = false;
  +
       /** Default validation support (false). */
       protected static final boolean DEFAULT_VALIDATION = false;
       
  @@ -166,12 +175,22 @@
   
       /** Prints the results. */
       public void printResults(PrintWriter out, String uri, long time, 
  -                             long memory, boolean tagginess) {
  +                             long memory, boolean tagginess,
  +                             int repetition) {
   
           // filename.xml: 631 ms (4 elems, 0 attrs, 78 spaces, 0 chars)
           out.print(uri);
           out.print(": ");
  -        out.print(time);
  +        if (repetition == 1) {
  +            out.print(time);
  +        }
  +        else {
  +            out.print(time);
  +            out.print('/');
  +            out.print(repetition);
  +            out.print('=');
  +            out.print(time/repetition);
  +        }
           out.print(" ms");
           if (memory != Long.MIN_VALUE) {
               out.print(", ");
  @@ -331,7 +350,9 @@
           Counter counter = new Counter();
           PrintWriter out = new PrintWriter(System.out);
           XMLReader parser = null;
  +        int repetition = DEFAULT_REPETITION;
           boolean namespaces = DEFAULT_NAMESPACES;
  +        boolean namespacePrefixes = DEFAULT_NAMESPACE_PREFIXES;
           boolean validation = DEFAULT_VALIDATION;
           boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
           boolean memoryUsage = DEFAULT_MEMORY_USAGE;
  @@ -367,10 +388,33 @@
                       }
                       continue;
                   }
  +                if (option.equals("x")) {
  +                    if (++i == argv.length) {
  +                        System.err.println("error: Missing argument to -x option.");
  +                        continue;
  +                    }
  +                    String number = argv[i];
  +                    try {
  +                        int value = Integer.parseInt(number);
  +                        if (value < 1) {
  +                            System.err.println("error: Repetition must be at least 1.");
  +                            continue;
  +                        }
  +                        repetition = value;
  +                    }
  +                    catch (NumberFormatException e) {
  +                        System.err.println("error: invalid number ("+number+").");
  +                    }
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("n")) {
                       namespaces = option.equals("n");
                       continue;
                   }
  +                if (option.equalsIgnoreCase("np")) {
  +                    namespacePrefixes = option.equals("np");
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("v")) {
                       validation = option.equals("v");
                       continue;
  @@ -425,6 +469,12 @@
                   System.err.println("warning: Parser does not support feature ("+NAMESPACES_FEATURE_ID+")");
               }
               try {
  +                parser.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, namespacePrefixes);
  +            }
  +            catch (SAXException e) {
  +                System.err.println("warning: Parser does not support feature ("+NAMESPACE_PREFIXES_FEATURE_ID+")");
  +            }
  +            try {
                   parser.setFeature(VALIDATION_FEATURE_ID, validation);
               }
               catch (SAXException e) {
  @@ -446,14 +496,17 @@
               try {
                   long timeBefore = System.currentTimeMillis();
                   long memoryBefore = Runtime.getRuntime().freeMemory();
  -                parser.parse(arg);
  +                for (int j = 0; j < repetition; j++) {
  +                    parser.parse(arg);
  +                }
                   long memoryAfter = Runtime.getRuntime().freeMemory();
                   long timeAfter = System.currentTimeMillis();
                   
                   long time = timeAfter - timeBefore;
                   long memory = memoryUsage 
                               ? memoryBefore - memoryAfter : Long.MIN_VALUE;
  -                counter.printResults(out, arg, time, memory, tagginess);
  +                counter.printResults(out, arg, time, memory, tagginess,
  +                                     repetition);
               }
               catch (SAXParseException e) {
                   // ignore
  @@ -481,20 +534,26 @@
           
           System.err.println("options:");
           System.err.println("  -p name     Select parser by name.");
  -        System.err.println("  -n | -N     Turn on/off namespace processing.");
  -        System.err.println("  -v | -V     Turn on/off validation.");
  -        System.err.println("  -s | -S     Turn on/off Schema validation support.");
  +        System.err.println("  -x number   Select number of repetitions.");
  +        System.err.println("  -n  | -N    Turn on/off namespace processing.");
  +        System.err.println("  -np | -NP   Turn on/off namespace prefixes.");
  +        System.err.println("              NOTE: Requires use of -n.");
  +        System.err.println("  -v  | -V    Turn on/off validation.");
  +        System.err.println("  -s  | -S    Turn on/off Schema validation support.");
           System.err.println("              NOTE: Not supported by all parsers.");
  -        System.err.println("  -m | -M     Turn on/off memory usage report");
  -        System.err.println("  -t | -T     Turn on/off \"tagginess\" report.");
  +        System.err.println("  -m  | -M    Turn on/off memory usage report");
  +        System.err.println("  -t  | -T    Turn on/off \"tagginess\" report.");
           System.err.println("  --rem text  Output user defined comment before next parse.");
           System.err.println("  -h          This help screen.");
   
           System.err.println();
           System.err.println("defaults:");
           System.err.println("  Parser:     "+DEFAULT_PARSER_NAME);
  +        System.err.println("  Repetition: "+DEFAULT_REPETITION);
           System.err.print("  Namespaces: ");
           System.err.println(DEFAULT_NAMESPACES ? "on" : "off");
  +        System.err.print("  Prefixes:   ");
  +        System.err.println(DEFAULT_NAMESPACE_PREFIXES ? "on" : "off");
           System.err.print("  Validation: ");
           System.err.println(DEFAULT_VALIDATION ? "on" : "off");
           System.err.print("  Schema:     ");
  @@ -510,14 +569,14 @@
           System.err.println("  basis of parser performance comparison! Real analytical methods should be");
           System.err.println("  used. For better results, perform multiple document parses within the same");
           System.err.println("  virtual machine to remove class loading from parse time and memory usage.");
  -        System.out.println();
  -        System.out.println("  The \"tagginess\" measurement gives a rough estimate of the percentage of");
  -        System.out.println("  markup versus content in the XML document. The percent tagginess of a ");
  -        System.out.println("  document is equal to the minimum amount of tag characters required for ");
  -        System.out.println("  elements, attributes, and processing instructions divided by the total");
  -        System.out.println("  amount of characters (characters, ignorable whitespace, and tag characters)");
  -        System.out.println("  in the document.");
  -        System.out.println();
  +        System.err.println();
  +        System.err.println("  The \"tagginess\" measurement gives a rough estimate of the percentage of");
  +        System.err.println("  markup versus content in the XML document. The percent tagginess of a ");
  +        System.err.println("  document is equal to the minimum amount of tag characters required for ");
  +        System.err.println("  elements, attributes, and processing instructions divided by the total");
  +        System.err.println("  amount of characters (characters, ignorable whitespace, and tag characters)");
  +        System.err.println("  in the document.");
  +        System.err.println();
           System.err.println("  Not all features are supported by different parser configurations.");
   
       } // printUsage()
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +83 -18    xml-xerces/java/samples/xni/Attic/Counter.java
  
  Index: Counter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/xni/Attic/Counter.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- Counter.java	2001/06/15 04:44:22	1.1.2.4
  +++ Counter.java	2001/07/02 06:04:53	1.1.2.5
  @@ -89,7 +89,7 @@
    *
    * @author Andy Clark, IBM
    *
  - * @version $Id: Counter.java,v 1.1.2.4 2001/06/15 04:44:22 andyc Exp $
  + * @version $Id: Counter.java,v 1.1.2.5 2001/07/02 06:04:53 andyc Exp $
    */
   public class Counter
       extends XMLDocumentParser 
  @@ -104,6 +104,9 @@
       /** Namespaces feature id (http://xml.org/sax/features/namespaces). */
       protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
       
  +    /** Namespace prefixes feature id (http://xml.org/sax/features/namespace-prefixes). */
  +    protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes";
  +
       /** Validation feature id (http://xml.org/sax/features/validation). */
       protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
   
  @@ -115,9 +118,15 @@
       /** Default parser configuration (org.apache.xerces.parsers.StandardParserConfiguration). */
       protected static final String DEFAULT_PARSER_CONFIG = "org.apache.xerces.parsers.StandardParserConfiguration";
   
  +    /** Default repetition (1). */
  +    protected static final int DEFAULT_REPETITION = 1;
  +
       /** Default namespaces support (true). */
       protected static final boolean DEFAULT_NAMESPACES = true;
   
  +    /** Default namespace prefixes (false). */
  +    protected static final boolean DEFAULT_NAMESPACE_PREFIXES = false;
  +
       /** Default validation support (false). */
       protected static final boolean DEFAULT_VALIDATION = false;
       
  @@ -168,12 +177,22 @@
   
       /** Prints the results. */
       public void printResults(PrintWriter out, String uri, long time, 
  -                             long memory, boolean tagginess) {
  +                             long memory, boolean tagginess,
  +                             int repetition) {
   
           // filename.xml: 631 ms (4 elems, 0 attrs, 78 spaces, 0 chars)
           out.print(uri);
           out.print(": ");
  -        out.print(time);
  +        if (repetition == 1) {
  +            out.print(time);
  +        }
  +        else {
  +            out.print(time);
  +            out.print('/');
  +            out.print(repetition);
  +            out.print('=');
  +            out.print(time/repetition);
  +        }
           out.print(" ms");
           if (memory != Long.MIN_VALUE) {
               out.print(", ");
  @@ -357,7 +376,9 @@
           PrintWriter out = new PrintWriter(System.out);
           XMLDocumentParser parser = null;
           XMLParserConfiguration parserConfig = null;
  +        int repetition = DEFAULT_REPETITION;
           boolean namespaces = DEFAULT_NAMESPACES;
  +        boolean namespacePrefixes = DEFAULT_NAMESPACE_PREFIXES;
           boolean validation = DEFAULT_VALIDATION;
           boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
           boolean memoryUsage = DEFAULT_MEMORY_USAGE;
  @@ -379,6 +400,9 @@
                       // create parser
                       try {
                           parserConfig = (XMLParserConfiguration)Class.forName(parserName).newInstance();
  +                        parserConfig.addRecognizedFeatures(new String[] {
  +                            NAMESPACE_PREFIXES_FEATURE_ID,
  +                        });
                           parser = null;
                       }
                       catch (Exception e) {
  @@ -387,10 +411,33 @@
                       }
                       continue;
                   }
  +                if (option.equals("x")) {
  +                    if (++i == argv.length) {
  +                        System.err.println("error: Missing argument to -x option.");
  +                        continue;
  +                    }
  +                    String number = argv[i];
  +                    try {
  +                        int value = Integer.parseInt(number);
  +                        if (value < 1) {
  +                            System.err.println("error: Repetition must be at least 1.");
  +                            continue;
  +                        }
  +                        repetition = value;
  +                    }
  +                    catch (NumberFormatException e) {
  +                        System.err.println("error: invalid number ("+number+").");
  +                    }
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("n")) {
                       namespaces = option.equals("n");
                       continue;
                   }
  +                if (option.equalsIgnoreCase("np")) {
  +                    namespacePrefixes = option.equals("np");
  +                    continue;
  +                }
                   if (option.equalsIgnoreCase("v")) {
                       validation = option.equals("v");
                       continue;
  @@ -430,6 +477,9 @@
                   // create parser
                   try {
                       parserConfig = (XMLParserConfiguration)Class.forName(DEFAULT_PARSER_CONFIG).newInstance();
  +                    parserConfig.addRecognizedFeatures(new String[] {
  +                        NAMESPACE_PREFIXES_FEATURE_ID,
  +                    });
                   }
                   catch (Exception e) {
                       System.err.println("error: Unable to instantiate parser configuration ("+DEFAULT_PARSER_CONFIG+")");
  @@ -448,6 +498,12 @@
                   System.err.println("warning: Parser does not support feature ("+NAMESPACES_FEATURE_ID+")");
               }
               try {
  +                parser.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, namespacePrefixes);
  +            }
  +            catch (SAXException e) {
  +                System.err.println("warning: Parser does not support feature ("+NAMESPACE_PREFIXES_FEATURE_ID+")");
  +            }
  +            try {
                   parser.setFeature(VALIDATION_FEATURE_ID, validation);
               }
               catch (SAXException e) {
  @@ -467,7 +523,9 @@
               try {
                   long timeBefore = System.currentTimeMillis();
                   long memoryBefore = Runtime.getRuntime().freeMemory();
  -                parser.parse(arg);
  +                for (int j = 0; j < repetition; j++) {
  +                    parser.parse(arg);
  +                }
                   long memoryAfter = Runtime.getRuntime().freeMemory();
                   long timeAfter = System.currentTimeMillis();
                   
  @@ -475,7 +533,8 @@
                   long memory = memoryUsage 
                               ? memoryBefore - memoryAfter : Long.MIN_VALUE;
                   ((Counter)parser).printResults(out, arg, time, 
  -                                               memory, tagginess);
  +                                               memory, tagginess,
  +                                               repetition);
               }
               catch (SAXParseException e) {
                   // ignore
  @@ -503,19 +562,25 @@
           
           System.err.println("options:");
           System.err.println("  -p name     Select parser configuration by name.");
  -        System.err.println("  -n | -N     Turn on/off namespace processing.");
  -        System.err.println("  -v | -V     Turn on/off validation.");
  -        System.err.println("  -s | -S     Turn on/off Schema validation support.");
  -        System.err.println("  -m | -M     Turn on/off memory usage report.");
  -        System.err.println("  -t | -T     Turn on/off \"tagginess\" report.");
  +        System.err.println("  -x number   Select number of repetitions.");
  +        System.err.println("  -n  | -N    Turn on/off namespace processing.");
  +        System.err.println("  -np | -NP   Turn on/off namespace prefixes.");
  +        System.err.println("              NOTE: Requires use of -n.");
  +        System.err.println("  -v  | -V    Turn on/off validation.");
  +        System.err.println("  -s  | -S    Turn on/off Schema validation support.");
  +        System.err.println("  -m  | -M    Turn on/off memory usage report.");
  +        System.err.println("  -t  | -T    Turn on/off \"tagginess\" report.");
           System.err.println("  --rem text  Output user defined comment before next parse.");
           System.err.println("  -h          This help screen.");
   
           System.err.println();
           System.err.println("defaults:");
  -        System.err.println("  Config:      "+DEFAULT_PARSER_CONFIG);
  +        System.err.println("  Config:     "+DEFAULT_PARSER_CONFIG);
  +        System.err.println("  Repetition: "+DEFAULT_REPETITION);
           System.err.print("  Namespaces: ");
           System.err.println(DEFAULT_NAMESPACES ? "on" : "off");
  +        System.err.print("  Prefixes:   ");
  +        System.err.println(DEFAULT_NAMESPACE_PREFIXES ? "on" : "off");
           System.err.print("  Validation: ");
           System.err.println(DEFAULT_VALIDATION ? "on" : "off");
           System.err.print("  Schema:     ");
  @@ -531,14 +596,14 @@
           System.err.println("  basis of parser performance comparison! Real analytical methods should be");
           System.err.println("  used. For better results, perform multiple document parses within the same");
           System.err.println("  virtual machine to remove class loading from parse time and memory usage.");
  +        System.err.println();
  +        System.err.println("  The \"tagginess\" measurement gives a rough estimate of the percentage of");
  +        System.err.println("  markup versus content in the XML document. The percent tagginess of a ");
  +        System.err.println("  document is equal to the minimum amount of tag characters required for ");
  +        System.err.println("  elements, attributes, and processing instructions divided by the total");
  +        System.err.println("  amount of characters (characters, ignorable whitespace, and tag characters)");
  +        System.err.println("  in the document.");
           System.err.println();
  -        System.out.println("  The \"tagginess\" measurement gives a rough estimate of the percentage of");
  -        System.out.println("  markup versus content in the XML document. The percent tagginess of a ");
  -        System.out.println("  document is equal to the minimum amount of tag characters required for ");
  -        System.out.println("  elements, attributes, and processing instructions divided by the total");
  -        System.out.println("  amount of characters (characters, ignorable whitespace, and tag characters)");
  -        System.out.println("  in the document.");
  -        System.out.println();
           System.err.println("  Not all features are supported by different parser configurations.");
   
       } // printUsage()
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org