Bug #200
closedTransforming with DOMSource(Document)
0%
Description
SourceForge user: rzschech
Transforming with the input of a DOMSource wraped
around a Document causes a TransformerException with
message "DOMSender: no start node defined"
I've tracked the problem down to the class
net.sf.saxon.Controller around line 1370:
// Must copy the whole document, not just the subtree
org.w3c.dom.Document dom = ds.getNode().getOwnerDocument();
((DOMSource)source).setNode(dom);
If ds.getNode() is a Document than getOwnerDocument()
returns null. I fixed it by changin the code to:
// Must copy the whole document, not just the subtree
if (ds.getNode().getNodeType()!=Node.DOCUMENT_NODE) {
org.w3c.dom.Document dom =
ds.getNode().getOwnerDocument();
((DOMSource)source).setNode(dom);
}
Ive attached a test case.
No that it should matter, the implementation class of
my Document is org.apache.xerces.dom.DocumentImpl but
the definition of getOwnerDocument() is defined as
returning null for Document nodes.
Actual Result:
Error
DOMSender: no start node defined
Exception in thread "main"
javax.xml.transform.TransformerException: DOMSender: no
start node defined
at
net.sf.saxon.event.DOMSender.send(DOMSender.java:75)
at
net.sf.saxon.event.Sender.sendDOMSource(Sender.java:108)
at net.sf.saxon.event.Sender.send(Sender.java:61)
at
net.sf.saxon.Controller.transform(Controller.java:1377)
at
com.TransformerTest.main(TransformerTest.java:31)
Expected Result:
Files
Updated by Anonymous about 21 years ago
SourceForge user: mhkay
Logged In: YES
user_id=251681
Is a bright-yellow highlighted message telling you not to
enter suspected bugs in this area not visible enough? Can
you suggest a better way I should tell people how to submit
problems?
Please use the saxon-help list or forum in future.
This is a known problem and will be fixed in the next version.
Michael Kay
Please register to edit this issue