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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Entity resolution vs. URI resolution

[ Lists Home | Date Index | Thread Index ]

/ Elliotte Rusty Harold <elharo@metalab.unc.edu> was heard to say:
| At 1:58 PM -0500 1/24/02, Norman Walsh wrote:
|
|>| offers exactly the functionality you're looking for:
|>|
|>| public URL(URL context,
|>|             String spec)
|>|      throws MalformedURLException
[...]
| The following methods are particularly interesting:
|
| public URI resolve(URI uri)
| public URI resolve(String uri)
|
| These return the absolute form of the uri argument using the current
| URI object as the context. Isn't this what you want?

Not at all. Given a possibly null public identifier and a system
identifier, the resolveEntity() method is free to perform any sort of
calculation that it wants. In particular, it is free to examine some
other resource (such as an external catalog, local cache, or the phase
of the moon) and return the InputStream for the entity.

With this facility, I can arrange things so that when I parse
documents that contain the system identifier
http://example.com/some.dtd, the actual DTD used is
file:/share/dtds/example.com/some.dtd. This is very convenient when
I don't happen to be on the net.

I want precisely the same facility for URIs that are retrieved in
contexts other than external identifiers. If someone asks for the
schema module http://example.com/module.xsd, or the XInclude
document ftp://example.com/sometext.xml, or the stylesheet module
urn:x-foo:example:stylesheet:module, I want the ability to determine
(with reference to any other resources I choose, though practically an
XML Catalog), what resource to actually return for the URI in
question.

And I don't want to shoehorn this into resolveEntity(null, myURI)
because that makes all URIs appear to be external identifiers, which
they aren't.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@Sun.COM   | A philosophical contempt of life is no
XML Standards Engineer | guarantee of courage in the face of
XML Technology Center  | death.--Gustave Vapereau
Sun Microsystems, Inc. | 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS