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:
parent
4f7be003f3
commit
f3fec278ee
@ -75,7 +75,7 @@ import javax.xml.transform.*;
|
|||||||
import javax.xml.transform.sax.SAXSource;
|
import javax.xml.transform.sax.SAXSource;
|
||||||
|
|
||||||
import org.apache.xml.resolver.Catalog;
|
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.helpers.Debug;
|
||||||
import org.apache.xml.resolver.tools.CatalogResolver;
|
import org.apache.xml.resolver.tools.CatalogResolver;
|
||||||
|
|
||||||
@ -120,11 +120,13 @@ import org.apache.xml.resolver.tools.CatalogResolver;
|
|||||||
*
|
*
|
||||||
* @version 1.0 */
|
* @version 1.0 */
|
||||||
public class resolver {
|
public class resolver {
|
||||||
|
private static Debug debug = CatalogManager.getStaticManager().debug;
|
||||||
|
|
||||||
/** The main entry point */
|
/** The main entry point */
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
throws FileNotFoundException, IOException {
|
throws FileNotFoundException, IOException {
|
||||||
|
|
||||||
int debug = 0;
|
int debuglevel = 0;
|
||||||
Vector catalogFiles = new Vector();
|
Vector catalogFiles = new Vector();
|
||||||
int resType = 0;
|
int resType = 0;
|
||||||
String resTypeStr = null;
|
String resTypeStr = null;
|
||||||
@ -174,9 +176,9 @@ public class resolver {
|
|||||||
++i;
|
++i;
|
||||||
String debugstr = args[i];
|
String debugstr = args[i];
|
||||||
try {
|
try {
|
||||||
debug = Integer.parseInt(debugstr);
|
debuglevel = Integer.parseInt(debugstr);
|
||||||
if (debug >= 0) {
|
if (debuglevel > 0) {
|
||||||
Debug.setDebug(debug);
|
debug.setDebug(debuglevel);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// nop
|
// nop
|
||||||
@ -247,7 +249,7 @@ public class resolver {
|
|||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
String userdir = System.getProperty("user.dir");
|
String userdir = System.getProperty("user.dir");
|
||||||
userdir.replace('\\', '/');
|
userdir.replace('\\', '/');
|
||||||
Debug.message(1, "Malformed URL on cwd", userdir);
|
debug.message(1, "Malformed URL on cwd", userdir);
|
||||||
base = null;
|
base = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +260,7 @@ public class resolver {
|
|||||||
try {
|
try {
|
||||||
sysid = new URL("file:///" + systemId);
|
sysid = new URL("file:///" + systemId);
|
||||||
} catch (MalformedURLException e2) {
|
} catch (MalformedURLException e2) {
|
||||||
Debug.message(1, "Malformed URL on system id", systemId);
|
debug.message(1, "Malformed URL on system id", systemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,7 @@ import javax.xml.parsers.*;
|
|||||||
|
|
||||||
import org.apache.xml.resolver.tools.ResolvingParser;
|
import org.apache.xml.resolver.tools.ResolvingParser;
|
||||||
import org.apache.xml.resolver.Catalog;
|
import org.apache.xml.resolver.Catalog;
|
||||||
|
import org.apache.xml.resolver.CatalogManager;
|
||||||
import org.apache.xml.resolver.helpers.Debug;
|
import org.apache.xml.resolver.helpers.Debug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,18 +117,19 @@ import org.apache.xml.resolver.helpers.Debug;
|
|||||||
*
|
*
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class xparse
|
public class xparse {
|
||||||
{
|
private static Debug debug = CatalogManager.getStaticManager().debug;
|
||||||
|
|
||||||
/** The main entry point */
|
/** The main entry point */
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
throws FileNotFoundException, IOException {
|
throws FileNotFoundException, IOException {
|
||||||
|
|
||||||
String xmlfile = null;
|
String xmlfile = null;
|
||||||
int debug = 0;
|
int debuglevel = 0;
|
||||||
int maxErrs = 10;
|
int maxErrs = 10;
|
||||||
boolean nsAware = true;
|
boolean nsAware = true;
|
||||||
boolean validating = true;
|
boolean validating = true;
|
||||||
boolean showWarnings = (debug > 2);
|
boolean showWarnings = (debuglevel > 2);
|
||||||
boolean showErrors = true;
|
boolean showErrors = true;
|
||||||
Vector catalogFiles = new Vector();
|
Vector catalogFiles = new Vector();
|
||||||
|
|
||||||
@ -162,10 +164,10 @@ public class xparse
|
|||||||
++i;
|
++i;
|
||||||
String debugstr = args[i];
|
String debugstr = args[i];
|
||||||
try {
|
try {
|
||||||
debug = Integer.parseInt(debugstr);
|
debuglevel = Integer.parseInt(debugstr);
|
||||||
if (debug >= 0) {
|
if (debuglevel >= 0) {
|
||||||
Debug.setDebug(debug);
|
debug.setDebug(debuglevel);
|
||||||
showWarnings = (debug > 2);
|
showWarnings = (debuglevel > 2);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// nop
|
// nop
|
||||||
|
|||||||
@ -72,6 +72,7 @@ import javax.xml.parsers.*;
|
|||||||
|
|
||||||
import org.apache.xml.resolver.tools.ResolvingXMLReader;
|
import org.apache.xml.resolver.tools.ResolvingXMLReader;
|
||||||
import org.apache.xml.resolver.Catalog;
|
import org.apache.xml.resolver.Catalog;
|
||||||
|
import org.apache.xml.resolver.CatalogManager;
|
||||||
import org.apache.xml.resolver.helpers.Debug;
|
import org.apache.xml.resolver.helpers.Debug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,16 +116,18 @@ import org.apache.xml.resolver.helpers.Debug;
|
|||||||
*/
|
*/
|
||||||
public class xread
|
public class xread
|
||||||
{
|
{
|
||||||
|
private static Debug debug = CatalogManager.getStaticManager().debug;
|
||||||
|
|
||||||
/** The main entry point */
|
/** The main entry point */
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
throws FileNotFoundException, IOException {
|
throws FileNotFoundException, IOException {
|
||||||
|
|
||||||
String xmlfile = null;
|
String xmlfile = null;
|
||||||
int debug = 0;
|
int debuglevel = 0;
|
||||||
int maxErrs = 10;
|
int maxErrs = 10;
|
||||||
boolean nsAware = true;
|
boolean nsAware = true;
|
||||||
boolean validating = true;
|
boolean validating = true;
|
||||||
boolean showWarnings = (debug > 2);
|
boolean showWarnings = (debuglevel > 2);
|
||||||
boolean showErrors = true;
|
boolean showErrors = true;
|
||||||
Vector catalogFiles = new Vector();
|
Vector catalogFiles = new Vector();
|
||||||
|
|
||||||
@ -159,10 +162,10 @@ public class xread
|
|||||||
++i;
|
++i;
|
||||||
String debugstr = args[i];
|
String debugstr = args[i];
|
||||||
try {
|
try {
|
||||||
debug = Integer.parseInt(debugstr);
|
debuglevel = Integer.parseInt(debugstr);
|
||||||
if (debug >= 0) {
|
if (debuglevel >= 0) {
|
||||||
Debug.setDebug(debug);
|
debug.setDebug(debuglevel);
|
||||||
showWarnings = (debug > 2);
|
showWarnings = (debuglevel > 2);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// nop
|
// nop
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user