How to parse an HTTP file

thomas Armstrong <[email protected]> Sat, 13 Nov 2004 11:39:05 +0100
Newsgroups gmane.text.xml.xerces-p.devel
Message-ID <[email protected]>
Hi.

I'm trying to parse a HTTP file
http://www.foo.com/foo.xml

------------------------------------------
use XML::Xerces;

my $file  = XML::Xerces::LocalFileInputSource->new("http://www.foo.com/foo.xml");
my $parser = XML::Xerces::XercesDOMParser->new();
eval { $parser->parse($file); };
error($@,"Couldn't parse file: $ARGV[0]") if $@;
my $doc = $parser->getDocument();
---------------------------------------------

But I'm not able. I get this error message:
----------------------------
Can't call method "getDocumentElement" on an undefined value at
parse_url.pl line 7.
---------------------------

What am I doing wrong? Thank you very much.