Lars, I will try to summarize as quickly as possible: 1) There was no mechanism to specify namespaces programatically for XUpdate commands. This functionality was defined for XPath queries but not for XUpdate. While it wasn't absolutely needed in XUpdate, it seemed like a good thing from a consistency standpoint. The changes to support this were completely within Xindice and needed no Lexus updates.
2) When trying to specify namespaces directly in the XUpdate command, the Xindice implementation was using the namespace mappings in the target XML documents instead of those within the XUpdate "modifications" XML element. This seemed to be incorrect behavior because the one who is querying a document shouldn't care what NS prefixes were used when storing the document. When querying a document it seemed that only the URI's of the document should matter, and that the querying app should be able to use whichever NS prefixes it chooses (or even a default NS) to make sure it queries with the correct NS URI's. The changes to support this were mostly within Xindice, but it was necessary to patch Lexus so that NS assignments within the XUpdate query were stored for future retrieval by Xindice. Let me know if there are more specific questions. - Tim > -----Original Message----- > From: Lars Martin [mailto:[EMAIL PROTECTED] > Sent: Monday, January 07, 2002 3:33 AM > To: [EMAIL PROTECTED] > Cc: xupdate-dev@xmldb.org > Subject: Re: [PATCH] Lexus namespace mapping enhancements > > > > Hi Tim, > > I don't have the time to follow this discussion that is > already going for a long period. But can you give me a short > answer or description what exactly is the problem with > namespaces in XUpdate/Lexus/XIndice?! > > I'll try to apply your patch asap. > > Many thanks for your work. > > Regards, Lars. > > > > On Thu, 3 Jan 2002 14:00:20 -0600 > "Timothy Dean" <[EMAIL PROTECTED]> wrote: > > > Index: XUpdateQueryImpl.java > > =================================================================== > > RCS file: > > > /home/cvs/xmldb/xupdate/src/org/xmldb/xupdate/lexus/XUpdateQueryImpl.j > > ava,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 > > .java,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; > > } > > } > > > > > -- > ______________________________________________________________________ > Lars Martin mailto:[EMAIL PROTECTED] > SMB GmbH http://www.smb-tec.com > >