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

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: [EMAIL PROTECTED]
================================================================

Reply via email to