You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2001/07/06 15:11:34 UTC

[Xalan-J 2.2.0D6]: Strange problems with DOM and XPath

Hi,

we are heavily using DOM and DocumentFragments. From time
to time we get an exception when we use namespaces in the
DOM and query it with the XPathAPI.

Unfortunately I can't build a simple testcase as the
DOM is build up during an application. Each step the user
makes acts on the dom.
Most times this is working even with nodes containing
namespaces, but at a destinct point if we add new nodes
with a new namespace (it's the fourth namespace used,
although it might not be reliable), remove them and
then do a simple XPathAPI.selectNodeList(Document, "root/hallo"/)
this fails with the following exception:

java.lang.NullPointerException&#13;
        at
org.apache.xml.utils.SuballocatedIntVector.elementAt(SuballocatedIntVector.j
ava:440)&#13;
        at
org.apache.xml.dtm.ref.DTMDefaultBase._exptype(DTMDefaultBase.java:485)&#13;
        at
org.apache.xml.dtm.ref.DTMDefaultBase.getExpandedTypeID(DTMDefaultBase.java:
1362)&#13;
        at
org.apache.xml.dtm.ref.DTMDefaultBase.declareNamespaceInContext(DTMDefaultBa
se.java:1044)&#13;
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:213)&#13;
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:507)&#13;
        at
org.apache.xml.dtm.ref.DTMDefaultBase._nextsib(DTMDefaultBase.java:579)&#13;
        at
org.apache.xml.dtm.ref.DTMDefaultBaseTraversers$ChildTraverser.next(DTMDefau
ltBaseTraversers.java:462)&#13;
        at
org.apache.xpath.axes.AxesWalker.getNextNode(AxesWalker.java:354)&#13;
        at
org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java:385)&#13;
        at
org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:182)&#13
;
        at
org.apache.xpath.axes.LocPathIterator.runTo(LocPathIterator.java:802)&#13;
        at
org.apache.xml.dtm.ref.DTMNodeList.&lt;init&gt;(DTMNodeList.java:114)&#13;
        at
org.apache.xpath.objects.XNodeSet.nodelist(XNodeSet.java:349)&#13;
        at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:205)&#13;
        at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:182)&#13;

I turned on namespace handling for the DocumentFactory.

I know this is not a very helpful bug description, but perhaps it helps in
finding it.


Carsten

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: cziegeler@sundn.de
================================================================