OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Standard interface for DOM building

[ Lists Home | Date Index | Thread Index ]
  • From: Tyler Baker <tyler@infinet.com>
  • To: Michael Kay <M.H.Kay@eng.icl.co.uk>
  • Date: Fri, 25 Sep 1998 09:18:49 -0400

Michael Kay wrote:

> There are a number of DOM implementations now appearing,
> (for example a new one from SUN) and I have been trying to
> add support for them to SAXON. The thing that's missing is a
> standard interface to build the Document. Can XML-DEV step
> in to fill the gap?

This seems like a good idea.  One thing I do in the DOM implementation I have is
to pre-index all of the elements for each tag name into NodeLists and then store
them in a table.  The reason for this was that for some applications like XSL
Processors which need to be able to extract elements by name through
Element.getElementsByTagName(String name), this operation can be costly if done
repeatedly without any sort of indexing.  Even though the DOM interfaces are
standard, I think that some sort of context interface would help for application
developers so that they can make assumptions like: Are the values returned from
Node.getNodeName() internalised strings or not?  Other things application
programmers might want to know (that are not covered in the spec) are questions
like: can the DOM tree be indexed?

The two main solutions I have identified are:

(1) Have a DOM Document Factory and get initialization parameters via system
properties in a manner similiar to how SAX's Parser Factory looks up the value
returned from org.xml.sax.parser to get the class name for the SAX parser.

(2) Specify that particular DOM Document implementation look up certain
properties upon initialization and understand how to initialize themselves for
whatever environment they are configured for.

Right now the most standard way for DOM Document support that I can think of is
to make sure that you have at least one constructor be an empty constructor.

Regards,

Tyler


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS