Tim Bray wrote:
> At 12:14 PM 11/18/99 -0700, Tom Palmer wrote: > >Still, what if someone wanted to use one organization's parser > >and another's DOM implementation? These should be kept > >independent if at all possible. > > Errr, how is that possible? The way things normally work is, parser > reads XML resource, loads it into data structure, offers DOM API to it. > The parser and DOM implementation are necessarily somewhat in bed, unless > we want to require DOM implementations to use SAX to build it. Do we? -T. There are many, many use-cases for DOM, indepenendent of any parser. For example, IBM's XML Productivity Kit for Java (available on http://www.alphaworks.ibm.com) is a set of Java Beans manipulates XML, and passes the result from one bean to the next. The DOM beans receive a DOMEvent (a wrapped Document reference) usually do some transformation or filter and send a DOMEvent as output. The LotusXSL processor is included which takes 2 DOMEvents (or Document references) one for the input, one for the rules, and outputs the result as a Document reference. So the parser can be superfluous. The DOM tree is simply an API, and the source could easily be a database, or non-XML format. So you could read in some deliminted format, programmatically create a DOM tree using a generic DOM, manipulate it and then invoke some parser-independent DOM writer, printer to create XML or whatever. -Ralf
