These apps still use the static CatalogManager by default; so make sure we use that manager's debug object for messages

git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226011 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ndw 2002-11-13 20:55:47 +00:00
parent 4f7be003f3
commit f3fec278ee
3 changed files with 28 additions and 21 deletions

View File

@ -75,7 +75,7 @@ import javax.xml.transform.*;
import javax.xml.transform.sax.SAXSource;
import org.apache.xml.resolver.Catalog;
import org.apache.xml.resolver.tools.CatalogResolver;
import org.apache.xml.resolver.CatalogManager;
import org.apache.xml.resolver.helpers.Debug;
import org.apache.xml.resolver.tools.CatalogResolver;
@ -120,11 +120,13 @@ import org.apache.xml.resolver.tools.CatalogResolver;
*
* @version 1.0 */
public class resolver {
private static Debug debug = CatalogManager.getStaticManager().debug;
/** The main entry point */
public static void main (String[] args)
throws FileNotFoundException, IOException {
int debug = 0;
int debuglevel = 0;
Vector catalogFiles = new Vector();
int resType = 0;
String resTypeStr = null;
@ -174,9 +176,9 @@ public class resolver {
++i;
String debugstr = args[i];
try {
debug = Integer.parseInt(debugstr);
if (debug >= 0) {
Debug.setDebug(debug);
debuglevel = Integer.parseInt(debugstr);
if (debuglevel > 0) {
debug.setDebug(debuglevel);
}
} catch (Exception e) {
// nop
@ -247,7 +249,7 @@ public class resolver {
} catch (MalformedURLException e) {
String userdir = System.getProperty("user.dir");
userdir.replace('\\', '/');
Debug.message(1, "Malformed URL on cwd", userdir);
debug.message(1, "Malformed URL on cwd", userdir);
base = null;
}
@ -258,7 +260,7 @@ public class resolver {
try {
sysid = new URL("file:///" + systemId);
} catch (MalformedURLException e2) {
Debug.message(1, "Malformed URL on system id", systemId);
debug.message(1, "Malformed URL on system id", systemId);
}
}
}

View File

@ -72,6 +72,7 @@ import javax.xml.parsers.*;
import org.apache.xml.resolver.tools.ResolvingParser;
import org.apache.xml.resolver.Catalog;
import org.apache.xml.resolver.CatalogManager;
import org.apache.xml.resolver.helpers.Debug;
/**
@ -116,18 +117,19 @@ import org.apache.xml.resolver.helpers.Debug;
*
* @version 1.0
*/
public class xparse
{
public class xparse {
private static Debug debug = CatalogManager.getStaticManager().debug;
/** The main entry point */
public static void main (String[] args)
throws FileNotFoundException, IOException {
String xmlfile = null;
int debug = 0;
int debuglevel = 0;
int maxErrs = 10;
boolean nsAware = true;
boolean validating = true;
boolean showWarnings = (debug > 2);
boolean showWarnings = (debuglevel > 2);
boolean showErrors = true;
Vector catalogFiles = new Vector();
@ -162,10 +164,10 @@ public class xparse
++i;
String debugstr = args[i];
try {
debug = Integer.parseInt(debugstr);
if (debug >= 0) {
Debug.setDebug(debug);
showWarnings = (debug > 2);
debuglevel = Integer.parseInt(debugstr);
if (debuglevel >= 0) {
debug.setDebug(debuglevel);
showWarnings = (debuglevel > 2);
}
} catch (Exception e) {
// nop

View File

@ -72,6 +72,7 @@ import javax.xml.parsers.*;
import org.apache.xml.resolver.tools.ResolvingXMLReader;
import org.apache.xml.resolver.Catalog;
import org.apache.xml.resolver.CatalogManager;
import org.apache.xml.resolver.helpers.Debug;
/**
@ -115,16 +116,18 @@ import org.apache.xml.resolver.helpers.Debug;
*/
public class xread
{
private static Debug debug = CatalogManager.getStaticManager().debug;
/** The main entry point */
public static void main (String[] args)
throws FileNotFoundException, IOException {
String xmlfile = null;
int debug = 0;
int debuglevel = 0;
int maxErrs = 10;
boolean nsAware = true;
boolean validating = true;
boolean showWarnings = (debug > 2);
boolean showWarnings = (debuglevel > 2);
boolean showErrors = true;
Vector catalogFiles = new Vector();
@ -159,10 +162,10 @@ public class xread
++i;
String debugstr = args[i];
try {
debug = Integer.parseInt(debugstr);
if (debug >= 0) {
Debug.setDebug(debug);
showWarnings = (debug > 2);
debuglevel = Integer.parseInt(debugstr);
if (debuglevel >= 0) {
debug.setDebug(debuglevel);
showWarnings = (debuglevel > 2);
}
} catch (Exception e) {
// nop