Re: @xml:base with @rendition (and maybe other pointers)
Hugh Cayless <[email protected]> Wed, 3 May 2017 11:22:27 -0400
| Newsgroups | gmane.text.tei.general |
|---|---|
| Message-ID | <CAObhq+fDeCCK4zjh2cRK=pPpbNH3fi4Wrw4YqN6QiutVoeZ0Cg@mail.gmail.com> |
--001a1146cc105f6621054ea03962 Content-Type: text/plain; charset=UTF-8 > > A URI reference which is empty or begins with "#" is a same-document > reference only if the xml:base in scope at that point in the document is > the URI of the document itself. No. It's a same-document reference even if the base URI is different from the document URI, because the algorithm for resolving it will compare it to the base URI, not the document URI. I will freely admit this is a bit weird, but it is definitively weird. On Wed, May 3, 2017 at 11:13 AM, Conal Tuohy <[email protected]> wrote: > Are you taking "a same-document reference" to mean "a reference which is > empty or only a fragment identifier"? Because I think that's a mistaken > reading. > > A "same-document reference" is just one which refers to the same document. > A same-document reference may have any form; it may be an absolute URI or a > relative URI, and it may contain just a "#" and a fragment identifier. A > URI reference which is empty or begins with "#" is a same-document > reference only if the xml:base in scope at that point in the document is > the URI of the document itself. > > The point of the quoted passage, to my mind, is not really about URI > syntax; it's rather to stress that when a same-document reference is > resolved, for retrieval, there's no need to actually retrieve a new copy of > it from the network. > > On 4 May 2017 at 00:40, Hugh Cayless <[email protected]> wrote: > >> Once again, from RFC 3896: >> >> >> 4.4 <https://tools.ietf.org/html/rfc3986#section-4.4>. Same-Document Reference >> >> When a URI reference refers to a URI that is, aside from its fragment >> component (if any), identical to the base URI (Section 5.1 <https://tools.ietf.org/html/rfc3986#section-5.1>), that >> reference is called a "same-document" reference. The most frequent >> examples of same-document references are relative references that are >> empty or include only the number sign ("#") separator followed by a >> fragment identifier. >> >> When a same-document reference is dereferenced for a retrieval >> action, the target of that reference is defined to be within the same >> entity (representation, document, or message) as the reference; >> therefore, a dereference should not result in a new retrieval action. >> >> >> That second paragraph is crucial. It doesn't matter if you've used @xml:base to change the base URI, >> >> I can't interpret that in the way you, Syd, and Martin seem to be. What am I missing? >> >> >> On Wed, May 3, 2017 at 10:29 AM, Conal Tuohy <[email protected]> >> wrote: >> >>> >>> On 3 May 2017 at 04:52, Syd Bauman <[email protected]> wrote: >>> >>>> Martin has taken the words right out of my mouth: >>>> >>> >>> I agree with Martin and Syd that xml:base must apply to any URIs, >>> including those whose reference is just a fragment identifier (e.g. "#foo"). >>> >>> The TEI schema claims to support xml:base, and the Guidelines give a >>> clear example of how to use it to set the base URI of a pointer whose URI >>> is just a fragment identifier. >>> >>> http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ST.html#STGAba >>> >>> <body> >>>> <div xml:base="http://www.example.org/somewhere.xml"> >>>> <p> >>>> <!--... --> >>>> <ptr target="#p1"/> >>>> <!--... --> >>>> </p> >>>> </div> >>>> <div> >>>> <p> >>>> <!--... --> >>>> <ptr target="#p1"/> >>>> <!--... --> >>>> </p> >>>> </div> >>>> </body> >>>> >>> >>> >>>> The first ptr >>>> <http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-ptr.html> element >>>> here is within the scope of a div >>>> <http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-div.html> which >>>> supplies a value for xml:base; its target is therefore to be found at >>>> http://www.example.org/somewhere.xml#p1 >>> >>> >>> >>> I can understand how encoders might wish xml:base to apply to some URIs >>> in their document and not others, so that they could conveniently use short >>> URIs for different purposes, with different xml:base URIs, but that's not >>> how xml:base works, and I think nothing good can come from just flouting >>> the xml:base specification. >>> >>> >>>> But I also have to admit, I'm not 100% sure how >>>> | <note xml:base="http://www.example.edu/SydNotes.xml" >>>> target="#silly"/> >>>> is supposed to be dereferenced. I have always thought it meant >>>> the element at http://www.example.edu/SydNotes.xml#silly. But RFC >>>> 3986 "Uniform Resource Identifier (URI): Generic Syntax" says >>>> | When a same-document reference is dereferenced for a retrieval >>>> | action, the target of that reference is defined to be within the >>>> | same entity (representation, document, or message) as the >>>> | reference; therefore, a dereference should not result in a new >>>> | retrieval action. >>>> which confuses me. >>>> >>> >>> I think your confusion may come from interpreting the phrase "a >>> same-document reference" as meaning "a reference whose lexical form is just >>> a fragment identifier". The confusion disappears if you take "same-document >>> reference" to mean "a URI reference, whether absolute or relative, which, >>> when resolved using xml:base, refers to a location in the same document". I >>> think the point of this passage is just to stress that same-document >>> references (whatever their syntax) should not be retrieved from the network. >>> >>> >>>> All this leads me to prefer <prefixDef> over @xml:base. >>>> >>> >>> Yes, if the TEI schema were changed so that prefixDef could be used more >>> widely, such as to point to renditions, images, and so on, then the >>> strictures of xml:base would not be seen as a problem. You could have e.g. >>> >>> <pb facsCRef="image:1.jpg"/> >>> <head renditionCRef="rendition:historiated>...</head> >>> >>> >>> -- >>> Conal Tuohy >>> http://conaltuohy.com/ >>> @conal_tuohy >>> +61-466-324297 <+61%20466%20324%20297> >>> >> >> > > > -- > Conal Tuohy > http://conaltuohy.com/ > @conal_tuohy > +61-466-324297 <+61%20466%20324%20297> > --001a1146cc105f6621054ea03962 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px = 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span st= yle=3D"font-size:12.8px">A URI reference which is empty or begins with &quo= t;#" is a same-document reference only if the xml:base in scope at tha= t point in the document is the URI of the document itself.=C2=A0</span></bl= ockquote><div><br></div><div>No. It's a same-document reference even if= the base URI is different from the document URI, because the algorithm for= resolving it will compare it to the base URI, not the document URI. I will= freely admit this is a bit weird, but it is definitively weird.=C2=A0</div= ></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Wed, Ma= y 3, 2017 at 11:13 AM, Conal Tuohy <span dir=3D"ltr"><<a href=3D"mailto:= [email protected]" target=3D"_blank">[email protected]</a>></spa= n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b= order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Are you taking= "a same-document reference" to mean "a reference which is e= mpty or only a fragment identifier"? Because I think that's a mist= aken reading.<div><br></div><div>A "same-document reference" is j= ust one which refers to the same document. A same-document reference may ha= ve any form; it may be an absolute URI or a relative URI, and it may contai= n just a "#" and a fragment identifier. A URI reference which is = empty or begins with "#" is a same-document reference only if the= xml:base in scope at that point in the document is the URI of the document= itself.=C2=A0</div><div><br></div><div>The point of the quoted passage, to= my mind, is not really about URI syntax; it's rather to stress that wh= en a same-document reference is resolved, for retrieval, there's no nee= d to actually retrieve a new copy of it from the network.</div></div><div c= lass=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><br><div class= =3D"gmail_quote">On 4 May 2017 at 00:40, Hugh Cayless <span dir=3D"ltr"><= ;<a href=3D"mailto:[email protected]" target=3D"_blank">philomousos@gma= il.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"= margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"= ltr"><pre class=3D"m_6755816766362183326m_371459931628482669gmail-newpage" = style=3D"font-size:13.3333px;margin-top:0px;margin-bottom:0px;color:rgb(0,0= ,0)"><span class=3D"m_6755816766362183326m_371459931628482669gmail-h3" styl= e=3D"line-height:0pt;display:inline;font-size:1em"><font face=3D"arial, hel= vetica, sans-serif">Once again, from RFC 3896:</font></span></pre><pre clas= s=3D"m_6755816766362183326m_371459931628482669gmail-newpage" style=3D"font-= size:13.3333px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span cla= ss=3D"m_6755816766362183326m_371459931628482669gmail-h3" style=3D"line-heig= ht:0pt;display:inline;font-size:1em;font-weight:bold"><br></span></pre><pre= class=3D"m_6755816766362183326m_371459931628482669gmail-newpage" style=3D"= font-size:13.3333px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><spa= n class=3D"m_6755816766362183326m_371459931628482669gmail-h3" style=3D"line= -height:0pt;display:inline;font-size:1em;font-weight:bold"><h3 style=3D"lin= e-height:0pt;display:inline;font-size:1em"><a class=3D"m_675581676636218332= 6m_371459931628482669gmail-selflink" name=3D"m_6755816766362183326_m_371459= 931628482669_section-4.4" href=3D"https://tools.ietf.org/html/rfc3986#secti= on-4.4" style=3D"color:black;text-decoration-line:none" target=3D"_blank">4= .4</a>. Same-Document Reference</h3></span><span> When a URI reference refers to a URI that is, aside from its fragment component (if any), identical to the base URI (<a href=3D"https://tools.= ietf.org/html/rfc3986#section-5.1" target=3D"_blank">Section 5.1</a></span>= ), that reference is called a "same-document" reference. The most fre= quent examples of same-document references are relative references that are empty or include only the number sign ("#") separator followed= by a fragment identifier. When a same-document reference is dereferenced for a retrieval action, the target of that reference is defined to be within the same entity (representation, document, or message) as the reference; therefore, a dereference should not result in a new retrieval action.</p= re><pre class=3D"m_6755816766362183326m_371459931628482669gmail-newpage" st= yle=3D"font-size:13.3333px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0= )"><br></pre><pre class=3D"m_6755816766362183326m_371459931628482669gmail-n= ewpage" style=3D"font-size:13.3333px;margin-top:0px;margin-bottom:0px;color= :rgb(0,0,0)"><font face=3D"arial, helvetica, sans-serif">That second paragr= aph is crucial. It doesn't matter if you've used @xml:base to chang= e the base URI, </font></pre><pre class=3D"m_6755816766362183326m_371459931= 628482669gmail-newpage" style=3D"font-size:13.3333px;margin-top:0px;margin-= bottom:0px;color:rgb(0,0,0)"><font face=3D"arial, helvetica, sans-serif">I = can't interpret that in the way you, Syd, and Martin seem to be. What a= m I missing?</font></pre></div><div class=3D"m_6755816766362183326HOEnZb"><= div class=3D"m_6755816766362183326h5"><div class=3D"gmail_extra"><br><div c= lass=3D"gmail_quote">On Wed, May 3, 2017 at 10:29 AM, Conal Tuohy <span dir= =3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">con= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_quot= e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">= <div dir=3D"ltr"><div><div><br></div></div><div class=3D"gmail_extra"><div = class=3D"gmail_quote"><span>On 3 May 2017 at 04:52, Syd Bauman <span dir=3D= "ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">s.= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmail= _quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204= ,204);padding-left:1ex">Martin has taken the words right out of my mouth:<b= r></blockquote><div>=C2=A0</div></span><div>I agree with Martin and Syd tha= t xml:base must apply to any URIs, including those whose reference is just = a fragment identifier (e.g. "#foo").<div><br></div><div>The TEI s= chema claims to support xml:base, and the Guidelines give a clear example o= f how to use it to set the base URI of a pointer whose URI is just a fragme= nt identifier.<br></div><div><div><br></div><div><a href=3D"http://www.tei-= c.org/release/doc/tei-p5-doc/en/html/ST.html#STGAba" target=3D"_blank">http= ://www.tei-c.org/release/d<wbr>oc/tei-p5-doc/en/html/ST.html#<wbr>STGAba</a= ><br></div><div><br></div><div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex"><span class=3D"m_6755816766362183326m_371459931628482669m_-8967586278= 758067885element" style=3D"font-weight:bold"><body><br></span>=C2=A0<= span class=3D"m_6755816766362183326m_371459931628482669m_-89675862787580678= 85element" style=3D"font-weight:bold"><div=C2=A0<span class=3D"m_6755816= 766362183326m_371459931628482669m_-8967586278758067885gmail-attribute" styl= e=3D"color:rgb(34,34,136)">xml:base</span>=3D"<span class=3D"m_6755816= 766362183326m_371459931628482669m_-8967586278758067885gmail-attributevalue"= ><a href=3D"http://www.example.org/somewhere.xml" target=3D"_blank">http://= www.exa<wbr>mple.org/somewhere.xml</a></span>"><br></span>=C2=A0=C2= =A0<span class=3D"m_6755816766362183326m_371459931628482669m_-8967586278758= 067885element" style=3D"font-weight:bold"><p><br></span><span class= =3D"m_6755816766362183326m_371459931628482669m_-8967586278758067885gmail-co= mment" style=3D"font-style:italic"><!--... --><br></span>=C2=A0=C2=A0= =C2=A0<span class=3D"m_6755816766362183326m_371459931628482669m_-8967586278= 758067885element" style=3D"font-weight:bold"><ptr=C2=A0<span class=3D"m_= 6755816766362183326m_371459931628482669m_-8967586278758067885gmail-attribut= e" style=3D"color:rgb(34,34,136)">target</span>=3D"<span class=3D"m_67= 55816766362183326m_371459931628482669m_-8967586278758067885gmail-attributev= alue">#p1</span>"/><br></span><span class=3D"m_6755816766362183326m= _371459931628482669m_-8967586278758067885gmail-comment" style=3D"font-style= :italic"><!--... --><br></span>=C2=A0=C2=A0<span class=3D"m_675581676= 6362183326m_371459931628482669m_-8967586278758067885element" style=3D"font-= weight:bold"></p><br></span>=C2=A0<span class=3D"m_675581676636218332= 6m_371459931628482669m_-8967586278758067885element" style=3D"font-weight:bo= ld"></div><br></span>=C2=A0<span class=3D"m_6755816766362183326m_3714= 59931628482669m_-8967586278758067885element" style=3D"font-weight:bold"><= ;div><br></span>=C2=A0=C2=A0<span class=3D"m_6755816766362183326m_371459= 931628482669m_-8967586278758067885element" style=3D"font-weight:bold"><p= ><br></span><span class=3D"m_6755816766362183326m_371459931628482669m_-8= 967586278758067885gmail-comment" style=3D"font-style:italic"><!--... --&= gt;<br></span>=C2=A0=C2=A0=C2=A0<span class=3D"m_6755816766362183326m_37145= 9931628482669m_-8967586278758067885element" style=3D"font-weight:bold"><= ptr=C2=A0<span class=3D"m_6755816766362183326m_371459931628482669m_-8967586= 278758067885gmail-attribute" style=3D"color:rgb(34,34,136)">target</span>= =3D"<span class=3D"m_6755816766362183326m_371459931628482669m_-8967586= 278758067885gmail-attributevalue">#p1</span>"/><br></span><span cla= ss=3D"m_6755816766362183326m_371459931628482669m_-8967586278758067885gmail-= comment" style=3D"font-style:italic"><!--... --><br></span>=C2=A0=C2= =A0<span class=3D"m_6755816766362183326m_371459931628482669m_-8967586278758= 067885element" style=3D"font-weight:bold"></p><br></span>=C2=A0<span = class=3D"m_6755816766362183326m_371459931628482669m_-8967586278758067885ele= ment" style=3D"font-weight:bold"></div><br></span><span class=3D"m_67= 55816766362183326m_371459931628482669m_-8967586278758067885element" style= =3D"font-weight:bold"></body><br></span></blockquote><div>=C2=A0</div= ><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border= -left:1px solid rgb(204,204,204);padding-left:1ex"><span class=3D"m_6755816= 766362183326m_371459931628482669m_-8967586278758067885element" style=3D"fon= t-weight:bold"></span><span style=3D"color:rgb(0,0,0);font-family:verdana,t= ahoma,geneva,arial,helvetica,sans-serif;font-size:12.8px">The first=C2=A0</= span><a class=3D"m_6755816766362183326m_371459931628482669m_-89675862787580= 67885gmail-gi" title=3D"(pointer) defines a pointer to another location." h= ref=3D"http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-ptr.html" st= yle=3D"font-family:verdana,tahoma,geneva,arial,helvetica,sans-serif;font-si= ze:12.8px" target=3D"_blank">ptr</a><span style=3D"color:rgb(0,0,0);font-fa= mily:verdana,tahoma,geneva,arial,helvetica,sans-serif;font-size:12.8px">=C2= =A0element here is within the scope of a=C2=A0</span><a class=3D"m_67558167= 66362183326m_371459931628482669m_-8967586278758067885gmail-gi" title=3D"(te= xt division) contains a subdivision of the front, body, or back of a text."= href=3D"http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-div.html" = style=3D"font-family:verdana,tahoma,geneva,arial,helvetica,sans-serif;font-= size:12.8px" target=3D"_blank">div</a><span style=3D"color:rgb(0,0,0);font-= family:verdana,tahoma,geneva,arial,helvetica,sans-serif;font-size:12.8px">= =C2=A0which supplies a value for=C2=A0</span><span class=3D"m_6755816766362= 183326m_371459931628482669m_-8967586278758067885gmail-att" style=3D"color:r= gb(0,0,0);font-family:verdana,tahoma,geneva,arial,helvetica,sans-serif;font= -size:12.8px">xml:base</span><span style=3D"color:rgb(0,0,0);font-family:ve= rdana,tahoma,geneva,arial,helvetica,sans-serif;font-size:12.8px">; its targ= et is therefore to be found at=C2=A0</span><code style=3D"font-weight:bold;= font-size:12.48px;color:rgb(0,0,0)"><a href=3D"http://www.example.org/somew= here.xml#p1" target=3D"_blank">http://www.example.org/some<wbr>where.xml#p1= </a></code></blockquote></div><div><br></div><div><br></div><div>I can unde= rstand how encoders might wish xml:base to apply to some URIs in their docu= ment and not others, so that they could conveniently use short URIs for dif= ferent purposes, with different xml:base URIs, but that's not how xml:b= ase works, and I think nothing good can come from just flouting the xml:bas= e specification.=C2=A0</div></div></div><span><div>=C2=A0</div><blockquote = class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol= id rgb(204,204,204);padding-left:1ex"><span class=3D"m_6755816766362183326m= _371459931628482669m_-8967586278758067885gmail-"> </span>But I also have to admit, I'm not 100% sure how<br> | <note xml:base=3D"<a href=3D"http://www.example.edu/SydNotes.xml"= rel=3D"noreferrer" target=3D"_blank">http://www.example.e<wbr>du/SydNotes.= xml</a>" target=3D"#silly"/><br> is supposed to be dereferenced. I have always thought it meant<br> the element at <a href=3D"http://www.example.edu/SydNotes.xml#silly" rel=3D= "noreferrer" target=3D"_blank">http://www.example.edu/SydNote<wbr>s.xml#sil= ly</a>. But RFC<br> 3986 "Uniform Resource Identifier (URI): Generic Syntax" says<br> |=C2=A0 When a same-document reference is dereferenced for a retrieval<br> |=C2=A0 action, the target of that reference is defined to be within the<br= > |=C2=A0 same entity (representation, document, or message) as the<br> |=C2=A0 reference; therefore, a dereference should not result in a new<br> |=C2=A0 retrieval action.<br> which confuses me.<br></blockquote><div><br></div></span><div>I think your = confusion may come from interpreting the phrase "a same-document refer= ence" as meaning "a reference whose lexical form is just a fragme= nt identifier". The confusion disappears if you take "same-docume= nt reference" to mean "a URI reference, whether absolute or relat= ive, which, when resolved using xml:base, refers to a location in the same = document". I think the point of this passage is just to stress that sa= me-document references (whatever their syntax) should not be retrieved from= the network.</div><span><div><br></div><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad= ding-left:1ex"><br> All this leads me to prefer <prefixDef> over @xml:base.<br> </blockquote></span></div><div class=3D"gmail_extra"><br></div>Yes, if the = TEI schema were changed so that prefixDef could be used more widely, such a= s to point to renditions, images, and so on, then the strictures of xml:bas= e would not be seen as a problem. You could have e.g.</div><div class=3D"gm= ail_extra"><br></div><div class=3D"gmail_extra"><pb facsCRef=3D"ima= ge:1.jpg"/></div><div class=3D"gmail_extra"><head renditionCRef= =3D"rendition:histo<wbr>riated>...</head><span class=3D"m_675= 5816766362183326m_371459931628482669HOEnZb"><font color=3D"#888888"><br><br= clear=3D"all"><div><br></div>-- <br><div class=3D"m_6755816766362183326m_3= 71459931628482669m_-8967586278758067885gmail_signature"><div dir=3D"ltr"><d= iv><div dir=3D"ltr"><div><div>Conal Tuohy<br></div><a href=3D"http://conalt= uohy.com/" target=3D"_blank">http://conaltuohy.com/</a><br></div>@conal_tuo= hy<br><a href=3D"tel:+61%20466%20324%20297" value=3D"+61466324297" target= =3D"_blank">+61-466-324297</a><br></div></div></div></div> </font></span></div></div> </blockquote></div><br></div> </div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>= <div class=3D"m_6755816766362183326gmail_signature" data-smartmail=3D"gmail= _signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div>Conal Tuohy<br= ></div><a href=3D"http://conaltuohy.com/" target=3D"_blank">http://conaltuo= hy.com/</a><br></div>@conal_tuohy<br><a href=3D"tel:+61%20466%20324%20297" = value=3D"+61466324297" target=3D"_blank">+61-466-324297</a><br></div></div>= </div></div> </div> </div></div></blockquote></div><br></div> --001a1146cc105f6621054ea03962--