vgritsenko 2004/05/20 05:21:46
Modified: java/src/org/apache/xindice/tools/command XPathQuery.java
Log:
fail on broken namespace list
Revision Changes Path
1.13 +5 -6
xml-xindice/java/src/org/apache/xindice/tools/command/XPathQuery.java
Index: XPathQuery.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/command/XPathQuery.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XPathQuery.java 8 Feb 2004 02:57:35 -0000 1.12
+++ XPathQuery.java 20 May 2004 12:21:46 -0000 1.13
@@ -47,12 +47,12 @@
Collection col = null;
try {
- if ((String) table.get(XMLTools.COLLECTION) == null) {
+ if (table.get(XMLTools.COLLECTION) == null) {
System.out.println("ERROR : Collection name and switch
required");
return false;
}
- if ((String) table.get(XMLTools.QUERY) == "") {
+ if (table.get(XMLTools.QUERY) == "") {
System.out.println("ERROR : Query and switch required");
return false;
}
@@ -103,8 +103,7 @@
if ((namespacesString != "") && (namespacesString != null)) {
StringTokenizer st = new StringTokenizer(namespacesString, "=;");
if (st.countTokens() % 2 != 0) {
- System.out.println("ERROR : mismatched namespace prefixes
and uris");
- return;
+ throw new XMLDBException(0, "mismatched namespace prefixes
and uris in '" + namespacesString + "'");
}
while (st.hasMoreTokens()) {
service.setNamespace(st.nextToken(), st.nextToken());