W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1998

Re: xxxML on top of, embedded in XML

From: David Megginson <ak117@freenet.carleton.ca>
Date: Fri, 1 May 1998 12:52:54 -0400
Message-Id: <199805011652.MAA04743@unready.microstar.com>
To: Richard Cohn <cohn@Adobe.COM>
Cc: www-dom@w3.org
Richard Cohn writes:

 > >As I mentioned above, the DOM is a solution to a specific problem.
 > >Every XML document implies some kind of object model -- sometimes (as
 > >in the case of a technical manual, a poem, or a novel), the DOM will
 > >be a very good match; other times (as in the cases of serialised
 > >components, vector graphics, or an XSL stylesheet), the DOM will be
 > >too far from the optimal object model.
 > 
 > Agreed, but just as the HTML DOM builds on the Core DOM, it will be useful
 > for the PGML DOM to build on common functionality.

This could turn out to be a very good solution in some cases -- I do
not know PGML well enough to judge.

More generally, though, imagine a document consisting of, say, 50
million records like these (normally, the structure should be a little
more robust):

  <contact>
    <name>David Megginson</name>
    <email>dmeggins@microstar.com</email>
    <nationality>Canadian</nationality>
    <date-of-birth>
      <year>1964</year>
      <month>November</month>
      <day>18</day>
    </date-of-birth>
    <education>Ph.D. (University of Toronto)</education>
  </contact>

It is fairly efficient to put these straight into a customised Contact
object:

  public class Contact {
    public String name;
    public String email;
    public int nationality; // assuming constants defined somewhere
    public int birth-year;
    public int birth-month;
    public int birth-day;
    public String education;
  }
  
Building a DOM as an intermediate step would make little sense, since
you would generate a painfully large number of nodes for each record
(instead of just one Contact object with a couple of strings).


All the best,


David

-- 
David Megginson                 ak117@freenet.carleton.ca
Microstar Software Ltd.         dmeggins@microstar.com
      http://home.sprynet.com/sprynet/dmeggins/
Received on Friday, 1 May 1998 12:53:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT