passing null to createCDATASection 2003-01-23 - By Tim Cronin
Is it valid to be able to pass Null to Document.createCDATASection()
or is this a bug?
-----Original Message----- From: Tim Cronin [mailto:tim@(protected)] Sent: Wednesday, January 22, 2003 10:44 AM To: 'xerces-j-user@(protected)' Subject: passing null to createCDATASection
I'm using 2.2.1.
I was building a Document and a passed a null to the call createCDATASection (this did not fail which surprised me..)
when I tried to transform (basically creating a string of the dom)
public static String toString(Node node) { StringWriter sw = new StringWriter();
try { Transformer serializer = TransformerFactory.newInstance().newTransformer(); serializer.transform(new DOMSource(node), new StreamResult(sw)); } catch (TransformerException e) { DOMException de = new DOMException(DOMException.SYNTAX_ERR, "failed to translate DOM"); de.initCause(e); throw de; } return sw.toString(); }
it I got the following
java.lang.NullPointerException at org.apache.xml.utils.TreeWalker.dispatachChars(TreeWalker.java:292) at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:412) at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:191) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerId entityImpl.java:325)
it also failed for xslt transformation
java.lang.NullPointerException at org.apache.xalan.xsltc.runtime.output.StreamXMLOutput.characters(StreamXMLOu tput.java:199) at org.apache.xalan.xsltc.runtime.output.StreamUnknownOutput.characters(StreamU nknownOutput.java:177) at org.apache.xalan.xsltc.trax.DOM2TO.parse(DOM2TO.java:144) at org.apache.xalan.xsltc.trax.DOM2TO.parse(DOM2TO.java:209) at org.apache.xalan.xsltc.trax.DOM2TO.parse(DOM2TO.java:209) at org.apache.xalan.xsltc.trax.DOM2TO.parse(DOM2TO.java:115) at org.apache.xalan.xsltc.trax.TransformerImpl.transformIdentity(TransformerImp l.java:612) at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:6 32)
I would expect to get a NullPointerException when I created the CDATASection.
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|