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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   SAX: External Entity Start and End (question 2 of 10)

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <ak117@freenet.carleton.ca>
  • To: xml-dev Mailing List <xml-dev@ic.ac.uk>
  • Date: Sat, 3 Jan 1998 10:04:22 -0500

[SAX is a proposal for a simple, event-based XML API, using
callbacks.  This is one in a series of ten design questions that we
need to answer to implement the API.]

Should SAX generate events for the start and end of an external
entity?

  public void startEntity (String ename, String systemID);
  public void endEntity (String ename);


CON
---

- these will make SAX slightly larger;

- these belong to the physical structure of the XML document, while
  SAX concentrates on logical structure;

- these will be difficult concepts for non-XML people to understand;

- a SAX application should always see a single document, regardless of
  the entity structure.


PRO
---

- if an application is derived from XmlAppBase, it can simply ignore
  these events if it doesn't need them;

- many XML-related proposals use URLs or URIs in attribute values and
  in processing instructions; if relative URIs need to be resolved
  against the location of the external entity rather than the location
  of the document entity, then the user will have to have a way to
  determine the location of the current external entity.


MY RECOMMENDATION
-----------------

Qualified yes.

It may be that without these events, SAX is incapable of supporting
XLL, XSL, or architectural forms; if this turns out to be the case,
then SAX will not be useful for a large range of XML applications.

The key is whether, when I have something like

  <link href="foo.xml">link to foo</link>

an application is supposed to resolve "foo.xml" against the URI of the
current entity, or the URI of the document entity.


OTHER CONSIDERATIONS
--------------------

Are public IDs important enough to be included?

    public void startExternalEntity (String ename, String publicID,
                                   String systemID)

We could simplify things further for most users if the XmlAppBase
class implemented final versions of these handlers and maintained its
own entity stack, providing an additional getCurrentEntity() query
method (not part of the interface).



All the best,


David

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

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