DTD远程引用问题
我有一个自定义的 dtd,其中包含对远程 dtd 的引用,例如:
<!ENTITY % table.model PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN" "http://www.docbook.org/sgml/4.2/soextblx.dtd">
然而,docbook 网站在 2011 年 3 月中旬关闭了至少 1 天,我们的内容无法验证。因此,我正在考虑制作 soextblx.dtd 的本地副本并更改对此的引用可能会有所帮助,例如:
<!ENTITY % table.model PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN" "soextblx.dtd">
假设我已将“soextblx.dtd”放在与自定义 dtd 相同的文件夹中。我已经使用XmlSpy对其进行了验证,这是经过验证的,但我不确定这对于将来可能发生的这种服务器宕机问题是否是正确或最佳的解决方案。
感谢您提前的帮助。
I have a customized dtd that contains a reference to a remote dtd like:
<!ENTITY % table.model PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN" "http://www.docbook.org/sgml/4.2/soextblx.dtd">
However, docbook site was down for at least 1 day in mid March 2011, our content won't validate. So I was thinking making a local copy of the soextblx.dtd and change reference to that may help, like:
<!ENTITY % table.model PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN" "soextblx.dtd">
Assuming that I have put "soextblx.dtd" in the same folder as my customized dtd. I have used XmlSpy to validate it, which is validated, but I am not sure whether this is the correct or best solution for this kind of server-down problem that may happen in the future.
Thanks for the help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有趣的方法@ mzjn - 似乎 XML 目录是公共/系统概念的抽象。
回到你原来的问题 - 你正在按照正确的方式做这件事有关外部实体声明的 DTD 参考。
相关摘录:
Interesting approach @ mzjn -- seems like XML catalog is an abstraction of the public/system concept.
Back to your original question -- you are doing it the right way according to the DTD ref regarding the External Entity declaration.
Relevant excerpt:
解决此类问题的最佳通用解决方案是使用 XML 目录。简而言之,目录提供了从通用标识符到特定(本地)文件或 URI 的映射。
这里有两篇关于目录的好文章(对 DocBook 用户特别有用):
The best general solution to this kind of problem is to use an XML catalog. In short, a catalog provides a mapping from generic identifiers to specific (local) files or URIs.
Here are two good articles about catalogs (especially useful for DocBook users):