Subject: [xml2rfc] Markup of ABNF

From: Roger Price <[email-masked]>
Date: Wed, 23 Mar 2022 13:59:02 +0100 (CET)

Is there a "correct" way of marking up Augmented BNF in XML, as in RFC5234 
section 4? Any example would be much appreciated.

Roger

RFC5234: https://www.rfc-editor.org/rfc/rfc5234.html

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 23 Mar 2022 14:27:02 +0100

On 2022-03-23, at 13:59, Roger Price <[email-masked]> wrote:
> 
> Is there a "correct" way of marking up Augmented BNF in XML, as in RFC5234 section 4? Any example would be much appreciated.

There are probably multiple ways that are all correct.

From a recent draft:

~~~~ abnf
time-zone-initial = ALPHA / "." / “_”
; ...
alphanum          = ALPHA / DIGIT
~~~~
{: #grammar title="ABNF grammar of extensions to RFC 3339"}

Or in RFCXMLv3:

        <figure anchor="grammar">
          <name>ABNF grammar of extensions to RFC 3339</name>
          <sourcecode type="abnf"><![CDATA[
time-zone-initial = ALPHA / "." / “_”
; ...
alphanum          = ALPHA / DIGIT
]]></sourcecode>
        </figure>

Note that you can use »name="foo.abnf"« on <sourcecode to collect several ABNF snippets into one entity (“file”) named foo.abnf.

Grüße, Carsten

---

From: Robert Sparks <[email-masked]>
Date: Wed, 23 Mar 2022 08:27:23 -0500

An example of how it was done in RFC9171 
(https://www.rfc-editor.org/rfc/rfc9171.xml)

```

<sourcecode type="abnf" markers="false" pn="section-4.2.5.1.1-3">
dtn-uri = "dtn:" ("none" / dtn-hier-part)

dtn-hier-part = "//" node-name name-delim demux ; a path-rootless

node-name = reg-name

name-delim = "/"

demux = *VCHAR
</sourcecode>

```

hth,

RjS

On 3/23/22 7:59 AM, Roger Price wrote:
> Is there a "correct" way of marking up Augmented BNF in XML, as in 
> RFC5234 section 4? Any example would be much appreciated.
>
> Roger
>
> _______________________________________________
> xml2rfc mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 23 Mar 2022 15:59:06 +0100

> <sourcecode type="abnf" markers="false" pn="section-4.2.5.1.1-3">

… but that is published form, which authors would never supply.

The net content of that example is:

> <sourcecode type="abnf">

The 9171 example is unmarked (no figure number, no caption), while my example was an actual figure.  Both are right for their respective applications (9171: part of running text, my example: a figure that is referenced by anchor).

Grüße, Carsten