Re: [xml] Substitution of nested entity references



On Wed, Apr 10, 2002 at 01:49:00PM +0200, Henke, Markus wrote:
- I've assumed that a xmlEntity have only child nodes with
  type XML_ENTITY_REF_NODE or XML_TEXT_NODE. Is this correct,
  and if not, which additional cases were to take into
  consideration?

  Well an entity content can be any "well balanced chunk", i.e.
the result of the content [43] production:

    http://www.w3.org/TR/REC-xml#NT-content

So we have XML_TEXT_NODE, XML_ENTITY_REF_NODE, XML_ELEMENT_NODE,
XML_CDATA_SECTION_NODE, XML_PI_NODE and XML_COMMENT_NODE.
The first two are already covered.
I guess from the last two we don't want to have any content
when resolving an entity reference?
For XML_ELEMENT_NODE and XML_CDATA_SECTION_NODE we could use
xmlNodeGetContent(), assumed that xmlResolveEntityRef() is
build in to resolve entity references that are contained by
a XML_ELEMENT_NODE?

  I'm getting *REALLY* confused now. What are you trying to achieve ?

I'm not sure if i got you right.
Does libxml2 resolve nested entity references if entity
substitution is turned on (how?)?

  Yes, by keeping track of them.

- How to run the (existing?) tests in a Win32 environment
(which is my development platform)?

  xmllint is ported use it --noent !!

- To get a usefull result, xmlResolveEntityRef() has to be
included in the libxml2 source, hum, wherever an entity is
resolved :)

   I do NOT understand. Entity resolution is done at parse time.
I was thinking your routine was running on an already built tree.
So what on earth entity resolution has to do with your routine ?

  I said, I'm getting really confused about what you intend to do.
If you substitute entities you will get text, element, PI and CDATA
nodes as the tree replacement content. So why are you trying to remove
them. No really I can't understand.

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]