From email@example.com Wed Sep 16 11:33:19 1998 Date: Wed, 16 Sep 1998 12:31:02 -0400 From: John Cowan <firstname.lastname@example.org> To: XML Dev <email@example.com> Subject: ANN: DOMParser
A preliminary version of DOMParser is now available at my XML page (http://www.ccil.org/~cowan/XML). DOMParser is a compliant SAX parser, except that its input comes from a DOM implementation rather than an InputSource. An additional method,
parse(Document d), is introduced to parse DOM Document objects. The standard
parse() methods throw errors. (Perhaps they should look for a real parser and a DOM implementation to try to create a DOM Document instead?)
A demo program is also available, based on the SAX ByteStreamDemo and using the Docuverse DOM SDK as the DOM. [Its output is identical to that of ByteStreamDemo using Aelfred 1.2 as the parser, except that it does not try to resolve a SystemId or set a Locator (Locators making no sense when there is no source text)].
[September 18 Update]: "At the suggestion of Mike Kay, I have enhanced DOMParser to support SAX Locators and InputSources properly. Reiterating, DOMParser conforms to the definition of a SAX parser, but reads from a DOM Document representing an XML document, rather than from a textual representation of XML.
A new class called DOMSource, a subclass of InputSource, can now be used to encapsulate a DOM Document for SAX parsing. Obviously, SAX parsers other than DOMParser will be clueless if passed such an InputSource!
DOMParser also now implements Locator, although it returns no useful information from it. However, the non-interface method DOMParser.getCurrentNode() can be used to determine the current DOM Node being parsed.
John Cowan http://www.ccil.org/~cowan firstname.lastname@example.org You tollerday donsk? N. You tolkatiff scowegian? Nn. You spigotty anglease? Nnn. You phonio saxo? Nnnn. Clear all so! 'Tis a Jute.... (Finnegans Wake 16.5) xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:firstname.lastname@example.org the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:email@example.com the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)