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
64 stars 38 forks source link

Need better hangText crossreference format #347

Open ietf-svn-bot opened 6 years ago

ietf-svn-bot commented 6 years ago

type_enhancement | by tte@cs.fau.de


In RFC terminology section, terms are usually defined via a hangText, eg:
<t hangText="ACP (ANI/AN) Domain Certificate:" anchor="domcert-def">

Often it is required for one terms explanation to have an xref to another term. But there is no good XREF option to do this because there seems to be no way to refer to the actual hanging text. Instead, the reference will have to show something else, like the section number or so, which is all useless.

The best option i found is like this:
<xref target="domcert-def" format="title">->"ACP domain certificate"</xref>
Because i can not let the xref generate the referred text, the xref has to repeat that whole text, and i also need to write the typical way you show a reference to another term (->).

But this format still creates a redundant () at the end, and IESG reviewers did not like that. 

Maybe i am overlooking something, but i spent a already way too much time just to get to this point of understanding.

example from draft-ietf-anima-autonomic-control-plane-16

This is against xml2rfc.tools.ietf.org. That web page only says v2, so i am just assuming it is 2.5.x.

Issue migrated from trac:347 at 2022-02-05 12:44:30 +0000

ietf-svn-bot commented 6 years ago

@julian.reschke@gmx.de commented


I agree that the formatter should handle that better.

In my formatter, it seems to work right, see file:///C:/projects/xml2rfc/v3test.html#n-referring-to-list-items.

ietf-svn-bot commented 6 years ago

@julian.reschke@gmx.de uploaded file xref-tests.xml (23.6 KiB)

test case

ietf-svn-bot commented 6 years ago

@julian.reschke@gmx.de uploaded file xref-tests.txt (14.9 KiB)

TXT produced by xml2rfc

ietf-svn-bot commented 6 years ago

@julian.reschke@gmx.de uploaded file xref-tests.html (44.7 KiB)

sample HTML output from rfc2629.xslt

ietf-svn-bot commented 4 years ago

@rjsparks@nostrum.com _changed status from new to under_review_

ietf-svn-bot commented 4 years ago

@rjsparks@nostrum.com commented


This is OBE for v2, but there may still be an analogous enhancement to be made in v3.

kesara commented 2 years ago

Missing attachments: (added .txt to overcome GitHub rules). xref-tests.txt xref-tests.html.txt xref-tests.xml.txt

kesara commented 2 years ago

@reschke, @rjsparks: Is this still a valid issue? If so what are the enhancements required?

reschke commented 2 years ago

The original issue description is hard to read; maybe some formatting was lost?

rjsparks commented 2 years ago

I edited the original description to put the content in blockquotes.

If you suspect you see something broken try to edit it. if it won't let you edit it, try to quote reply and you should see the pre-markdown bits.

cabo commented 2 years ago

We solved a related problem in https://www.ietf.org/archive/id/draft-ietf-core-href-10.html#c-scheme -- see how the items are defined in Section 2 and referenced in Section 3.

See https://github.com/core-wg/href/blob/main/draft-ietf-core-href.md#constraints-constraints (setup) and https://github.com/core-wg/href/blob/main/draft-ietf-core-href.md#creation-and-normalization (reference) for the source. https://www.ietf.org/archive/id/draft-ietf-core-href-10.xml if you prefer XML.

cabo commented 2 years ago

Well, this does not work too well with definition lists:

{:#ant} ant (en):
: Ameise (de)

{:#bat} bat (en):
: Fledermaus (de), afraid of {{<<cat1}}

{:#cat1} cat (en):
: Katze (de), does not eat {{<<ant}}
<dl>
  <dt anchor="ant">ant (en):</dt>
  <dd>
    <t>Ameise (de)</t>
  </dd>
  <dt anchor="bat">bat (en):</dt>
  <dd>
    <t>Fledermaus (de), afraid of <xref format="title" target="cat1"/></t>
  </dd>
  <dt anchor="cat1">cat (en):</dt>
  <dd>
    <t>Katze (de), does not eat <xref format="title" target="ant"/></t>
  </dd>
</dl>

   ant (en):  Ameise (de)

   bat (en):  Fledermaus (de), afraid of cat1

   cat (en):  Katze (de), does not eat ant

So it uses the anchor as the title (!).

reschke commented 2 years ago

Indeed.

See rfcxml.xslt's output at

https://greenbytes.de/tech/webdav/xref-tests-rfc7991.html#rfc.section.2.7.2

and xml2rfc's

file:///C:/projects/xml2rfc/xref-tests-rfc7991.xml2rfcv3.html#section-2.7.2

for format=title, rfcxml.xslt takes the text content instead of the anchor name.

reschke commented 2 years ago

See also https://github.com/rfc-format/draft-iab-xml2rfc-v3-bis/issues/109#issuecomment-641145352