Error parsing an XML file from a URL identifier

I have been using the SAX2 parser to parse an XML file. I have no problem when give the "parse" method a local XML file name. When I give the parse method a URL address, however, it returns a "SAXParseException: Value must be quoted" error at run-time.

The URL address returns the exact same XML that is in the file. The source code is identical when I used IE5 to look at it.

Any suggestions would be much appreciated!

PjR

[455 byte] By [pjrenaud] at [2007-9-26 4:36:39]
# 1
try:InputStream f = this.getClass().getResourceAsStream("config.xml");doc = docBuilder.parse(f);
nort_de at 2007-6-29 17:54:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks! That made the parser happier ... now I'm experiencing a NUllPointerException at run-time. It may have more to do with the URL header. I will keep trying.Many thanks!PjR.
pjrenaud at 2007-6-29 17:54:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

It works!!

I used the URL and BufferedReader classes to fill the parser. Here's how:

// create a new object of type URL

URL xmlURL = new URL( "http://ServerName/DbName/PageName?OpenPage&username=myname&password=mypassword");

// Create the SAX2 parser

SAXParser saxParser = spf.newSAXParser();

xr = saxParser.getXMLReader();

// Set the ContentHandler

DefHandlerClass myHandler = new DefHandlerClass();

xr.setContentHandler( myHandler );

// read the URL stream into the BufferedReader

BufferedReader in = new BufferedReader( new InputStreamReader(xmlURL.openStream()));

// parse the document

xr.parse( new InputSource( in ) );

// close the input stream

in.close();

PjR

pjrenaud at 2007-6-29 17:54:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
the config file have to be in the same folder as your bean.
nort_de at 2007-6-29 17:54:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Thanks ... but I'm not using beans in this app.
pjrenaud at 2007-6-29 17:54:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...