File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes XML Parsing issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "XML Parsing issue" Watch "XML Parsing issue" New topic
Author

XML Parsing issue

S Gibbs
Greenhorn

Joined: Jul 08, 2008
Posts: 4
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
Bartender

Joined: Oct 14, 2005
Posts: 18138
    
    8

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

Joined: Jul 08, 2008
Posts: 4
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

Joined: Mar 22, 2000
Posts: 12682
    
    5
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


Java Resources at www.wbrogden.com
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XML Parsing issue
 
Similar Threads
ForumException.java:85)
Spring and Hessian
java.net.SocketException: Broken pipe
Transformer Exception -- Please help.
PostgreSql AdminIndex Bug