• 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

Document object returning null after parsing the xml

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing one problem.
In my application I am parsing xmlstring through

DocumentBuilderFactory.newInstance().
newDocumentBuilder().parse(new InputSource(new StringReader(XmlString)));

here XmlString is stringform of my xml but it is returning the
[#document: null]

I am using weblogic 8.1,if I remove weblogic.jar from my classpath then it is working fine but I need weblogic.jar for ejb classes.

so please help me to resolve this problem.

Thanks
Manish
 
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
This is normal, it doesn't mean there is anything wrong with your program... except your assumption that the toString() method called on your Document will return something different than the nodeValue() method. Read the API documentation for the Node interface and see what the nodeValue() of a Document object is. That's what you see there.

I don't see the point of getting a string representation of the Document anyway, in your case. You already have a String containing the XML.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic