Re: [xml] How to extend the Reader interface with a dup() function

On Sun, Nov 02, 2003 at 11:58:17PM +0100, Nanning Buitenhuis wrote:
Yes, but I like your first solution better: It just does what needed
to be done, no tricks or other complexity.

  But I won't implement it, because an API which works "sometimes" 
is not something I want to provide support for. If you cannot freeze
the state of the IO then this does not work. I do not want to bury this
in an API. The Expand solution where the logical subtree for the range
you need is kept available is fine, but duplicating information using an
API which may fail or deliver different informations in the general case
(e.g. when running XInclude in the first stream information may not be
available but becomes available in the second pass) is not proper.
  If there is a single document being parsed, then there is a single parser
context, or there is 2 document being parsed and you must accept rescanning
from scratch because it is a second document.
  You cannot design APIs on cornercase. Expanding the available subtree
is the logically correct solution to your problem, not parsing twice.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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