(It may be my misunderstandnig of how things work or are intented to, in which case please illuminate me)
I have found a few problems when manipulating DOM objects returned by Xindice's "queryAsDOM".
Especially when mixing DOM objects created by JDK's (Xerces?) implementation and then ones returned by Xindice.
For example, methods like Node.cloneNode or Document.importNode either return null or just fail, or do not do anything at all.
When trying to add a Xindice Element into a Xerces Document, you'll get an Exception saying that the Element belongs to another Document, but importing it doesn't work.
Other things like Element.removeAttributeNode(Attr) did not work right, also. Instead I had to use Element.removeAttribute(String)
I've noticed that with Xindice's implementation yuo can just add a Node happily a hundred times into a Document without needing to clone it. This may be a bug or a feature :-)
When traversing an XML hierarchy, a Xerces implementation has #Text nodes (even empty) within each Element. Xindice does not (unless they exist explicitly). This, also, may be a bug or a feature, but in this case you can't use the same code to process both kinds of Documents unless you take extra care and ask the type of node each time.
(For example getFirstChild may return a #Text node in a Xerces document but will return the first Element in a Xindice document)
Well, in sum, there are many inconsistencies/incompatibilities in Xindice's implementation of org.w3c.dom package, either with other implementations as well as within itself.
And this brings the next question: Why does Xindice even need its own implementation???????????????
Ok. as I said above, these doubts may come from the fact that I don't understand the internals of Xindice and I'm still learning DOM processing with Java. But in any case, please the responsible coder or whoever may tell us what's going on?
Thanks,
BarZ
ADSL para estar en internet las 24 horas a máxima velocidad y sin ocupar el teléfono.
-----------------------------------------------------------
http://www.internet.com.uy Tel. 707.42.52