• 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

Load xml as String into DOMParser

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wonder if anyone can help.
I have written an application that communicates with a webservice over REST; reads the resultant string (which is the xml document) into an xml dom object, parses and processes it.
No problems; except its currently written in VB (using the MSXML class), and now I want to port it to Java.
I've written the code to make the http request to the webservice; and I get the result in a String object. Now I want to load it into the dom and process it.

I'm using IBM's XML4J.jar; and I have the following code:



Here's where I get stuck ! The only method I can find any reference to is parse() which appears to take a parameter of a filename, which then reads the contents of the file.
Not quite what I want ! I already have my xml in a String object, I just want to pass it into the parser.
In my VB code, at this point I use a method called loadXML and pass the string, but I cant find a similar object here !!

Any help with this would be very much appreciated !
Thanks

Nathan
reply
    Bookmark Topic Watch Topic
  • New Topic