[
Lists Home |
Date Index |
Thread Index
]
- From: Jay Sachs <jay@avacet.com>
- To: xml-dev@xml.org
- Date: Mon, 07 Aug 2000 09:53:46 -0400
Norman Walsh wrote:
>
> / Jay Sachs <jay@avacet.com> was heard to say:
> [...]
> | An
> | EntityResolver can (and probably should be required to) set the systemId
> | of the returned InputSource. If the systemId is the same as the URI
> | being "resolved", there is no redirection. If this is different, a
> | redirection has occurred.
>
> I certainly agree that an entity resolver can return any resource it
> wants, and that the entity resolver is free to choose to inform the
> application that the system identifier is anything it wants. (I'll
> even argue that it should be allowed to return null if it wants, that
> case is carefully spelled out in RFC2396.)
To be explicit here: a "null" systemId on the returned InputSource would
mean that 5.1.2 applies, and the URI is that of the enclosing context?
Or that no redirection had occurred? Or do you mean that section 5.1.4
applies and it's now up to the application? I suspect the first (section
5.1.2) is more conforming to the RFC.
> The case that I am specifically seeking community agreement on is the
> second: if the URI returned in the systemIdentifier property of the
> InputSource returned by the entityResolver is not the same sas the
> systemIdentifier that was passed in, "redirection" has occurred (in
> the RFC2396 sense) and subsequent relative URIs are relative to that
> location.
I'd concur that the best (only?) way to define "redirection" when
dealing with EntityResolvers and InputSources is in the difference
between systemIds.
> | > > To make things concrete, suppose I have a document with a DOCTYPE
> | > > declaration that references http://foo.bar/baz.dtd (and I'm doing a
> | > > validating parse). The parser attempts to open http://foo.bar/baz.dtd,
> | > > and the entity resolver opens and returns http://moo.goo/boo.dtd
> | > > instead.
>
> [I forgot to explicitly say that it also sets the systemId of the
> InputSource it returns to http://moo.goo/boo.dtd]
>
> | > > Subsequently, the parser encounters a relative URI "somefile.ent" in
> | > > the DTD. It must calculate an absolute URI in order to open it.
> | > >
> | > > Is the resulting absolute URI "http://foo.bar/somefile.ent" or
> | > > "http://moo.goo/somefile.ent"? Or is there not a definitive answer?
> | >
> | > I'd say that it resolves to "http://foo.bar/somefile.net". It's up to
> | > the EntityResolver to do the same redirection-like behavior if that's
> | > what's it is intended to do.
>
> I gather, Jay, that you've reconsidered and now believe that it should
> be http://moo.goo/somefile.ent. Is that right?
Given that the systemId was changed, yes: a redirection has occurred,
and the resulting URI is now http://moo.goo/somefile.net.
jay
|