This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes DOM object from StringBuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "DOM object from StringBuffer" Watch "DOM object from StringBuffer" New topic

DOM object from StringBuffer

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
I have an XML in StringBuffer, say

StringBuffer sb = new StringBuffer()

Is it possible to create a DOM object from this StringBuffer so that I can iterate over the XML using the DOM object.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Yes. One way to do it could be :

[My Blog]
All roads lead to JavaRanch
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
Thanks a lot
I agree. Here's the link:
subject: DOM object from StringBuffer
It's not a secret anymore!