Index: XUpdateQueryImpl.java =================================================================== RCS file: /home/cvs/xmldb/xupdate/src/org/xmldb/xupdate/lexus/XUpdateQueryImpl.jav a,v retrieving revision 1.2 diff -u -r1.2 XUpdateQueryImpl.java --- XUpdateQueryImpl.java 2001/11/29 22:58:01 1.2 +++ XUpdateQueryImpl.java 2002/01/03 21:49:36 @@ -60,6 +60,7 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; +import java.util.HashMap; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -104,8 +105,10 @@ protected NodeFilter _filter = null; /* */ protected Node _namespace = null; - - + + protected HashMap _namespaces = null; + + /** * */ @@ -129,6 +132,7 @@ throw new SAXException( e.getMessage( ) ); } + _namespaces = xuParser.getNamespaceMappings(); _query = xuParser.getCachedQuery( ); if (_query[0].size()==0) { throw new SAXException( "query contains no XUpdateOperation !" ); Index: XUpdateQueryParser.java =================================================================== RCS file: /home/cvs/xmldb/xupdate/src/org/xmldb/xupdate/lexus/XUpdateQueryParser.j ava,v retrieving revision 1.2 diff -u -r1.2 XUpdateQueryParser.java --- XUpdateQueryParser.java 2001/11/29 22:58:01 1.2 +++ XUpdateQueryParser.java 2002/01/03 21:49:51 @@ -62,6 +62,7 @@ import java.util.Hashtable; import java.util.Vector; +import java.util.HashMap; /** * This class parses the query-String by a SAXParser. The SAXEvents are
@@ -78,6 +79,8 @@ protected Vector _attributes = null; /* The list of all characters for each element. */ protected Vector _characters = null; + /* The list of mappings for namespace prefixes */ + protected HashMap _namespaces = null; /* The Integer representation of each XUpdate-command. */ protected CommandConstants _consts = null; /* A flag indicating whether we are within an XUpdateOperation. */ @@ -93,6 +96,7 @@ _commands = new Vector(); _attributes = new Vector(); _characters = new Vector(); + _namespaces = new HashMap(); } @@ -182,6 +186,12 @@ * */ public void startPrefixMapping( String prefix, String uri ) { + if ((prefix != null) && (prefix.length() > 0)) { + _namespaces.put(prefix, uri); + } + else { + _namespaces.put(null, uri); + } } @@ -244,6 +254,10 @@ */ public Vector[] getCachedQuery( ) { return new Vector[]{ _commands, _attributes, _characters }; + } + + public HashMap getNamespaceMappings() { + return _namespaces; } }