我的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
答案 0 :(得分:0)
嗯,应该有用。我没有看到Windows在文件名中添加了额外的.txt。删除后,它就像一个魅力。
如问题所示的命令行,问题中显示的目录文件。