Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Make DOMConverter methods public?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <Wolfgang.Hoschek AT cern.ch>, xom-interest AT lists.ibiblio.org
  • Cc:
  • Subject: Re: [XOM-interest] Make DOMConverter methods public?
  • Date: Thu, 17 Jul 2003 23:13:02 -0400

At 5:35 PM -0700 7/17/03, Wolfgang Hoschek wrote:


What's the reason the DOMConverter.convert(xyz) methods are private?
It would be handy for my app to be able to convert a DOM element into a XOM element, without going through the trouble of making new documents and passing them to the public methods that work on entire documents.

You can't create a DOM element without creating DOM document, at least not within DOM. In DOM every element has a document object, and cannot be disassociated from that document. I suppose it might be possible to change a single DOM element to a single XOM element, but the reverse is not possible, within the limits of DOM. (You could use implementation specific classes, but it's ugly and non-portable, and generally breaks every time the DOM vendor updates their implementation.) How are you getting elements without documents anyway?

That said, if you've got a convincing use case, I could see exposing some of the DOM-->XOM methods directly, though XOM-->DOM will have to remain private for these reasons.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page