Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Parsing issue

 
S Gibbs
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic