在macOS上构建PostgreSQL文档时出错

mbskvtky  于 5个月前  发布在  PostgreSQL
关注(0)|答案(1)|浏览(47)

尝试在macOS上构建PostgreSQL文档时,我遇到了一个持续性问题。错误消息表明XML实体、外部实体存在问题。我已经按照PostgreSQL文档中概述的标准步骤进行了操作,但仍然遇到以下错误:

✘ spartacus@  ~/postgres/doc/src   master ±  make html
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C sgml html
/usr/bin/xmllint --nonet --path . --path . --output postgres-full.xml --noent --valid postgres.sgml
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
postgres.sgml:21: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
]>
  ^
postgres.sgml:23: element book: validity error : No declaration for attribute id of element book
<book id="postgres">
                   ^
postgres.sgml:24: element title: validity error : No declaration for element title
 <title>PostgreSQL &version; Documentation</title>
                                                  ^
postgres.sgml:27: element corpauthor: validity error : No declaration for element corpauthor
  <corpauthor>The PostgreSQL Global Development Group</corpauthor>
                                                                  ^
postgres.sgml:28: element productname: validity error : No declaration for element productname
  <productname>PostgreSQL</productname>
                                       ^
postgres.sgml:29: element productnumber: validity error : No declaration for element productnumber
  <productnumber>&version;</productnumber>
                                          ^
postgres.sgml:30: element date: validity error : No declaration for element date
  &legal;
         ^
legal.sgml:6: parser error : Entity 'ndash' not defined
 <year>1996&ndash;2023</year>
                  ^
legal.sgml:14: parser error : Entity 'copy' not defined
  <productname>PostgreSQL</productname> is Copyright &copy; 1996&ndash;2023
                                                           ^
legal.sgml:14: parser error : Entity 'ndash' not defined
  <productname>PostgreSQL</productname> is Copyright &copy; 1996&ndash;2023
                                                                       ^
legal.sgml:19: parser error : Entity 'copy' not defined
  <productname>Postgres95</productname> is Copyright &copy; 1994&ndash;5
                                                           ^
legal.sgml:19: parser error : Entity 'ndash' not defined
  <productname>Postgres95</productname> is Copyright &copy; 1994&ndash;5
                                                                       ^
legal.sgml:49: parser error : chunk is not well balanced

^
postgres.sgml:30: parser error : Entity 'legal' failed to parse
  &legal;
         ^
make[1]: *** [postgres-full.xml] Error 1
make: *** [html] Error 2

字符串

其他信息:

  • 系统配置为无ICU支持。
  • 配置过程中未找到ICU库。
  • 不带ICU的执行命令:./configure --without-icu
    **尝试的解决方案:**我根据在线研究和PostgreSQL文档尝试了以下解决方案:
  • 断开Internet连接,以确保系统可以访问外部资源。
  • 已确认系统路径中已安装xmllint且可用。
  • 已验证本地是否存在所需的XML实体。
  • 检查可能干扰外部实体加载的任何代理配置。
  • 我还尝试在postgres.sgml文件中使用本地 *DOCTYPE声明:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "file:///Users/spartacus/postgres/doc/src/docbookx.dtd" [


尽管作出了这些努力,但问题依然存在。

zfciruhq

zfciruhq1#

我按照以下步骤来摆脱错误,帮助从这个Github issue
1.删除现有包:

brew uninstall docbook docbook-xsl xmlto

字符串
如果存在依赖性问题,您可以强制删除:

brew uninstall --ignore-dependencies docbook docbook-xsl


1.安装所需软件包:

brew install docbook docbook-xsl xmlto


1.**设置XML_CATALOG_FILES:**将以下内容添加到~/.bashrc~/.zshrc

export XML_CATALOG_FILES="/opt/homebrew/etc/xml/catalog"


1.**重建PostgreSQL文档:**导航到PostgreSQL文档目录,运行:

make html


1.打开HTML文档:

open path/to/postgres/doc/src/sgml/html/index.html


这个问题与无法从指定的URL加载DocBook XML DTD有关。通过卸载并重新安装所需的软件包(docbook、docbook-xsl、xmlto),我确保正确设置了必要的XML实体和依赖项。
配置XML_CATALOG_FILES环境变量指向正确的XML目录文件,为DocBook实体提供必要的引用。这反过来又解决了加载问题,允许PostgreSQL文档构建无错误地进行,这是我对这个解决方案工作的看法。
欢迎就此提出任何其他见解。

相关问题