473,325 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to parse an HTTP file with Xerces-Perl

Hi.

I'm trying to parse a HTTP file
http://www.foo.com/foo.xml
by using Xerces-Perl:

------------------------------------------
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.
Jul 20 '05 #1
0 1413

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: edwinek | last post by:
Hi, According to the API specification, javax.xml.parsers.DocumentBuilder.parse should return an org.w3c.dom.Document. However, when I use the following code: DocumentBuilderFactory factory =...
0
by: Jim Cobban | last post by:
Due to a problem which I am discussing on another thread the UTF-8 text in my XML file is being corrupted. The problem that leaves me with is that as soon as the Xerces parser hits the bad UTF-8...
0
by: precious | last post by:
i'm trying to split my xml configuration file to files implementing the parsing using xerces in java (DOMparser). my project uses a "fromXML" parsing design and here's what i tried in the node...
1
by: Anna | last post by:
Hi all. I need to parse an XML Schema and get the following information out of it: list of elements allowed in schema list of attributes for each element - which are required and which optional...
0
by: Jim Phelps | last post by:
After having memory leak issues with Xerces-c 2.3.0 for Solaris 2.7 for CC 6.2 I have decided to update to at least 2.4. I have downloaded the binary tarball and have installed it on my...
2
by: Watsh | last post by:
Hi All, I have been trying to parse an XML string using the StringReader and InputSource interface but the document returned to me is always null. Please find the code below which i have been...
0
by: heiko | last post by:
Hi, I have written a program for parsing XML data with Xerces and C++. There are still two things, for which I need help: I want to validate a XML file with a schema, given by my xsd-file. ...
8
by: pacman2081 | last post by:
I am looking for C/C++ code to parse a XML file. Most of the stuff I see on the web involves .NET or managed C++ code. Any help would be appreciated Thanks -- pacman
3
by: Nobody | last post by:
I'm trying to put together code to deal with a SOAP with attachements response, and I'd like to process the response in a single pass. The SOAP with attachments specification returns XML in a MIME...
2
by: christian.eickhoff | last post by:
Hello Everyone, I am facing a problem which should be relatively easy to solve for XML or XERCES experts. I am parsing my XML instance using xerces-c SAXParser. For internal purposes, it is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.