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

Allow use of custom XML catalogs #61

Closed
rossburton opened this issue Apr 2, 2019 · 1 comment · Fixed by #172
Closed

Allow use of custom XML catalogs #61

rossburton opened this issue Apr 2, 2019 · 1 comment · Fixed by #172
Milestone

Comments

@rossburton
Copy link

rossburton commented Apr 2, 2019

For reasons which are too tedious to go into, our XML default catalog doesn't have the docbook XML entries in. We need to set SGML_CATALOG_FILES and pass --catalogs to xmllint but as asciidoc wraps xmllint that's harder. I'm currently using this patch as a workaround:

diff --git a/a2x.py b/a2x.py
index 2d7699a..5bb995f 100755
--- a/a2x.py
+++ b/a2x.py
@@ -49,2 +49,4 @@ LYNX = 'lynx'               # alternate text file generator.
 XMLLINT = 'xmllint'         # Set to '' to disable.
+if "SGML_CATALOG_FILES" in os.environ:
+  XMLLINT += " --catalogs"
 EPUBCHECK = 'epubcheck'     # Set to '' to disable.
@@ -636,3 +638,3 @@ class A2X(AttrDict):
         if not self.no_xmllint and XMLLINT:
-            shell('"%s" --nonet --noout --valid "%s"' % (XMLLINT, docbook_file))
+            shell('%s --nonet --noout --valid "%s"' % (XMLLINT, docbook_file))
@MasterOdin MasterOdin added this to the 9.1.0 milestone May 30, 2020
@MasterOdin
Copy link
Member

Marked this for 9.1.0.

Looking around the internet, it seems like the existence of this flag is a good signal that a user probably wants to have this be used for xmllint? I'm wondering if there's a case where a user would have this set and not want it to be used. An alternative would be to add a new command-line flag to a2x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants