Subject: [xml2rfc] XREF to appendix bad expansion.

From: Christian Hopps <[email-masked]>
Date: Sun, 10 Feb 2019 12:34:38 -0500

I have:

    see <xref target="org329799d"/>.
    ...<back>...
    <section title="Some Title Text" anchor="org329799d">

When I run this through xml2rfc (--v3 --text) I get:

    see Section appendix.a.
    ...
    Appendix A.  Some Title Text

I would have expected:

    see Appendix A.
    ...
    Appendix A.  Some Title Text

Is this a bug?

Thanks,
Chris.

---

From: Henrik Levkowetz <[email-masked]>
Date: Sun, 10 Feb 2019 20:13:11 +0100

Hi Chris,

>     Appendix A.  Some Title Text

Yes.  Will fix.  Thanks for the report!

	Henrik

---

From: Christian Hopps <[email-masked]>
Date: Tue, 12 Feb 2019 06:13:23 -0500

BTW, In trying to work around this I tried to specify the text directly. Unfortunately since the format attribute has lost it's "none" option this seems not possible -- I end up with something like "see Section appendix.a Appendix A." or "see appendix.a. Appendix A." when I specify "Appendix A." as my text. Can we bring back the "none" format attribute? I can't figure out why this attribute value was deprecated TBH, no functionality replaced it.

Thanks,
Chris.

---

From: Julian Reschke <[email-masked]>
Date: Tue, 12 Feb 2019 12:58:57 +0100

On 12.02.2019 12:13, Christian Hopps wrote:
> 
> BTW, In trying to work around this I tried to specify the text directly. 
> Unfortunately since the format attribute has lost it's "none" option 
> this seems not possible -- I end up with something like "see Section 
> appendix.a Appendix A." or "see appendix.a. Appendix A." when I specify 
> "Appendix A." as my text. Can we bring back the "none" format attribute? 
> I can't figure out why this attribute value was deprecated TBH, no 
> functionality replaced it.
> 
> Thanks,
> Chris.

+1

FWIW, this is issue 
<https://github.com/rfc-format/draft-iab-xml2rfc-v3-bis/issues/17>, 
raised almost two years ago.

Best regards, Julian

---

From: Henrik Levkowetz <[email-masked]>
Date: Tue, 12 Feb 2019 17:29:56 +0100

Hi Chris,

On 2019-02-12 12:13, Christian Hopps wrote:
> 
> BTW, In trying to work around this I tried to specify the text
> directly. Unfortunately since the format attribute has lost it's
> "none" option this seems not possible -- I end up with something like
> "see Section appendix.a Appendix A." or "see appendix.a. Appendix A."
> when I specify "Appendix A." as my text. Can we bring back the "none"
> format attribute? I can't figure out why this attribute value was
> deprecated TBH, no functionality replaced it.

Umm.  Which xref construct did you use that gave this?  The preptool
specification says this:

 5.4.8.1.  "derivedContent" Insertion (with Content)

   For each <xref> element that has content, fill the "derivedContent"
   with the element content, having first trimmed the whitespace from
   ends of content text.  Issue a warning if the "derivedContent"
   attribute already exists and has a different value from what was
   being filled in.

which xml2rfc is written to implement.  This seems to me to indicate
that it should be possible to explicitly supply, and end up with, just
"Appendix A.".  I've been trying to reproduce what you experienced,
but cannot quite get to the same point.  Could you provide the xml that
gives you for instance "see Section appendix.a Appendix A." ?

Best regards,

	Henrik

---

From: Christian Hopps <[email-masked]>
Date: Tue, 12 Feb 2019 11:48:14 -0500

Sorry I got the bad text slightly wrong -- still a problem just different format:

   <t>For ... see <xref target="orgad6414c">Appendix A.</xref></t>

   ... [ after rerferences ]

   <section title="Comparison of ..." anchor="orgad6414c">

yields:

   For see Appendix A.  (Section appendix.a)

Thanks,
Chris.

---

From: Henrik Levkowetz <[email-masked]>
Date: Tue, 12 Feb 2019 18:02:39 +0100

Hi Christian,

>    For see Appendix A.  (Section appendix.a)

Ah.  Ok.  Because the text version doesn't have the html links of the HTML
version, it adds helpful (?) information in the format="default" case.

The current specification (no format="none" support) can be made to do what
you want, but works differently from legacy, and (I think) violates the
principle of least surprise.  I will look at making the surprise less and
provide support for format="none", I think, resolving the issue Julian
pointed to at the same time.

In the upcoming release, your original issue should be resolved.  For
now, you can if you wish work around it with:

 <t>For ... see <xref target="orgad6414c" format="counter">Appendix A.</xref></t>

Best regards,

	Henrik

---

From: Christian Hopps <[email-masked]>
Date: Tue, 12 Feb 2019 12:06:16 -0500

Yeah,

I just noticed that "counter" worked. I thought I tried them all but apparently not. I think adding "none" to force no extra text is a fine solution.

Thanks,
Chris.