Kent,
can you provide examples where this particular type is useful? Or were
you generally looking for a type to name things and the XSD token type
was the first one that came your mind?
If the goal is to define a type for identifiers, then we likely should
follow the Unicode standard annex UAX-31 and make use of <XID_Start>
<XID_Continue>, which is what I think Python3 and Rust are using as
the basis for their notion of language identifiers (but then the
Unicode definitions are also criticized as buggy). A challenge is that
the definition of <XID_Start> and <XID_Continue> seems to evolve with
the unicode version. And once you start digging into the various
attempts of modern programming languages to support internationalized
identifiers, you discover that this is far from trivial to get right.
/js
On Thu, Apr 18, 2019 at 04:51:21AM +0000, Kent Watsen wrote:
>
> Many times in models I want a non-empty version of what XSD calls a "token":
>
> token A string that does not contain line feeds,
> carriage returns, tabs, leading or trailing
> spaces, or multiple spaces.
>
> So how about the following?
>
> typedef token {
> type string;
> length "1.max"; // non-empty (some expr do this already)
> pattern "[^\n\r\t"]+" // no LFs, CRs, or Tabs
> pattern "[^ ].*"; // no leading space (min-length 1?)
> pattern ".*[^ ]"; // no trailing space (min-length 1?)
> pattern ".*[^ ][^ ].*" // no multiple spaces (min-length 2?)
> }
>
> Kent // contributor
>
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod
--
Juergen Schoenwaelder Jacobs University Bremen gGmbH
Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
Fax: +49 421 200 3103 <https://www.jacobs-university.de/>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod