[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

extractDOM: ClassCastException



Hi,
here's my next problem.

My code line is

	    document = ozoneXMLContainer.extractDOM(new
org.apache.xerces.dom.DocumentImpl());

The executed method in XMLContainer is

   public Document extractDOM( Document _domFactory ) throws Exception {
        return (Document) extractDOM( _domFactory, (NodeList)null, null,
-1 );
    }

The other extractDOM method with the NodeList parameter returns a
NodeList,
which cannot be casted to Document, so a ClassCastException is thrown.

I changed the above method to

   public Document extractDOM( Document _domFactory ) throws Exception {
        return (Document) extractDOM( _domFactory, (Node)null, null, -1
);
    }

This uses another extractDOM method that returns a Node.
But now, the return value is always null.
It seems to me that the SAXChunkConsumer does not handle the
ModifiableNodeList correctly,
so that always an empty list is returned from getResultNodeList.
Alas, it's too late today for me to check this.

Michael Keuchen