Actions
Bug #1814
closedGot NPE when tranfroming the SAXSource which is created from DOM2SAX
Start date:
2013-06-19
Due date:
% Done:
0%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
If you run the DOMSAXTest from the test case, you will get the stack trace.
ava.lang.NullPointerException
at net.sf.saxon.tree.tiny.TinyBuilder.startElement(TinyBuilder.java:245)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:292)
at org.apache.xalan.xsltc.trax.DOM2SAX.parse(DOM2SAX.java:285)
at org.apache.xalan.xsltc.trax.DOM2SAX.parse(DOM2SAX.java:149)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:396)
at net.sf.saxon.event.Sender.send(Sender.java:143)
at net.sf.saxon.Controller.transform(Controller.java:1890)
at com.example.esb.DOMSAXTest.main(DOMSAXTest.java:65)
Files
Updated by Michael Kay over 11 years ago
- Category set to DOM Interface
- Status changed from New to Won't fix
- Assignee set to Michael Kay
Looking at the xsltc source code here:
it appears that when you create a DOM2SAX object that wraps an Element node (as distinct from a document node), the resulting XMLReader will issue a stream of SAX events that starts with a startElement() event rather than a startDocument(). I would argue that that's contrary to the SAX specification, but whether or not you agree, a SAXSource supplied to Saxon needs to start with a startDocument() event, so this usage isn't going to work.
Please register to edit this issue
Actions