Re: FOP warnings about id attributes in title tags

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FOP warnings about id attributes in title tags
Date: 2019-02-23 14:47:54
Message-ID: 87acf578-eb25-bd25-0078-0370d5cc38e6@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2/22/19 9:57 AM, Andrew Dunstan wrote:
> On 2/19/19 11:07 AM, Peter Eisentraut wrote:
>> On 2019-02-18 16:37, Peter Eisentraut wrote:
>>>> It appears that these are due to title elements having id tags. At
>>>> <http://www.sagehill.net/docbookxsl/CrossRefs.html> is says:
>>>>
>>>> When adding an |id| or |xml:id| attribute, put it on the element
>>>> itself, not the |title|.
>>>>
>>>> So maybe we need to fix those up?
>>> You can't just remove the ids, since some of them are referenced from
>>> elsewhere.
>> Here was a discussion on getting rid of them:
>> https://www.postgresql.org/message-id/flat/4a60dfc3-061b-01c4-2b86-279d3a612fd2%402ndquadrant.com
>>
>
>
> Yeah,
>
>
> I did some experimentation, and found that removing the id on the title
> tag, and the corresponding endterm attributes, and adding an xreflabel
> to the linkend object seemed to have the desired effect. Not yet tested
> with FOP but this looks like a good direction.
>
>
> Test case:
>
>
> diff --git a/doc/src/sgml/ref/alter_collation.sgml b/doc/src/sgml/ref/alter_collation.sgml
> index b51b3a2564..432495e522 100644
> --- a/doc/src/sgml/ref/alter_collation.sgml
> +++ b/doc/src/sgml/ref/alter_collation.sgml
> @@ -93,16 +93,15 @@ ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_sche
>      <listitem>
>       <para>
>        Update the collation's version.
> -      See <xref linkend="sql-altercollation-notes"
> -      endterm="sql-altercollation-notes-title"/> below.
> +      See <xref linkend="sql-altercollation-notes"/> below.
>       </para>
>      </listitem>
>     </varlistentry>
>    </variablelist>
>   </refsect1>
>  
> - <refsect1 id="sql-altercollation-notes">
> -  <title id="sql-altercollation-notes-title">Notes</title>
> + <refsect1 id="sql-altercollation-notes" xreflabel="Notes">
> +  <title>Notes</title>
>  
>    <para>
>     When using collations provided by the ICU library, the ICU-specific version

This worked reasonably well in most cases, but not in the cases where
there was formatting in the title text. So I adopted a different
approach which wrapped the title text in a phrase tag and put the id on
that tag instead of on the title tag itself. The documentation seems to
suggest that supplying a place to put an id tag around a small piece of
text is largely the purpose of the phrase tag. Anyway, this worked. It
also has the upside that we're not duplicating the title text.

At the same time I removed some apparently pointless id tags on a
handful of refname objects.

Given these two changes the PDFs build free of warnings about unresolved
ID references.

Some of these titles with id attributes are not actually referred to
anywhere, but that seems reasonably harmless.

patch attached.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
fix-docs-unresolved-references.patch text/x-patch 21.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-02-23 15:18:46 Re: Autovaccuum vs temp tables crash
Previous Message Stephen Frost 2019-02-23 14:06:42 Re: oddity with ALTER ROLE/USER