Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#199 Stack error with JDOM input and SAXResult output

v7.9
closed
Michael Kay
5
2012-10-08
2004-03-19
Michael Kay
No

When a query is run using a (wrapped) DOM or JDOM tree
as input, and a SAXResult as output, an incorrect event
stream is sent to the SAX ContentHandler, typically
resulting in a stack exception because an endElement is
recieved for which there was no matching startElement.

Fix: in net.sf.saxon.om.Navigator, at line 457, add:

            // notify the start of content

            out.startContent();

I have also noticed that in this scenario the
ContentHandler is notified of the XML namespace. To
prevent this, the QueryResult.serialize() method will
in future add a NamespaceReducer to the output pipeline.

Michael Kay

Discussion

  • Charlie
    Charlie
    2004-03-19

    Logged In: YES
    user_id=1001052

    I added this at line 432, ie. straight after the startElement()

    case Type.ELEMENT:
    out.startElement(node.getNameCode(), 0, 0);
    //notify the start of content
    out.startContent();

    Rebuilt the jar locally and it works fine.