gnu: docbook-xsl: Add compatibility entry.

Remap "http://docbook.sourceforge.net/release/xsl-ns/" to
"http://docbook.sourceforge.net/release/xsl/".

* gnu/packages/docbook.scm (docbook-xsl)[arguments]<#:phases>: Add
compatibility entry.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Bruno Victal 2023-10-09 21:05:56 +01:00 committed by Ludovic Courtès
parent 2421e68495
commit aeb0d142eb
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -388,6 +388,45 @@ downloading from @var{source}, where @var{version} is a string and
"http://docbook.sourceforge.net/release/xsl/current/" "http://docbook.sourceforge.net/release/xsl/current/"
store-uri store-uri
catalog)) catalog))
(list "rewriteSystem" "rewriteURI"))
;; Originally the
;; "http://docbook.sourceforge.net/release/xsl/"
;; URI referred to the non-namespaced docbook-xsl,
;; with its namespaced version using a URI differing in
;; the path component as '…/xsl-ns/'.
;; At some point the namespaced version was made the
;; canonical docbook-xsl package whilst preserving the
;; original URI.
;;
;; For compatibility with XML files that still specify
;; the legacy namespaced docbook-xsl URIs we re-add them
;; here.
(for-each
(lambda (type)
;; Remap /xsl-ns/ to /xsl/.
;; Note: URI resolutions are not recursive.
;; A rewrite rule from:
;; 'http://docbook.sourceforge.net/release/xsl-ns/'
;; to
;; 'http://docbook.sourceforge.net/release/xsl/'
;; will not trigger the rewrite rule that ultimately
;; remaps to a /gnu/store URI, as can be seen by
;; invoking:
;; $ xmlcatalog "" \
;; 'http://docbook.sourceforge.net/release/xsl-ns/current/'
;; http://docbook.sourceforge.net/release/xsl/current/
;; $ xmlcatalog "" \
;; 'http://docbook.sourceforge.net/release/xsl/current/'
;; file://gnu/store/…/xml/xsl/…
;;
;; See XML Catalog specification, item 7.2.2. for
;; details.
(invoke xmlcatalog "--noout"
"--add" type
"http://docbook.sourceforge.net/release/xsl-ns/current/"
store-uri
catalog))
(list "rewriteSystem" "rewriteURI"))) (list "rewriteSystem" "rewriteURI")))
catalog-files)))) catalog-files))))
(replace 'install (replace 'install