jcplerm wrote:
Murray Altheim writes:

All parts of a DOM Document are composed of DOM Nodes -- it's the base
interface. So you can apply it to any portion of a DOM Document, not
just org.w3c.dom.Document. If you can use XUpdate to overwrite portions
of a Document, this should work just fine in manipulating those portions.

Please explain how you can apply your idea to XUpdate.

The problem is that the XUpdateQueryService's update methods
don't take DOM trees as input parameters. They only accept Strings
containing the text of the Xupdate commands.
This means it does not matter how clean I make a DOM tree
in my client application, because, in order to use XUpdate, it
must be serialized to String so it may be passed to XUpdateQueryService.
And from that point on, that's were the useless space-only text nodes
are left.

There is no way of stripping off space (or empty) text nodes
merely with XUpdate commands. All commands (insert-after,
remove, update, etc,etc) must be passed as strings and after
nodes are removed, XUpdate leaves useless empty text nodes
behind that build up the size of the document.

In summary, by using XUpdateQueryService, there is no way of doing
what you are suggesting.

Unless I am missing something.

Perhaps not. I myself don't use XUpdate so I'm unfamiliar with how it works. I suggested the Node.normalize() method since that's how in the DOM one would trim whitespace (i.e., convert a bunch of separate but contiguous DOM Text nodes into one). Since from what you say it can't happen client-side, it sounds like this might be either the default behaviour or an optional feature on XUpdate itself, in order to keep the kind of problem you're describing from occurring over time in documents stored within Xindice. (Myself, I'd probably want it as a feature setable via a system property. My own development lately has had me digging deep into another aspect of my application, so I've not attempted integrating the 1.1 code; still using 1.0).

Murray

...........................................................................
Murray Altheim                         http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK                    .

       "There's a lot of intelligence out there that you don't
        know if it's true or not."  -- Anonymous US official
        http://news.bbc.co.uk/1/hi/world/middle_east/3014850.stm



Reply via email to