[jdom-interest] sub-classing element

Jasmeet.Singh at eontec.com Jasmeet.Singh at eontec.com
Mon Jan 28 05:41:39 PST 2002

I am trying to sub-class the Element and use my own form as I need to write
a few operations to act on my node of document

I have the document read from the file and is stored in doc

org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder();
org.jdom.Document doc = builder.build(new java.io.File(myTestFile));
MyDocument myDoc =  new MyDocument((MyNode)doc.getRootElement.clone
(),(org.jdom.DocType) doc.getDocType());

I get a classcast exception while casting the clone of getRootElement to
MyNode.  Is this wrong ..

MyDocument is sub-class of Document and MyNode is Subclass of Element

The objectinves i need to achieve

 use my own version of Document and Element so that I can write my owl
opearions to act upon the document and elements


More information about the jdom-interest mailing list