Xapi-J: proposed interface to Document

Richard Light richard at light.demon.co.uk
Mon Jul 21 11:21:21 BST 1997


In message <33D19C41.41E547CD at datachannel.com>, John Tigue
<jtigue at datachannel.com> writes
>I would like to propose an addition to Xapi-J which would be the start
>of the interface to a document.
>
>The current definition of Xapi-J focuses on the interface IXMLProcessor
>and its method readXML() which returns a reference to an IElement which
>represents the root element of the processed document. This choice was
>made simply because it reflected the lowest common denominator of the
>currently available XML processors. The results are proving to be
>awkward.
>
>For example, a processor might construct a representation of the entire
>document including any internal DTD. As Xapi-J currently stands, the DTD
>representation would not be accessible because only the root element is
>returned from readXML() rather than a reference to the entire document.
>
>Perhaps it would be better to return a reference to the document. The
>root would then be available through, say, IDocument.getRoot(). As such
>I would like to propose the following beginning to IDocument:
>...

(Read 'XML' for 'SGML' throughout!) 

This is exactly the sort of problem which adopting the 'grove plan'
approach is meant to deal with.  In line with your suggestion, the SGML
property set starts with the class sgmldoc, or 'SGML document', which is
'the parsed SGML document. The root of the grove.'  

This is _not_ the root element of the document instance: the 'document
element' is just one of the properties of the sgmldoc class.  sgmldoc
has the following properties that might be relevant to XAPI:

  - prolog (as per XML's 'prolog' - contains the internal and external
DTD subset);
  - epilog (equivalent to the 'Misc*' which follows the document
element);
  - docelem ('document element' - the root element of the document
instance);
  - elements (all the elements in the document which have unique
identifiers - handy for processing XPointers, etc.);
  - entities (the explicitly declared general entities, followed by the
defaulted entities)

(There are others!)

Putting it less formally, the SGML property set matches all the concepts
which are defined in XML. Thus the XML production [23] for 'document':

document ::= Prolog element Misc*

is equivalent to the sgmldoc class, which in turn has properties which
are equivalent to 'Prolog' (prolog), 'element' (docelem) and 'Misc*'
(epilog).

In my view, XAPI should be taking advantage of this existing framework
(and naming conventions) where it is relevant to XML's requirements.
Didn't someone do a summary of the relevant classes and properties a
couple of months back?

Richard Light
SGML and Museum Information Consultancy
richard at light.demon.co.uk
3 Midfields Walk 
Burgess Hill
West Sussex RH15 8JA
U.K.
tel. (44) 1444 232067

xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa at ic.ac.uk)




More information about the Xml-dev mailing list