Re: [xml] xmlSubstituteEntitiesDefault problems



On Sun, Dec 30, 2001 at 09:46:45PM +0100, Gabriel Ambuehl wrote:
-----BEGIN PGP SIGNED MESSAGE-----

Hello,
I need to parse the first document leaving all entities in place,
so I call
xmlSubstituteEntitiesDefault(0);
parse_first_doc();
[...]
but for some reason, the entities (most notably <) of the first
doc
get replaced through their human readable chars. What did I
misunderstand?

  predefined character entities are automatically replaced, as well as
numeric character references. Replacing them with entities nodes doesn't
really make sense.

Further, am I right assuming that if I filter a string through
xmlEncodeEntities() then it should be perfectly valid as content?

  Hum, yes it should, but xmlEncodeEntities is deprecated use
xmlEncodeEntitiesReentrant()

What
if I haven't got a doc to call it upon at that time? Create an empty
one?

  xmlEncodeEntitiesReentrant() with the first arg set to NULL should
still work.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]