You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/12/09 01:43:03 UTC
DO NOT REPLY [Bug 25347] New: -
DOMNormalizer throws ClassCastException while processing comments
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25347>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25347
DOMNormalizer throws ClassCastException while processing comments
Summary: DOMNormalizer throws ClassCastException while processing
comments
Product: Xerces2-J
Version: 2.6.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: DOM
AssignedTo: xerces-j-dev@xml.apache.org
ReportedBy: kohsuke.kawaguchi@sun.com
Try the following code:
-----------------------------------------------------------------
import javax.xml.parsers.DocumentBuilderFactory;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import org.apache.xerces.dom.DocumentImpl;
public class Bug extends TestCase {
public Bug(String name) {
super(name);
}
public static void main(String [] args) {
TestRunner.run(Bug.class);
}
public void test1() throws Exception {
DocumentImpl doc = (DocumentImpl)DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(Bug.class.getResource("test.xml").toExternalForm());
doc.getDomConfig().setParameter("entities", Boolean.FALSE);
doc.normalizeDocument();
}
}
-----------------------------------------------------------------
with this data:
-----------------------------------------------------------------
<?xml version="1.0"?>
<!-- a comment -->
<root/>
-----------------------------------------------------------------
I get:
-----------------------------------------------------------------
java.lang.ClassCastException
at org.apache.xerces.dom.DOMNormalizer.normalizeNode(DOMNormalizer.java:519)
at
org.apache.xerces.dom.DOMNormalizer.normalizeDocument(DOMNormalizer.java:256)
at
org.apache.xerces.dom.CoreDocumentImpl.normalizeDocument(CoreDocumentImpl.java:1075)
at bugComment.Bug.test1(Bug.java:35)
-----------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org