• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Integrating JDOM with w3c DOM?

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Our project uses DOM and I've had to use it, but I am really missing JDOM with its simplicity and logical programming methods/approach for Java devs.

I've read articles that "state" it's easy to integrate the two technologies (DOM/JDOM), but I've yet to see any code examples that shows how to integrate them.

In particular, I'd like to be able to use JDOM to create an XML structure then output it as a DOM stream, just as if I had created it with the DOM methods. Also, going the other way, I would like to be able to accept a DOM stream (object) and manipulate it using JDOM methods.

Can this integration be done?

Are there any examples, anywhere, to demonstrate?

Thanks vary much in advance.

- mike
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike, what's this "DOM stream" that you're asking about? Maybe I'm having a senior moment but that isn't a term I'm familiar with in the XML context. Could you maybe give us an example?
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Mike, what's this "DOM stream" that you're asking about? Maybe I'm having a senior moment but that isn't a term I'm familiar with in the XML context. Could you maybe give us an example?



Hi Paul,

Sorry, all I meant was I would like to be able to read in a DOM (as an object) -- say an XML Request, manipulate it with JDOM, and send it back as a DOM object. Things like that.

The "Stream" was only meant to imply it was an memory object, not a disk-based XML file.

Thanks,

-mike
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a lot of documentation is available for JDOM 2 except for the javadocs. Maybe start by checking out the org.jdom2.input.DOMBuilder and org.jdom2.output.DOMOutputter classes; those handle the conversion between org.w3c.dom.Document and org.jdom2.Document objects.
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Not a lot of documentation is available for JDOM 2 except for the javadocs. Maybe start by checking out the org.jdom2.input.DOMBuilder and org.jdom2.output.DOMOutputter classes; those handle the conversion between org.w3c.dom.Document and org.jdom2.Document objects.



Thanks Ulf.

Sounds like I didn't miss any tutorials or other helpful documentation then.

When I'm just left with mostly unhelpful JavaDocs (the documentation of last resort), it makes me wonder if anyone is using a particular feature.

JDOM is awesome and I was surprised that the architect for my project chose the now-ancient DOM.

Appreciate your reply.

Thanks very much.

-mike
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic