Re: [xml] 3 pb with the xmlTextReader APi from Python



On Thu, Jan 12, 2006 at 03:46:03PM +0100, Meunier, Jean-Luc wrote:
Pb 1 -  how to process the XML declaration , e.g. <?xml version="1.0"?>

  You can't. It's not made available by the API initially coming from
Microsoft. Similary you can't get into the internal subset or in any
part of the DTD content. 
  You can try to get the xmlDoc from there, but I think you shouldn't
in general.

Pb 2 - the QuoteChar() method seems to always return " even if a ' was
used to enclose an attribute, e.g. a='123'

  This information is not maintained, it's not part of XML infoset.

Pb 3 - in text node and attribute values, entities are strangely dealt
with by the Value() method: for instance a &amp; becomes a & in the
returned string

  You get the content once parsed. Entity processing is part of the
parsing.

            Actually a
rdr.CurrentDoc().encodeEntitiesReentrant(rdr.Value()) gives a correct
output, so it's even more strange to me

  It just escapes 'predefined' entities. 
Entities are far more complex than the few predefined ones.

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]