> -----Original Message-----
> From: Lars Martin [mailto:[EMAIL PROTECTED] 
> On Mon, 7 Jan 2002 09:56:10 -0600
> "Timothy M. Dean" <[EMAIL PROTECTED]> wrote:
> 
> > 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.
> 
> Ok. Great. But why no changes in Lexus? Are you calling the 
> setNamespace() method in XUpdateQuery.java interface? Or how 
> to you pass this parameter to Lexus?
> 

No, I did not call setNamespace in the Lexus implementation of the
XUpdateQuery interface. My reasons for not making this change were:

1) At the time I was making this change I had not yet figured out where
the CVS repository for Lexus was, so I was trying to avoid any Lexus
changes if possible.

2) The Xindice implementation (in XUpdateImpl.java) completely overrides
the execute() method defined by the Lexus implementation (in
XUpdateQueryImpl.java). Any changes I made to the Lexus superclass in
order to fix the problem would have had to be duplicated in the XIndice
implementation.

3) Making the change in Lexus would probably be best if we could
refactor Xindice's execute() method a little bit - Not being intimately
familiar with Xindice or Lexus I was a little hesitant to go that far.

Because I didn't call the setNamespace() method, I used an alternate
approach to pass the namespace into Lexus - My approach was a bit of a
hack. I used the fact that the Lexus implementation uses a single static
XPath instance to evaluate its XPath selection. So, I used the static
CommandObject.getXPath() method to get that XPath instance, and then set
the namespace directly on the XPath instance.

Looking back at it now, there are probably a couple of things that be
refactored a bit to allow my changes to be rolled more directly into
Lexus rather than doing it completely within Xindice. It would be
necessary to modify Xindice's implementation of the execute() method so
that it delegates most of the work back to the Lexus implementation (in
it's superclass). It looks like the only Xindice-specific needs are to
do some special checks for "Compressed Nodes" after the query has been
executed. If we could change the implementation to call super.execute()
and then do its compressed node checks, then we could move the namespace
logic into the Lexus superclass, and remove the slight hack I used to
pass namespace nodes directly to the XPath instance.

If you and the Xindice guys (Kimbro and Tom, I presume) would like me to
make these further changes, please let me know and I will give it a
whirl.

- Tim

Reply via email to