[jdom-interest] Error with JDom?

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Mar 22 19:25:00 PST 2001


I would try to use SAXBuilder and see of the same problem persists.  Second,
give use the URL and sample data and maybe we can make more sense of it.

> 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(RS
> SParser.java:65)
>          at 
> edu.vt.ward.lexus.widgets.RSSWidget.RSSChannel.update(RSSChann
> el.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"
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list