Subject: [xml2rfc] No <t> in a <dd> !

From: Roger Price <[email-masked]>
Date: Sun, 3 Jan 2021 14:56:30 +0100 (CET)

I was surprised to receive the following error messages from xml2rfc :

  draft-rprice-UPS-management-protocol-00.rfc(81): Error: Element dd has extra
    content: t, at /rfc/middle/section[1]/section[1]/dl/dd[1]/t
  draft-rprice-UPS-management-protocol-00.rfc(97): Error: Element dd has extra
    content: dl, at /rfc/middle/section[1]/section[1]/dl/dd[3]/dl

My understanding from the DTD in file v3compat.dtd is that the content model (I 
guess this should also include #PCDATA but that's a separate matter) is:

  <!ELEMENT dd (artset|artwork|dl|figure|ol|sourcecode|t|ul)*>

and nothing in RFC 7749 or 
https://tools.ietf.org/src/xml2rfc/trunk/cli/doc/xml2rfc3.html#list-elements 
suggests otherwise.

Even HTML has content model

  <!ELEMENT DD - O  %section.content; -(ADDRESS) >

where section.content is very generous:

  <!ENTITY % section.content "(%block; | %text; | ADDRESS)+" >

Please can we have nested lists and <t> in <dd>?

Roger

---

From: Carsten Bormann <[email-masked]>
Date: Sun, 3 Jan 2021 15:07:03 +0100

>   content: dl, at /rfc/middle/section[1]/section[1]/dl/dd[3]/dl

The full story in v3.rnc is:

   dd =
     element dd {
       attribute xml:base { text }?,
       attribute xml:lang { text }?,
       attribute anchor { xsd:ID }?,
       attribute pn { xsd:ID }?,
       (( artset | artwork | aside | dl | figure | ol | sourcecode | t
                 | table | ul)+
        | (text bcp14 br cref em eref iref relref strong sub sup tt u
                 | xref)+
       )
     }

So, once you have used a span-level item (plain text, spans like em and strong, etc.), you can’t move up to block-level items (t, dl).

Can you post an excerpt of what you have been trying to do?

Grüße, Carsten

---

From: Roger Price <[email-masked]>
Date: Sun, 3 Jan 2021 16:54:06 +0100 (CET)

> The full story in v3.rnc is:

Thanks for the pointer to v3.rnc.  Can I take this as the true grammar for 
xml2rfc?

>        | (text bcp14 br cref em eref iref relref strong sub sup tt u

Wow! XML makes hard work of it.  I guess its because the XML mixed content 
declaration restricts the use of #PCDATA.  Why does the v3.rnc definition use 
"text" rather than #PCDATA ?

> So, once you have used a span-level item (plain text, spans like em and 
> strong, etc.), you can’t move up to block-level items (t, dl).

My problem was that I wrote

<dl>
   <dt>Pizza</dt>
   <dd>Lots of flavours. Look at these
       <dl>
         <dt>Banana...</dt>
         <dd>...</dd>
       </dl>
   </dd>
</dl>

I fixed this by adding a <t> to turn the text into a block:

<dl>
   <dt>Pizza</dt>
   <dd><t>Lots of flavours. Look at these   <- I added a <t>
       <dl>
         <dt>Banana...</dt>
         <dd>...</dd>
       </dl>
   </dd>
</dl>

xml2rfc accepts this but I found that nested <dl> are all presented at the same 
depth in HTML output, so I will change the way I mark up.

Roger

---

From: Julian Reschke <[email-masked]>
Date: Sun, 3 Jan 2021 17:05:38 +0100

Am 03.01.2021 um 16:54 schrieb Roger Price:
> Thanks for the pointer to v3.rnc.  Can I take this as the true grammar
> for xml2rfc?

For some value of "true", yes :-)

> Wow! XML makes hard work of it.  I guess its because the XML mixed
> content declaration restricts the use of #PCDATA.  Why does the v3.rnc
> definition use "text" rather than #PCDATA ?

It's (AFAIU) just a different name for what is used in DTDs.

>> So, once you have used a span-level item (plain text, spans like em
>> and strong, etc.), you can’t move up to block-level items (t, dl).
> xml2rfc accepts this but I found that nested <dl> are all presented at
> the same depth in HTML output, so I will change the way I mark up.

If you believe you found a bug in the formatter, the best thing to do is
to write a bug report.

Best regards, Julian

---

From: Carsten Bormann <[email-masked]>
Date: Sun, 3 Jan 2021 17:50:41 +0100

> On 2021-01-03, at 16:54, Roger Price <[email-masked]> wrote:
> 
> Thanks for the pointer to v3.rnc.  Can I take this as the true grammar for xml2rfc?

AFAIK, that is the grammar xml2rfc actually uses for checking the input for v3.

> Wow! XML makes hard work of it.  I guess its because the XML mixed content declaration restricts the use of #PCDATA.  Why does the v3.rnc definition use "text" rather than #PCDATA ?

What was called #PCDATA (“parsed character data”) in SGML, and thus in XML DTDs, is called “text” in Relax-NG.

>  <dd><t>Lots of flavours. Look at these   <- I added a <t>

Exactly; you need to avoid what SGML called “mixed content”.

> xml2rfc accepts this but I found that nested <dl> are all presented at the same depth in HTML output, so I will change the way I mark up.

I can’t reproduce that — for me, they nest just fine, nicely progressing to the right.

Grüße, Carsten