AttributeMap (was Re: Announcement: SAX 1998-01-12 Draft)

David Megginson ak117 at freenet.carleton.ca
Thu Jan 15 11:49:32 GMT 1998


James Clark writes:

 > Why do we get abstraction and extensibility for attributes but for
 > nothing else?

I'm not happy with the current SAX solution to attributes, and am
paying close attention to all of the excellent suggestions on this
list.  AttributeMap will certainly change somehow in the next release
in a few weeks.

I think that it was Paul Prescod who pointed out that data entities
and notations are basic features of XML in the current version, and
that even a simple API should provide access to them.  In XML, the
only point of contact with notations or data entities is through
attribute values, so for the first draft, I put that information into
AttributeMap to keep it out of the way of the rest of the interface.

Another alternative is to keep AttributeMap simple and to add some
query routines to org.xml.sax.Parser:

  public int getAttributeType (String elname, String aname)
  public String getEntityNotation (String ename)
  public String getEntityPublicID (String ename)
  public String getEntitySystemID (String ename)
  public String getNotationPublicID (String nname)
  public String getNotationSystemID (String nname)

This is the way that I do it in AElfred, but there I provide a pointer
to the parser as the first argument to every callback, so these
queries are simpler to perform, and I also provide many other
DTD-related queries.  I've wanted to keep the Parser interface dead
simple, since users need to learn it right away, and to put the
complexity in AttributeMap, which users can learn later when they are
more advanced: in XML (unlike full SGML), notations and data entities
really are purely attribute-related information.

The third alternative is, of course, to provide no access to this
information at all.  I would do this only if I had clear indication
from the WG that data entities and notations are deprecated relics
from full SGML that will likely be removed in XML 1.1; otherwise, I
have to assume that, as in full SGML, they will be the standard method
for including non-XML objects such as graphics, audio, and video, and
that even a simple API needs to provide access to them.


All the best,


David

-- 
David Megginson                 ak117 at freenet.carleton.ca
Microstar Software Ltd.         dmeggins at microstar.com
      http://home.sprynet.com/sprynet/dmeggins/

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




More information about the Xml-dev mailing list