• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

XML Parsing issue

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I'm really banging my head against a wall with this one, and was hoping someone could poke me in the right direction. I'm trying to parse xml using x:parse and the like. However I only ever get returned:


Now my understanding is that this implies that tomcat cannot see the classes involved. However I've now put xalan.jar, resolver.jar, serializer.jar, xercesImpl.jar, xml-apis.jar, & xsltc.jar, the classes I'm told I need, in about every concivable lib folder on the server (WEB-INF/lib, the tomcat common/lib folder, and the java/lib folders) and I've had no luck.

If you try to do anything other the parse you get this error:


and for refrence this is the code I'm currently trying to just test things are working (the url is working and checked, the url var has the xml in):


Any help would be much appreciated!
Thanks
 
Sheriff
Posts: 28330
97
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

S Gibbs wrote:Hi Guys,
I'm really banging my head against a wall with this one, and was hoping someone could poke me in the right direction. I'm trying to parse xml using x:parse and the like. However I only ever get returned:


Now my understanding is that this implies that tomcat cannot see the classes involved.



No, that's wrong. It just means that the toString() method of a Document object returns that string. So it tells you that you have successfully created a Document object. As you can see it doesn't tell you anything more about that Document object; you would have to write other code to do that.
 
S Gibbs
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

S Gibbs wrote:Hi Guys,
I'm really banging my head against a wall with this one, and was hoping someone could poke me in the right direction. I'm trying to parse xml using x:parse and the like. However I only ever get returned:


Now my understanding is that this implies that tomcat cannot see the classes involved.



No, that's wrong. It just means that the toString() method of a Document object returns that string. So it tells you that you have successfully created a Document object. As you can see it doesn't tell you anything more about that Document object; you would have to write other code to do that.



Ahh - my misunderstanding then. Thanks.
Any suggestions as to why anything else other than parse causes it to crash then?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a lovely table in the javadocs for org.w3c.dom.Node which everybody working with XML should be familiar with.

In that table you will see what the "nodeValue" is for every kind of Node - for example a Document node returns null and has nodeName of #document

Bill
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic