Hi Christian,

On Thu, 10 Mar 2005 17:13:21 +0100, Christian Zulehner <[EMAIL PROTECTED]> 
wrote:

> I'd say, that this is normal behaviour! If you don't "normaliz" these
> text-nodes,
> how would you be able to differ between them (if e.g. reading form a file) ?

If you serialize the changed document to file you cannot differ
between the nodes anyway because then the document becomes XML again
and not DOM.

I want to differ between the nodes using XPath queries on DOM
documents. Then the textnodes before and after the <firstname> element
would be /student/name/node()[1] and  /student/name/node()[3]. Now if
I delete the <firstname> element, /student/name/node()[1] and
/student/name/node()[2] (corrected for the deleted node)  do *not*
point to the same textnodes, in fact /student/name/node()[2] now
points to the <lastname> element.

I looked around in Xerces's code and found that in ParentNode's
internalRemoveChild() a call is made to checkNormalizationAfterRemove
and that sets isNormalized(false) causing indeed the two text nodes to
be normalized.

regards,

Jeroen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to