[jdom-interest] Error with JDom?

Chad LaJoie clajoie at vt.edu
Thu Mar 22 06:11:50 PST 2001


I am currently using JDOM to parse external (to my system) RSS 
channels.  Every time I try to read one I get the following exception

org.jdom.JDOMException: Error on line 1: The root element is required in a 
well-formed document.
         at org.jdom.input.DOMBuilder.build(DOMBuilder.java:293)
         at org.jdom.input.DOMBuilder.build(DOMBuilder.java:342)
         at 
edu.vt.ward.lexus.widgets.RSSWidget.RSSParser.parse(RSSParser.java:108)
         at 
edu.vt.ward.lexus.widgets.RSSWidget.RSSParser.updateChannel(RSSParser.java:65)
         at 
edu.vt.ward.lexus.widgets.RSSWidget.RSSChannel.update(RSSChannel.java:543)


Yet when I go and look at the actual RSS file (in this case 
http://cnn.com/cnn.rss) it's appears to be just fine.  Another gentlemen 
the works with me gets the same error when he tries to parse a file on the 
local system and again the document is well-formed and have been validated 
against the DTD.  Has anyone else encountered this and if so what am I 
missing here?

For reference here is the code I am using to in my method where the 
exception is being encountered.

         private RSSChannel parse(URL url) {
                 try {
                         DOMBuilder builder = new DOMBuilder();
                         Document doc = builder.build(url);      //this is 
line 108

                         Element root = doc.getRootElement();
                         .......
         }


Chad La Joie                           "Only a man who can not conquer
IT Specialist                             his deficiencies feels the need to
IS&C - WARD                             convince the world he has none"




More information about the jdom-interest mailing list