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

Reply via email to