You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by tn...@ca.ibm.com on 2000/12/07 17:27:21 UTC

Re: Some fixes to Range

Yesterday I've checked in further fixes to Range which include:

1. port the rework of RangeImpl::traverseContents architecture from
Xerces-J to Xerces-C.  This RangeImpl::traverseContents(TraveralType how)
becomes the master routine to visit the nodes selected by this range.  For
each such node, different actions are taken depending on the value of the
TraversalType argument. (CLONE_CONTENTS, EXTRACT_CONTENTS, and
DELETE_CONTENTS).  As a result, the cloneContent(), extractContent(), and
deleteContent() are just a wrapper to traverseContents().  Besides several
traverseContents() bugs and abends are fixed as well.

2. Correct exception handling as specified in the DOM 2.0 spec.  New
functions RangeImpl::hasLegalRootContainer() and
RangeImpl::isLegalContainedNode() are added.  This is also ported from
Xerces-J.

3. Further fixes to RangeImpl::toString() which did not visit children of
non-Text parent nodes.

4. Ranges were not updated correctly after document mutation.
RangeImpl::updateRangeForDeletedNode(), and
RangeImpl::updateRangeForInsertedNode() are fixed.

5. RangeImpl::recurseTreeAndCheck() went beyond the end-node.  Fixed the
for-loop condition so as to exit correctly.

Besides I have updated RangeTest.cpp with more range test coverage, and
corrected certain test expectation.

Regards,

Tinny Ng
XML Parsers Development
IBM Toronto Laboratory, email: tng@ca.ibm.com