[jdom-interest] bug in SAXBuilder.build() ?
Scrut Inizer
scrut999 at hotmail.com
Thu Oct 28 21:19:39 PDT 2004
I use JDOM 1.0 and don't seem to be able to build a document at all.
e.g. the following code always produces IOExceptions:
URL url = new URL(urlstring);
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(url);
if the URL (the urlstring) is
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&SubscriptionId=[yoursubscriptionid]&Operation=ItemSearch&Artist=Bryan%20Adams&ItemPage=1&SearchIndex=Music&ResponseGroup=Request,ItemIds,Large,Reviews
(That is a request of Amazons WebService which returns a simple XML file. I
only removed my subscription ID of the above URL. But if you copy&paste that
URL into your browser and replaced [yoursubscriptionid] with your
subscription ID, you will see the result immediately: a simple XML file of
approx. 138kByte)
I also tried to use an InputStream and a Reader as parameter for
builder.build() but I keep getting IOExcepton as well.
I can, however, read the result of that query by doing something like this:
Reader reader = new InputStreamReader(url.openStream());
BufferedReader in = new BufferedReader(reader);
and then read the content of in
Why can't I make a document from that?
_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and
more! http://special.msn.com/msn/election2004.armx
More information about the jdom-interest
mailing list