[XML-SIG] Python DOM Unification -- level
uche.ogbuji@fourthought.com
uche.ogbuji@fourthought.com
Tue, 27 Apr 1999 00:02:57 -0600
> I would say at the Builder Level, but handle it differently then you suggest.
>
> if sys.argv[1] == '4th' :
> fac = 4dom.Ext.Factory
> builder = 4dom.Ext.Builder
> elif sys.argv[1] == 'pydom':
> fac = pydom.factory
> builder = pydom.builder
> else
> fac = minidom.fac
> builder = minidom.builder
>
> doc = fac.CreateDocument();
> doc = builder.XMLFromURL('www.fourthought.com')
Et tu, Mikhail? Code that won't run? (See lines 2 and 3). And furthermore,
I know that we do plan to put up the XML source for www.fourthought.com one of
these days when browsers are sane, but won't that last line produce some funky
results just now?
> where the factory interface defines everything that is not creatable from a
> document.
>
> interface DOMFactory {
>
> Document CreateDocument();
> HTMLDocument CreateHTMLDocument();
> DocType CreateDocType();
> NodeList CreateNodeList(in sequence<Node>);
> ...
> };
>
> and builder defines an interface for creating documents from different
> streams
>
> interface DOMBuilder {
>
> Document FromXMLFile(in string URL);
> HTMLDocument FromHTMLFile(in string URL);
> Document FromXMLString(in string XML);
> ...
> };
Of course, some may say I'm biased, but I think this is the strongest
proposal. It also dovetails with those who have been calling for a PyDOM
factory interface.
The main problem I anticipate is that Paul might consider adding a factory to
minidom a bit contrary to the "mini" idea.
--
Uche Ogbuji
FourThought LLC, IT Consultants
uche.ogbuji@fourthought.com (970)481-0805
Software engineering, project management, Intranets and Extranets
http://FourThought.com http://OpenTechnology.org