1
我的catalog.xml使用saxon9he與catalog.xml文件
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public
publicId="-//EG//DTD EG DITA Map//EN"
uri="dtds/maps.dtd"/>
<public
publicId="-//EG //DTD EG DITA Composite//EN"
uri="dtds/topics.dtd"/>
</catalog>
的DTD的,因爲他們預計:
<!DOCTYPE concept PUBLIC "-//EG//DTD EG DITA Composite//EN" "../../system/dtd/client/eg-dita.dtd">
<!DOCTYPE docmap PUBLIC "-//EG//DTD EG DITA Map//EN" "../../system/dtd/client/eg-docmap.dtd">
文件存儲佈局(Windows 7)中:
F:\export\catalog.xml
F:\export\*.xsl
F:\export\saxon9he.jar
F:\export\resolver.jar
F:\export\dtds\maps.dtd
F:\export\dtds\topics.dtd
F:\export\test\*.xml
F:\export\test\folders\*.xml
控制檯輸出:
Loading catalog: \catalog.xml
Saxon-HE 9.6.0.4J from Saxonica
Java version 1.7.0_09
Stylesheet compilation time: 940.807978ms
Processing file:/F:/export/folders.xml
Using parser org.apache.xml.resolver.tools.ResolvingXMLReader
Building tree for file:/F:/export/folders.xml using class
net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 3.841258ms
Tree size: 6 nodes, 0 characters, 6 attributes
Building tree for file:/F:/export/test/532a1069faf343d79c4ad37f8339aeda.map using class net.sf.saxon.tree.tiny.TinyBuilder
Error at template on line 33 of maps.xsl:
I/O error reported by XML parser processing
file:/F:/export/test/532a1069faf343d79c4ad37f8339aeda.map: F:\export\system\dtd\client\eg-docmap.dtd (cannot find path)
I/O error reported by XML parser processing file:/F:/export/test/532a1069faf343d79c4ad37f8339aeda.map: F:\export\system\dtd\client\
eg-docmap.dtd (cannot find path)
所以文件F:/export/test/532a1069faf343d79c4ad37f8339aeda.ditamap
有DTD <!DOCTYPE docmap PUBLIC "-//EG//DTD EG DITA Map//EN" "../../system/dtd/client/eg-docmap.dtd">
並預計其DTD是在F:\export\system\dtd\client\eg-docmap.dtd
我想讓解析器看看F:\export\dtds\maps.dtd
編輯:
這是我怎麼稱呼它:
java -cp "saxon9he.jar;resolver.jar" net.sf.saxon.Transform base.xml all_maps.xsl -t -catalog:"catalog.xml"> all_maps.xml
,並在輸出,現在說這(我沒有之前的-t選項):
Resolved public: -//EG //DTD EG DITA Map//EN
file:/F:/export/dtds/maps.dtd
Failed to create InputSource (java.io.FileNotFoundException: F:\export\dtds\maps.dtd (system cand file the file)): file:/F:export/dtds/maps.dtd
你能告訴我們你的命令行調用撒克遜嗎? –
感謝您的回覆。看我的編輯。 – user3629892
因此'file:/ F:export/dtds/maps.dtd'缺少斜槓,應該是'file:/ F:/ export/dtds/maps.dtd'。不確定這是您的產品目錄還是撒克遜電話的問題。 –