Re: @xml:base with @rendition (and maybe other pointers)
"C. M. Sperberg-McQueen" <[email protected]> Thu, 4 May 2017 11:37:19 -0600
| Newsgroups | gmane.text.tei.general |
|---|---|
| Message-ID | <[email protected]> |
> On May 3, 2017, at 5:53 PM, John P. McCaskey = <[email protected]> wrote: >=20 > So, bottom line: A standalone fragment identifier refers to the loaded = document and all the xml:base values above it in the hierarchy are = irrelevant. Encoders cannot use xml:base to direct a standalone = #fragment value to a location outside the loaded document. >=20 > Is that right? Yes and no. For some purposes, the ways in which the answer is 'no' are pedantic and can be ignored; for others they seem important. I did not respond to your summary yesterday, because objecting to=20 the wording you used seemed unnecessarily pedantic. Also, I=20 overlooked the second sentence, which I think is the wrong conclusion to draw.=20 Given the following fragment of resource http://example.org/eg.xml <div xml:base=3D"http://www.dictionary.com/a.html"> <p> <ref target=3D"#apple">Apple</ref> <ref target=3D"a.html#avocado">Avocado</ref> <ref target=3D"http://www.dictionary.com/a.html#anise">Anise</ref> </p> </div> we can consider two ways of interpreting the target attributes. Note that the discussion below ignores some possibly salient facts: - URIs can denote different resources at different moments. (The discussion assumes the URI-resource mapping is not changing.) =20 - A given resource can have multiple representations. (The discussion ignores any resulting complications.) =20 - URIs whose path component ends in .xml and .html do not necessarily have particular MIME types, so there is no guarantee that a fragment identifier like #apple will have similar meanings. (The discussion assumes that fragment identifiers point to elements assigned IDs by the HTML 'id' attribute and/or the xml:id attribute.) =20 Interpretation 1 ('xml:base values are irrelevant'). Ignore xml:base when resolving '#apple' [but not when resolving other relative references]. The target attributes are interpreted as denoting (a) http://example.org/eg.xml#apple (b) http://www.dictionary.com/a.html#avocado (c) http://www.dictionary.com/a.html#anise None of these have anything to do with any of: (d) http://www.dictionary.com/a.html#apple (e) http://example.org/eg.xml#avocado (f) http://example.org/eg.xml#anise =20 Of these, (a) is a same-document reference and RFC 3986 says it "should" be dereferenced without a new retrieval action. If a new retrieval action is nevertheless launched, the resource retrieved is (a). [It is not clear to me whether the XVAI ('xml:base values are irrelevant') interpretation takes a position on whether any of these other than (a) are same-document references.] Interpretation 2 ('same-document references can be surprising', or SRCBS). Resolve all relative references against the base URI in the usual way. Dereference same-document references either by looking in the same document (as recommended by RFC 3986) or by launching a new retrieval operation. The target attributes are resolved to the absolute forms (d) http://www.dictionary.com/a.html#apple (b) http://www.dictionary.com/a.html#avocado (c) http://www.dictionary.com/a.html#anise All of these are same-document references, so according to RFC 3986, they should be dereferenced without a new retrieval action. If a retrieval action is nevertheless launched, it will go to URIs (d), (b), (c) respectively, not (a), (e), (f). =46rom the fact that (d), (b), and (c) can be dereferenced without a new retrieval, it follows (as far as I can tell) that these three resources can also be denoted by URIs (a), (e), (f). The XVAI and SRCBS interpretations agree on the following proposition, which has important relevance for operations on the data: P1 The relative reference target=3D"#apple" can be dereferenced by locating the element in the current document with xml:id=3D"apple", if such an element exists. For people whose main interest is the truth or falsity of that proposition, then, the answer is "yes, that's right" -- the effect is the same, and all else is just pilpul. =46rom P1, it follows (I think) that P2 The resource identified by target=3D"#apple" is identified by the absolute URI http://example.org/eg.xml#apple ((a) above). The two interpretations disagree, or seem to disagree, on a number of other propositions, most obviously: P3 The relative reference '#apple' does not identify the resource identifed by http://www.dictionary.com/a.html#apple. XVAI does not actually entail P2, but it is compatible with P3. (To reach P3 it is necessary to assume some rule like "No two URIs identify the same thing" or "If we don't know that a URI identifies a thing, then it does not identify that thing.") SRCBS entails the negation of P3. They also prescribe different URIs for the case that software determines to perform a fresh retrieval action for the relative reference #apple: XVAI prescribes the absolute URI (a), SRCBS prescribes URI (d). I don=E2=80=99t believe anyone has seriously suggested XVAI as the relevant rule of interpretation for examples like the one given; what I have suggested (and I have understood Hugh Cayless=20 to be agreeing with) is SRCBS. Operationally, they can have similar results in some circumstances (specifically: they can=20 both result in no new retrieval action being undertaken in order to dereference =E2=80=98#apple=E2=80=99), but they differ in ways which = can be critical. ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC [email protected] http://www.blackmesatech.com ********************************************