[rfc-i] "vanity" reference anchors

Tony Hansen tony at att.com
Thu Apr 17 06:05:02 PDT 2014


On 4/17/14, 8:45 AM, Julian Reschke wrote:
> Hi there,
>
> people frequently ask for "vanity" reference anchors (where the anchor 
> is not the default, such as "RFC2616", but something more readable, 
> like "HTTP").
>
> A straightforward way to get this is to simply change the anchor 
> attribute value of the <reference> element.
>
> However, this
>
> a) doesn't work well with some people's workflows, where the 
> <reference> elements always are included from a bibliography, and
>
> b) it fails when the desired name isn't a valid XML ID (such as 
> something starting with a digit).
>
> Proposed solution:
>
> - allow people to embed "vanity name" mappings into the document, and
>
> - have these mappings *only* affect display
>
> Syntax:
>
>   <display-reference from="OLD" to="NEW" />
>
> ...where @from matches the existing reference/@anchor, and @to is the 
> replacement string, such as in
>
>   <display-reference from="RFC2616" to="HTTP" />
>
> Allow these elements in two places:
>
> 1) as child node of <rfc>
>
> 2) as child node of <references>
>
> Case 1) is useful for people who want to include a list of mappings 
> maintained in a separate file. Case 2) is useful so that the mapping 
> can be maintained close to the <reference> it affects.
>
> Syntax of @to: probably should be constrained, for instance, it 
> whitespace. A pragmatic approach might be to allow all XML name 
> characters (<http://www.w3.org/TR/REC-xml/#NT-NameChar>), lifting the 
> constraint on the first character...
>
> Best regards, Julian
>
> PS: xml2rfc IDs currently already allow non-ASCII characters (per 
> XML's ID rules); we probably should add a USASCII-constraint, right?

I think this is a clean solution to the problem.

I'm not sure how useful case 1 is, but don't mind it. A list of mappings 
maintained in a separate file can be expanded into the <references> 
section as easily as getting expanded into the <rfc> section.

     Tony Hansen


More information about the rfc-interest mailing list