santiagopg 02/05/23 07:52:09
Modified: java/src/org/apache/xalan/xsltc/cmdline Transform.java
java/src/org/apache/xalan/xsltc/compiler/util
ErrorMessages.java
Log:
Added "-n" option to Transform.
Revision Changes Path
1.18 +12 -10
xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java
Index: Transform.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Transform.java 22 May 2002 22:42:45 -0000 1.17
+++ Transform.java 23 May 2002 14:52:09 -0000 1.18
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Transform.java,v 1.17 2002/05/22 22:42:45 santiagopg Exp $
+ * @(#)$Id: Transform.java,v 1.18 2002/05/23 14:52:09 santiagopg Exp $
*
* The Apache Software License, Version 1.1
*
@@ -208,7 +208,12 @@
tohFactory.setEncoding(_translet._encoding);
tohFactory.setOutputMethod(_translet._method);
- if (_iterations > 1) {
+ if (_iterations == -1) {
+ translet.transform(dom, _useExperimentalOutputSystem ?
+ tohFactory.getTransletOutputHandler() :
+
tohFactory.getOldTransletOutputHandler());
+ }
+ else if (_iterations > 0) {
long mm = System.currentTimeMillis();
for (int i = 0; i < _iterations; i++) {
translet.transform(dom, _useExperimentalOutputSystem ?
@@ -217,13 +222,10 @@
}
mm = System.currentTimeMillis() - mm;
- System.err.println("transform = " + (mm / _iterations) + "
ms");
- System.err.println("throughput = " + (1000.0 / (mm /
_iterations)) + " tps");
- }
- else {
- translet.transform(dom, _useExperimentalOutputSystem ?
- tohFactory.getTransletOutputHandler() :
-
tohFactory.getOldTransletOutputHandler());
+ System.err.println("\n<!--");
+ System.err.println(" transform = " + (mm / _iterations) + "
ms");
+ System.err.println(" throughput = " + (1000.0 / (mm /
_iterations)) + " tps");
+ System.err.println("-->");
}
}
catch (TransletException e) {
@@ -296,7 +298,7 @@
try {
if (args.length > 0) {
int i;
- int iterations = 1;
+ int iterations = -1;
boolean uri = false, debug = false;
boolean isJarFileSpecified = false;
String jarFile = null;
1.11 +5 -3
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java
Index: ErrorMessages.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ErrorMessages.java 6 May 2002 17:52:55 -0000 1.10
+++ ErrorMessages.java 23 May 2002 14:52:09 -0000 1.11
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: ErrorMessages.java,v 1.10 2002/05/06 17:52:55 santiagopg Exp $
+ * @(#)$Id: ErrorMessages.java,v 1.11 2002/05/23 14:52:09 santiagopg Exp $
*
* The Apache Software License, Version 1.1
*
@@ -246,8 +246,8 @@
// TRANSFORM_USAGE_STR
"SYNOPSIS \n" +
" java org.apache.xalan.xsltc.cmdline.Transform [-j <jarfile>]\n"+
- " [-x] [-s] {-u <document_url> | <document>} <class>\n" +
- " [<param1>=<value1> ...]\n\n" +
+ " [-x] [-s] [-n <iterations>] {-u <document_url> |
<document>}\n" +
+ " <class> [<param1>=<value1> ...]\n\n" +
" uses the translet <class> to transform an XML document \n"+
" specified as <document>. The translet <class> is either in\n"+
" the user's CLASSPATH or in the optionally specified <jarfile>.\n"+
@@ -255,6 +255,8 @@
" -j <jarfile> specifies a jarfile from which to load translet\n"+
" -x turns on additional debugging message output\n" +
" -s disables calling System.exit\n" +
+ " -n <iterations> runs the transformation <iterations> times and\n" +
+ " displays profiling information\n" +
" -u <document_url> specifies XML input document as a URL\n",
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]