Ignore:
Timestamp:
Jul 15, 2012, 11:01:00 PM (7 years ago)
Author:
julian.reschke@…
Message:

Move ABNF extension (list production) to appendix.

File:
1 edited

Legend:

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

    r1792 r1798  
    14481448</section>
    14491449
    1450 <section title="ABNF list extension: #rule" anchor="abnf.extension">
    1451 <t>
    1452   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
    1453   improve readability in the definitions of some header field values.
    1454 </t>
    1455 <t>
    1456   A construct "#" is defined, similar to "*", for defining comma-delimited
    1457   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
    1458   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
    1459   comma (",") and optional whitespace (OWS).   
    1460 </t>
    1461 <figure><preamble>
    1462   Thus,
    1463 </preamble><artwork type="example">
    1464   1#element =&gt; element *( OWS "," OWS element )
    1465 </artwork></figure>
    1466 <figure><preamble>
    1467   and:
    1468 </preamble><artwork type="example">
    1469   #element =&gt; [ 1#element ]
    1470 </artwork></figure>
    1471 <figure><preamble>
    1472   and for n &gt;= 1 and m &gt; 1:
    1473 </preamble><artwork type="example">
    1474   &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
    1475 </artwork></figure>
    1476 <t>
    1477   For compatibility with legacy list rules, recipients &SHOULD; accept empty
    1478   list elements. In other words, consumers would follow the list productions:
    1479 </t>
    1480 <figure><artwork type="example">
    1481   #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
    1482  
    1483   1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
    1484 </artwork></figure>
    1485 <t>
    1486   Note that empty elements do not contribute to the count of elements present,
    1487   though.
    1488 </t>
    1489 <t>
    1490   For example, given these ABNF productions:
    1491 </t>
    1492 <figure><artwork type="example">
    1493   example-list      = 1#example-list-elmt
    1494   example-list-elmt = token ; see <xref target="field.components"/>
    1495 </artwork></figure>
    1496 <t>
    1497   Then these are valid values for example-list (not including the double
    1498   quotes, which are present for delimitation only):
    1499 </t>
    1500 <figure><artwork type="example">
    1501   "foo,bar"
    1502   "foo ,bar,"
    1503   "foo , ,bar,charlie   "
    1504 </artwork></figure>
    1505 <t>
    1506   But these values would be invalid, as at least one non-empty element is
    1507   required:
    1508 </t>
    1509 <figure><artwork type="example">
    1510   ""
    1511   ","
    1512   ",   ,"
    1513 </artwork></figure>
    1514 <t>
    1515   <xref target="collected.abnf"/> shows the collected ABNF, with the list rules
    1516   expanded as explained above.
    1517 </t>
    1518 </section>
    15191450</section>
    15201451
     
    51025033</section>
    51035034
     5035<section title="ABNF list extension: #rule" anchor="abnf.extension">
     5036<t>
     5037  A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
     5038  improve readability in the definitions of some header field values.
     5039</t>
     5040<t>
     5041  A construct "#" is defined, similar to "*", for defining comma-delimited
     5042  lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
     5043  at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
     5044  comma (",") and optional whitespace (OWS).   
     5045</t>
     5046<figure><preamble>
     5047  Thus,
     5048</preamble><artwork type="example">
     5049  1#element =&gt; element *( OWS "," OWS element )
     5050</artwork></figure>
     5051<figure><preamble>
     5052  and:
     5053</preamble><artwork type="example">
     5054  #element =&gt; [ 1#element ]
     5055</artwork></figure>
     5056<figure><preamble>
     5057  and for n &gt;= 1 and m &gt; 1:
     5058</preamble><artwork type="example">
     5059  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
     5060</artwork></figure>
     5061<t>
     5062  For compatibility with legacy list rules, recipients &SHOULD; accept empty
     5063  list elements. In other words, consumers would follow the list productions:
     5064</t>
     5065<figure><artwork type="example">
     5066  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
     5067 
     5068  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
     5069</artwork></figure>
     5070<t>
     5071  Note that empty elements do not contribute to the count of elements present,
     5072  though.
     5073</t>
     5074<t>
     5075  For example, given these ABNF productions:
     5076</t>
     5077<figure><artwork type="example">
     5078  example-list      = 1#example-list-elmt
     5079  example-list-elmt = token ; see <xref target="field.components"/>
     5080</artwork></figure>
     5081<t>
     5082  Then these are valid values for example-list (not including the double
     5083  quotes, which are present for delimitation only):
     5084</t>
     5085<figure><artwork type="example">
     5086  "foo,bar"
     5087  "foo ,bar,"
     5088  "foo , ,bar,charlie   "
     5089</artwork></figure>
     5090<t>
     5091  But these values would be invalid, as at least one non-empty element is
     5092  required:
     5093</t>
     5094<figure><artwork type="example">
     5095  ""
     5096  ","
     5097  ",   ,"
     5098</artwork></figure>
     5099<t>
     5100  <xref target="collected.abnf"/> shows the collected ABNF, with the list rules
     5101  expanded as explained above.
     5102</t>
     5103</section>
     5104
    51045105<?BEGININC p1-messaging.abnf-appendix ?>
    51055106<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
Note: See TracChangeset for help on using the changeset viewer.