From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Wed Feb 07 2001 - 10:42:14 EST
On Wed, Feb 07, 2001 at 04:39:53PM +0100, Philipp Kursawe wrote:
> Hello it's me again :)
>
> First of all thanks you all for the reply on my "Encoding and Win32" topic.
> I have solved the problem now I hope. Last I've to test are chinese texts :)
>
> Now I have another question about libxml and its handling of external system
> entities.
>
> I want to substitute another file into my main xml file.
>
> This external file contains well formed xml content.
>
> main.xml
>
> <languages>
> ⟨
> </languages>
>
> lang is an external entity.
> <!ENTITY lang SYSTEM "language.xml">
>
> Now when traversing the languages chunk the enitity reference is not
> resolved, the languages element is empty and has no children.
that's strange ...
> Something I missunderstand about external entities or a declaration error?
Probably, libxml can work in two modes w.r.t. entities:
- normal mode is to parse the external entity, generate an entity
node and reference this entity node by an entity ref node in the tree
- replacement mode, in this case the entity content is inlined and
directly seen as the children of the parent
you will understand better by running:
xmllint --debug main.xml
and
xmllint --noent --debug main.xml
to switch the mode of entity replacement,
int xmlSubstituteEntitiesDefault(int val);
This is described at
http://xmlsoft.org/#Entities
Daniel
-- Daniel Veillard | Red Hat Network http://redhat.com/products/network/ veillard@redhat.com | libxml Gnome XML toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ ---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 10:44:08 EST