Re: [xml] Pointers in a struct _xmlNode for entities
- From: Daniel Veillard <veillard redhat com>
- To: Dave Malcolm <david davemalcolm demon co uk>
- Cc: xml gnome org
- Subject: Re: [xml] Pointers in a struct _xmlNode for entities
- Date: Tue, 5 Aug 2003 09:59:51 -0400
On Tue, Aug 05, 2003 at 02:46:02PM +0000, Dave Malcolm wrote:
I have a question about the internal representation of entities in a
tree built by libxml2.
Assuming I've got entity substitution turned off, am I right in thinking
the following?
(i) below my XML_DTD_NODE I will have various XML_ENTITY_DECL nodes,
with the declaration as "children", and these children having a "parent"
pointer back to the XML_ENTITY_DECL node.
yes,
The DTD also have an entity hash table allowing quick lookup
without scanning the full DTD.
(ii) within the body of the document, I will have XML_ENTITY_REF_NODE
nodes of which the "children" and "last" pointers will point to the
first and last children of the XML_ENTITY_DECL node.
yes
(iii) hence, for the XML_ENTITY_REF_NODE nodes, the relation
(node->children->parent != node) holds.
in general yes
Or have I misunderstood? Thanks in advance! (I'm about to write some
complex GUI code that allows users to edit entities in-place and have
all references auto-update visually, and I want to be sure of the
implementation details)
That's the expected handling, the goal was to be able to have a
single tree structure for all entities refernces, specifically for
editing purposes. The big bad drawback is entities with namespaces
where the namespace prefix is not defined within the entity like
"<foo:bar/>"
then the meaning of foo becomes contextual and this can lead to a
big bad mess...
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]