[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SAX: New Idea for Entity Resolution

  • From: David Megginson <ak117@f...>
  • To: xml-dev Mailing List <xml-dev@i...>
  • Date: Wed, 15 Apr 1998 12:21:21 -0400

sax new
Here's a different idea for SAXEntityResolver, that would add the
ability for an application to return a character stream for _any_ URI
(rather than just the document root):

public interface SAXEntityResolver {
  public abstract String filterSystemId (String publicId, String systemId);
  public abstract SAXCharacterStream openCharacterStream (String systemId);
}

Here's how this would work:

1. The SAXParser calls the resolver's filterSystemId() method to see
   if the system ID needs to be translated.  If filterSystemId()
   returns null, the parser will use the default system ID; if it
   returns a string the will use that string as the system identifier.

2. The SAXParser calls the resolver's openCharacterStream() method to
   see if the application wants to open its own character stream.  If
   openCharacterStream() returns null, then the parser will take care
   of opening a character stream itself; if it returns a character
   stream, then the parser will use that character stream for the
   entity.

I like this approach because it does not add a new interface to SAX,
because it is consistent (in both cases, a null return value means
'let the parser do it'), and because it nicely separates the functions
of resolving identifiers and connecting to them.

It will, of course, not be necessary for most SAX application writers
to use this interface; when they do, however, they will be able to
handle _any_ URI scheme, and not just URLs.

On an even more interesting level, the object implementing this
interface could be sitting on a remote ORB and shared by many SAX
implementations (sort of like a DNS server).

On the down side, I don't think that it will be possible to build this
into a driver on top of any existing Java-based SAX parser, at least
without minor internal modifications.

Comments?


All the best,


David

-- 
David Megginson                 ak117@f...
Microstar Software Ltd.         dmeggins@m...
      http://home.sprynet.com/sprynet/dmeggins/

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.