DocBook Framework的瑕疵

在家里使用Docbook Framework编写文档并用ANT编译的时候一点儿问题没有,在公司内部使用的话,反而老是编译不过,提示我:
引用

     [java] Error on line 3 column 57 of file:/C:/workspace/documen.writing/src/docbook/dbf/DBFUserGuide.xml:
     [java]   Error reported by XML parser: Cannot read from http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd (www.oasis-open.org)
     [java] Transformation failed: Run-time errors were reported
     [java] Java Result: 2

按理说,DBF的resolver应该能够处理这种情况啊,可是google后才发现原来DBF1.0的xml-catalog.xml有些小问题,这里是针对这个问题的jira issue的link:
https://issues.apache.org/jira/browse/DBF-6
我直接把对比的文件内容贴于下吧!
Index: src/resolver/xml-catalog.xml
===================================================================
--- src/resolver/xml-catalog.xml	(revision 590660)
+++ src/resolver/xml-catalog.xml	(working copy)
@@ -24,22 +24,22 @@
   <!-- Translate DocBook XML 4.4 system ids to local file names -->
   <rewriteSystem
     systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/"
-    rewritePrefix="@target.dir@/docbook-xml-4.4/"/>
+    rewritePrefix="@file.prefix@@target.dir@/docbook-xml-4.4/"/>
 
   <rewriteSystem
     systemIdStartString="http://www.oasis-open.org/docbook/xml/4.5/"
-    rewritePrefix="@target.dir@/docbook-xml-4.5/"/>
+    rewritePrefix="@file.prefix@@target.dir@/docbook-xml-4.5/"/>
 
   <!-- Translate DocBook XML 4.4 public ids to local file names -->
   <nextCatalog
-    catalog="@target.dir@/docbook-xml-4.4/catalog.xml"/>
+    catalog="@file.prefix@@target.dir@/docbook-xml-4.4/catalog.xml"/>
 
   <!-- Translate DocBook XML 4.5 public ids to local file names -->
   <nextCatalog
-    catalog="@target.dir@/docbook-xml-4.5/catalog.xml"/>
+    catalog="@file.prefix@@target.dir@/docbook-xml-4.5/catalog.xml"/>
 
   <rewriteURI
     uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
-    rewritePrefix="@target.dir@/docbook-xsl-snapshot/"/>
+    rewritePrefix="@file.prefix@@target.dir@/docbook-xsl-snapshot/"/>
 
 </catalog>

除了这个问题,htmlsingle这个target要单独run的话,也会有些问题,通常是提示你某些文件找不到,比如:
引用

     [java] Error at xsl:import on line 26 of file:/C:/workspace/documen.writing/target/tmp/htmlsingle.xsl:
     [java]   Failure reading file:/C:/workspace/documen.writing/target/tmp/html-style.xsl: no more input
     [java] Transformation failed: Failed to compile stylesheet. 1 error detected.
     [java] Java Result: 2

这是因为DBF初始发布的DocBook-Framework-1.0/src/styles/htmlsingle.xsl文件内容也需要稍微调整一下,将内容:
引用

  <xsl:import href="@file.prefix@@dbf.xsl@/html/docbook.xsl" />
  <xsl:import href="@file.prefix@@tmp.dir@/html-style.xsl" />
  <xsl:include href="@file.prefix@@tmp.dir@/html-titlepage.xsl" />

更改为:
引用

  <xsl:import href="@file.prefix@@dbf.xsl@/html/docbook.xsl" />
  <xsl:import href="@file.prefix@@tmp.dir@/htmlsingle-style.xsl" />
  <xsl:include href="@file.prefix@@tmp.dir@/htmlsingle-titlepage.xsl" />

以前是自己搭建的编译环境,现在想图省事儿,才直接抓Docbook Framework过来用,从而发现这几个小问题,希望能够给其他人一些启示。

你可能感兴趣的:(java,c,xml,ant,XSL)