Re: [xml] DOM Parser + entities

On Wed, 2003-10-15 at 14:41, Murray Cumming Comneon com wrote:
I'm using the DOM Parser, with replaceEntities=0 in the parser context, so
that the entity references appear in the tree instead of being resolved
automatically to text.

The entity reference node types are XML_ENTITY_REF_NODE, and, from looking
at the source code, the nodes seem to be plain xmlNodes and don't need to be
casted to any other struct type.

So, 2 questions:
1. What useful things can I discover about this node other than the name?
Maybe nothing. I'm clueless.

2. I notice that these Entity Reference nodes have children. The child node
types are XML_ENTITY_DECL, but I can't see any logic to it. Are these child
nodes useful/meaningful.

The XML_ENTITY_REF_NODE should have children ptr == last ptr, pointing
to a XML_ENTITY_DECL, which can be cast to an xmlEntityPtr, I believe.

However, the parent of the XML_ENTITY_DECL will be the DTD, rather the
reference node, and its siblings will likely be other XML_ENTITY_DECLs
and comments etc from the DTD part of the document - this has caused me
no end of trouble when naively doing tree walks in Conglomerate :-(

David Malcolm

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