/[Apache-SVN]
ViewVC logotype

Revision 884287


Jump to revision: Previous Next
Author: zongaro
Date: Wed Nov 25 21:55:09 2009 UTC (14 years, 5 months ago)
Changed paths: 3
Log Message:
Applying patch contributed by Martin von Gagern for XALANJ-2493 and XALANJ-2424.

Quoting from Martin, "The current implementation of nodeList2Iterator is
broken, because it can not deal with attribute nodes. It relies on copyNodes
which in turn tries to add attribute nodes as children of some top level node.
Attributes don't live on the children axis, though, so this is against DOM and
causes a DOM exception in the Xerces DOM implementation and probably most other
implementations. The resulting HIERARCHY_REQUEST_ERR was noted e.g. in
XALANJ-2424.  Furthermore, the implementation is inefficient, because it
manually copies each and every node from the source document to a new DTM to
some new DTM....

I dropped copyNodes in favor of Document.importNode, to avoid code duplication
and rely on supposedly more heavily tested code. I also added another level of
elements, so that there is one such dummy node for every item of the source
list, with always a single child or element. A few assertions help ensure this
single child policy. This is especially important in the new implementation,
because otherwise it would become difficult to get the proxied nodes and the
newly DTMified nodes into correct order.

Changed paths

Path Details
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/dom/ArrayNodeListIterator.java added
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java modified , text changed
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/runtime/InternalRuntimeError.java added

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26