Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous rule match varlistentry/term vs. *[@xlink:href] #240

Open
jtojnar opened this issue Mar 31, 2022 · 0 comments · May be fixed by #241
Open

Ambiguous rule match varlistentry/term vs. *[@xlink:href] #240

jtojnar opened this issue Mar 31, 2022 · 0 comments · May be fixed by #241

Comments

@jtojnar
Copy link

jtojnar commented Mar 31, 2022

When converting the following reference into a manual page using xsltproc --nonet "http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" "man-pages-combined.xml (libxslt 1.1.35, docbook-xsl 1.79.2), there is an ambiguous match, causing the appstream.enable to be printed twice.

<?xml version="1.0"?>
<reference xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <title>NixOS Reference Pages</title>
 <info>
  <author>
   <personname>
    <firstname>Eelco</firstname>
    <surname>Dolstra</surname>
   </personname>
   <contrib>Author</contrib>
  </author>
  </info>
 <refentry>
  <refmeta>
   <refentrytitle>
    <filename>configuration.nix</filename>
   </refentrytitle>
   <manvolnum>5</manvolnum>
   <refmiscinfo class="source">NixOS</refmiscinfo>
  </refmeta>
  <refnamediv>
   <refname>
    <filename>configuration.nix</filename>
   </refname>
   <refpurpose>NixOS system configuration specification</refpurpose>
  </refnamediv>
  <refsection>
   <title>Options</title>
   <variablelist>
    <varlistentry>
     <term xlink:href="#opt-appstream.enable" xml:id="opt-appstream.enable">
      <option>appstream.enable</option>
     </term>
     <listitem>
      <para>Whether to install files to support the AppStream metadata specification.</para>
     </listitem>
    </varlistentry>
   </variablelist>
  </refsection>
 </refentry>
</reference>

Generated manual page

This did not happen with libxslt 1.1.34 because it was not following the specification properly. libxslt 1.1.35 fixed the compliance thus revealing the issue.

We get the same result using saxon man-pages-combined.xml "http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" (saxon 6.5.3) and it gives more info:

Recoverable error
Ambiguous rule match for /reference[1]/refentry[1]/refsection[1]/variablelist[1]/varlistentry[1]/term[1]
Matches both "d:varlistentry/d:term" on line 115 of http://docbook.sourceforge.net/release/xsl-ns/current/manpages/lists.xsl
and "*[@xlink:href]|d:ulink   |d:imagedata|d:audiodata|d:videodata   |d:footnote[not(ancestor::d:table)]   |d:annotation|d:alt" on line 182 of http://docbook.sourceforge.net/release/xsl-ns/current/manpages/endnotes.xsl
jtojnar added a commit to jtojnar/xslt10-stylesheets that referenced this issue Apr 3, 2022
jtojnar added a commit to jtojnar/nixpkgs that referenced this issue Apr 3, 2022
libxslt 1.1.35 fixed conflict resolution for templates to match the specification.
This uncovered a bug in docbook-xsl (docbook/xslt10-stylesheets#240),
which causes option names to be duplicated into the option descriptions.

Let’s resolve the conflict by patching the stylesheets.

Fixes: NixOS#166304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant