[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Java DOM implementations and cloneNode

  • From: ralphc@b... (Ralph Richard Cook)
  • To: xml-dev@i...
  • Date: Tue, 26 Jan 1999 05:14:08 GMT

java dom
I'm working on a "pluggable" file load and save (import/export)
feature in an application. I'm using the DOM interface as the data
format I expose to the pluggable components. Internally, I'm trying
both Sun's Project X early access 2 and IBM's XML4J 1.1.9 to build the
DOM object. Some of my components will read and write XML, and I'm
trying both of the above on that side as well.

My problem comes in where I create the DOM object with one of these
libraries and create a XML object to save with the other, and have
them pass information purely through the DOM interface. I create a
TXDocument (for IBM) or a XMLDocument (for Sun) then cast the document
to a DOM Document, and populate it purely with DOM interface calls,
such as createElement and appendChild. In the export component I
create a TXDocument, then cast it to a Document, then try to populate
the Document via cloneNode on Elements from the passed-in Document.
The most common error is ClassCastException, mentioning one of the
classes that implement an interface.

Am I expecting too much here? Shouldn't the classes that implement the
DOM interfaces be able to copy via cloneNode, which is a DOM interface
function? Is this a bug or expected behavior?

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.