Re: [xml] Problem parsing with python?



On Fri, Dec 09, 2005 at 09:18:54PM -0500, Jim wrote:
I am processin an xml file wil python ... i think there maybe is a bug
in the library ... but i am not a xml spec guru ...

The file I am processing is basically:
------

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<!--some html code-->
------

The leading line before "<?xml ..." seems to cause problems.
Specifically:

"parser error : XML declaration allowed only at the start of the
document"

  and the parser is right, it's not XML if you have leading spaces
before the XMLDecl. Not XML means it won't go though an XML parser
without a fatal error. Feature, not a bug !

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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