Re: [xml] how to read from network by xmlReadFile

On Wed, Nov 24, 2004 at 03:37:05PM +0900, ääåå wrote:
Thu, 01 Jan 1970 09:00:00 +0900

I read the short description of of xmlReadFile at parser Manual of 
'Reference Manual for libxml2',that say 'parse an XML file from the 
filesystem or the network.'
And so, I tried to read the xml file from my local network, by call 
the function like as follows.

doc = xmlReadFile("http://localhost/resource/test.xml";)

  xmlReadFile takes 3 arguments. I don't believe your actually tried that
code or if you did your compiler is severely broken.

but, error message (fail to load HTTP resource) returns.

  Works for me

paphio:~ -> python
Python 2.2.3 (#1, Aug  8 2003, 08:44:02)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import libxml2
doc = libxml2.readFile('', None, 0)
'<?xml version="1.0" encoding="iso-8859-1"?>\n<doc/>\n'

either your libxml2 is compiled without HTTP support, or the HTTP
resource is not available/not XML or your code just didn't work for
other reasons.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]