ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
63 stars 35 forks source link

Missing cref entries in annotation #1087

Open kesara opened 5 months ago

kesara commented 5 months ago

Description

As mentioned by John C Klensin in tools-discuss ^1, cref in annotation is missing in all output formats.

Test XML:

<?xml version="1.0" encoding="utf-8"?>
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc comments="yes"?>

<rfc ipr="trust200902" docName="draft-foobar-00" category="exp" submissionType="IETF">
  <front>
    <title abbrev="foobar">Foobar</title>
    <author initials="J." surname="Doe" fullname="Jane Doe">
      <address>
        <postal>
          <country>New Zealand</country>
        </postal>
        <email>none@fake.nz</email>
      </address>
    </author>

    <abstract>
      <t>Foobar</t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction" title="Introduction">
      <t>
          Reference:  <xref target="RFC2324" />
          <cref>Test cref</cref>
      </t>
    </section>
  </middle>

  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC2324" target="https://www.rfc-editor.org/info/rfc2324">
        <front>
          <title>
          Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)
          </title>
          <author fullname="L. Masinter" initials="L." surname="Masinter"/>
          <date month="April" year="1998"/>
          <abstract>
            <t>
              This document describes HTCPCP, a protocol for controlling, monitoring, and diagnosing coffee pots. This memo provides information for the Internet community. It does not specify an Internet standard of any kind.
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="2324"/>
        <seriesInfo name="DOI" value="10.17487/RFC2324"/>
        <annotation>Annotation test.</annotation>
        <annotation>Annotation em:<em>em</em></annotation>
        <annotation>Annotation cref:<cref>cref</cref></annotation>
        <annotation>Annotation eref:<eref target="https://example.org" /></annotation>
        <annotation>Annotation iref.<iref item="iref" /></annotation>
        <annotation>Annotation strong:<strong>strong</strong></annotation>
        <annotation>Annotation sub:<sub>sub</sub></annotation>
        <annotation>Annotation sup:<sup>sup</sup></annotation>
        <annotation>Annotation tt:<tt>tt</tt></annotation>
        <annotation>Annotation u:<u>u</u></annotation>
        <annotation>Annotation xref:<xref target="RFC2324" /></annotation>
      </reference>
    </references>
  </back>
</rfc>

Text output:

...
1.  Introduction

   Reference: [RFC2324]
   // Test cref

2.  Normative References

   [RFC2324]  Masinter, L., "Hyper Text Coffee Pot Control Protocol
              (HTCPCP/1.0)", RFC 2324, DOI 10.17487/RFC2324, April 1998,
              <https://www.rfc-editor.org/info/rfc2324>.  Annotation
              test.  Annotation em:_em_ Annotation cref: Annotation
              eref:https://example.org Annotation iref.  Annotation
              strong:*strong* Annotation sub:_sub Annotation sup:^sup
              Annotation tt:tt Annotation u:"u" (LATIN SMALL LETTER U,
              U+0075) Annotation xref:[RFC2324]

Index

   I

      I

         iref  Reference [RFC2324]

HTML output:

Screenshot 2024-01-20 at 19 00 05

Code of Conduct

kesara commented 5 months ago

cref is not displayed because xml2rfc fails to set the default value for the display attribute in cref when it's inside an annotation. The default value for the display attribute is true.

For example:

<annotation>Annotation cref:<cref display="true">cref</cref></annotation>

will give the correct results.