Re: [Last-Call] Language tags and YANG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-06-30, at 13:01, tom petch <daedulus@xxxxxxxxxxxxx> wrote:
> 
> Second, what is a suitable constraint on a YANG string to be a language tag?  If Carsten's length constraint is adequate, then I would advise authors to RYO as opposed to waiting for 6991-bis; if something more complex is needed, especially if it involves restricting the choice of characters, then it probably belongs in 6991-bis.

I got the regexp from XSD [1], where Martin pointed me to.
Specifically:

[1]: https://www.w3.org/TR/xmlschema11-2/#language

Which defines »language« using the pattern (iregexp):

[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*

This in turn cites RFC 3066 (Obsoleted by RFC4646 [Obsoleted by RFC 5646] and RFC4647), which contains:

    Language-Tag = Primary-subtag *( "-" Subtag )

    Primary-subtag = 1*8ALPHA

    Subtag = 1*8(ALPHA / DIGIT)

(which is the ABNF way of saying and explaining the iregexp above.)

The RFC 3066 ABNF was replaced by the more restrictive ABNF grammar in RFC 4646, which was updated a bit in RFC 5646 (demonstrating that the restrictive approach is less stable).

Note that 
[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*
is a bit more than a length restriction, it is also defining the characters that can be used in a language tag.

I would think that having that as a YANG data type would be good, but of course I have no opinion whether this needs to be in 6991bis.

Grüße, Carsten

-- 
last-call mailing list
last-call@xxxxxxxx
https://www.ietf.org/mailman/listinfo/last-call




[Index of Archives]     [IETF Annoucements]     [IETF]     [IP Storage]     [Yosemite News]     [Linux SCTP]     [Linux Newbies]     [Mhonarc]     [Fedora Users]

  Powered by Linux