[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]System.Xml
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]System.Xml |
Date: |
Tue, 7 Jan 2003 19:56:50 +1000 |
User-agent: |
KMail/1.4.3 |
On Tuesday 07 January 2003 07:11 pm, Simon Guindon wrote:
> Anyways, we have the chicken and the egg problem here.
> XmlDocument.LoadXml uses XmlTextReader to load structure into XmlDocument.
> Problem here is, should LoadXml do the Appending of children and
> attributes, or should XmlTextReader do this internally with a XmlDocument
> privately in it. Currently thats how we have it, but then how do we get
> the structure to the main XmlDocument.
Mark the document field in XmlTextReader as "internal". Or add an "internal"
method called "GetDocument()" or something. Then access that from "LoadXml"
after the parse completes.
> My initial thoughts were that XmlTextReader ONLY did parsing of the text,
> and the DOM creation happened in XmlDocument, but used XmlTextReader to
> parse.
That's how other implementations work. But that doesn't mean that we have to
do it the same way. Building the document in XmlTextReader is fine by me, as
long as the non-document API functions sufficiently to fool apps that use it.
There are some advantages to using the node forms internally: the rest of the
XmlNode code can be reused to implement bits of XmlTextReader, rather than
having to duplicate that work. Anyway, at this point the motto is "whatever
works".
Cheers,
Rhys.