Ignore:
Timestamp:
Dec 29, 2009, 6:51:15 AM (10 years ago)
Author:
julian.reschke@…
Message:

Syntax notation: mention "obs-" prefix convention. List rule: clarify intro, add note about how empty list elements contribute to the total number of elements, add examples. Related to #36.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p1-messaging.xml

    r729 r738  
    338338   and WSP (whitespace).
    339339</t>
     340<t>
     341   As a syntactical convention, ABNF rule names prefixed with "obs-" denote
     342   "obsolete" grammar rules that appear for historical reasons.
     343</t>
    340344
    341345<section title="ABNF Extension: #rule" anchor="notation.abnf">
    342   <t>
    343     One extension to the ABNF rules of <xref target="RFC5234"/> is used to
    344     improve readability.
    345   </t>
    346   <t>
    347     A construct "#" is defined, similar to "*", for defining lists of
    348     elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating at least
    349     &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single comma
    350     (",") and optional whitespace (OWS).   
    351   </t>
    352   <figure><preamble>
    353     Thus,
     346<t>
     347  The #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
     348  improve readability.
     349</t>
     350<t>
     351  A construct "#" is defined, similar to "*", for defining comma-delimited
     352  lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
     353  at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
     354  comma (",") and optional whitespace (OWS,
     355  <xref target="basic.rules"/>).   
     356</t>
     357<figure><preamble>
     358  Thus,
    354359</preamble><artwork type="example">
    355360  1#element =&gt; element *( OWS "," OWS element )
    356361</artwork></figure>
    357   <figure><preamble>
    358     and:
     362<figure><preamble>
     363  and:
    359364</preamble><artwork type="example">
    360365  #element =&gt; [ 1#element ]
    361366</artwork></figure>
    362   <figure><preamble>
    363     and for n &gt;= 1 and m &gt; 1:
     367<figure><preamble>
     368  and for n &gt;= 1 and m &gt; 1:
    364369</preamble><artwork type="example">
    365370  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
    366371</artwork></figure>
    367   <t>
    368     For compatibility with legacy list rules, recipients &SHOULD; accept empty
    369     list elements. In other words, consumers would follow the list productions:
    370   </t>
     372<t>
     373  For compatibility with legacy list rules, recipients &SHOULD; accept empty
     374  list elements. In other words, consumers would follow the list productions:
     375</t>
    371376<figure><artwork type="example">
    372377  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
    373378 
    374379  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
    375 </artwork></figure> 
     380</artwork></figure>
     381<t>
     382  Note that empty elements do not contribute to the count of elements present,
     383  though.
     384</t>
     385<t>
     386  For example, given these ABNF productions:
     387</t>
     388<figure><artwork type="example">
     389  example-list      = 1#example-list-elmt
     390  example-list-elmt = token ; see <xref target="basic.rules"/>
     391</artwork></figure>
     392<t>
     393  Then these are valid values for example-list (not including the double
     394  quotes, which are present for delimitation only):
     395</t>
     396<figure><artwork type="example">
     397  "foo,bar"
     398  " foo ,bar,"
     399  "  foo , ,bar,charlie   "
     400  "foo ,bar,   charlie "
     401</artwork></figure>
     402<t>
     403  But these values would be invalid, as at least one non-empty element is
     404  required:
     405</t>
     406<figure><artwork type="example">
     407  ""
     408  ","
     409  ",   ,"
     410</artwork></figure>
    376411<t>
    377412  <xref target="collected.abnf"/> shows the collected ABNF, with the list rules
Note: See TracChangeset for help on using the changeset viewer.