> jcplerm wrote:
> > I noticed that whenever an element of an XML document is removed by
> > means of an XUpdate remove command, blank spaces are left in place of
> > the removed element.
> >
> > My application does lots of XUpdate removes and appends on medium sized
> > XML docs. As I result I will end up with large documents containing lots
> > of spaces.
> >
> > For example, assuming this is the original XML doc:
> >
> > <doc>
> >     <elem1>xxxx</elem1>
> >     <elem2>xxxx</elem2>
> > </doc>
> >
> > After removing elem2 and adding elem3 this is how that doc would look
> > like after exporting it to a flat text file:
> >
> > <doc>
> >     <elem1>xxxx</elem1>
> >
> >     <elem2>xxxx</elem3>
> > </doc>
> >
> > For relatively static documents, it's not a problem.
> > But even for small docs, if they are extensively through a similar
> > process, they might grow too large, unnecessarily.
> >
> > Could this be considered a bug and be properly fixed?
> > Or is there a straightforward workaround?
>
> If you're manipulating the DOM, have you tried Node.normalize()? It

I guess I would then have to pull the whole document out of the DB
and apply this function, right?
But that's not what I want to do. I simply fetch portions of the
document with XPathQueryService and then update that same
document with XUpdate commands. The goal is to avoid
fetching and massaging the entire document.

But if there is no work around, then I might have to implement
some sort of periodic cleansing of the database documents
based on the function you proposed.

> likely does what you want. There may be an appropriate place to use
> this within Xindice, but I'm not sure where in the code this would
> be applied.
>
> Murray
>

Reply via email to