[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SAX 2.0 enhancement proposal
- From: James Clark <jjc@jclark.com>
- To: Rob Lugt <roblugt@elcel.com>, xml-dev@lists.xml.org
- Date: Thu, 14 Jun 2001 12:18:53 +0700
> In my view, an improved EntityResolver interface (perhaps for SAX 3.0)
would
> be :
>
> interface EntityResolver
> {
> public InputSource resolveEntity(java.lang.String name,
> java.lang.String
> publicId,
> java.lang.String
> systemId,
> java.lang.String
> baseUri)
> throws SAXException, java.io.IOException;
> }
>
> This would give the EntityResolver everything it needs to do the job. If
it
> wanted to absolutize the system identifier then it could do so, but it
would
> also have access to the bare value.
I think it's generally a good idea for XML parsers to pass applications both
the system id and the base URI: it provides a little bit more flexibility.
The interfaces to both expat and XP do this.
If you change this, you also need to change DTDHandler to pass a baseURI and
the system ID. This would align better with the infoset
http://www.w3.org/TR/xml-infoset/#infoitem.entity.unparsed
> I propose a simple extension to SAX 2.0 in
> the guise of a new standard feature:
> http://xml.org/sax/features/absolutize-system-identifiers. The default
> value could be "true" to maintain compatibility with existing systems.
> Applications could set it to "false" when they want a conforming catalog
> processor.
You need both the base URI and the unabsolutized system ID. I would use a
hack like having the systemId arg contain both the base URI and the system
ID separated by some character that is not allowed in XML (such as '\0').
James