Subject: [xml2rfc-dev] problems caused by allowing @pn attribute to define xref target

From: Julian Reschke <[email-masked]>
Date: Fri, 25 Oct 2019 16:24:07 +0200

Allowing @pn to identify an xref target is likely a side-effect of the
internal processing model of xml2rfc. The way it is implemented
currently causes user-visible problems.

The simplest possible fix would be to disable support for this except
when used internally by the renderer.

The attachments (to the ticket) show one problem, but I'm pretty sure
more could be found.

    <middle>
       <section anchor="s1">
          <name>Dummy Section 1</name>
          <t pn="section-1">
             See <xref target="s2"/>.
          </t>
          <t>
             See <xref target="section-2"/>.
          </t>
       </section>
       <section anchor="s2" pn="section-2">
          <name>Dummy Section 2</name>
          <t>
             See <xref target="s1"/>.
          </t>
          <t>
             See <xref target="section-1"/>.
          </t>
       </section>
    </middle>

Here, the xref to "section-1" should actually link to Paragraph 1 of
Section 1. Due to how pn attributes are rewritten during preptool phase,
it actually gets rendered as reference to Section 2.

Proposal: disallow linking to elements identified by the pn attribute.

Best regards, Julian

PS: raised as <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/447>