首页 > 解决方案 > 为什么我得到 [topic-reader] [DOTJ013E][ERROR] 无法解析 DITA-OT 3.0.4 中的引用文件 'xxx'

问题描述

我正在尝试从 1.8.5 升级到 DITA-OT 3.0.4。所以我做了一些试验和错误。

我有一个专门的 SIDSC 组件。在以前版本的 DITA-OT 中,它被解析没有任何问题,我能够生成 PDF。但是在 3.0.4 中,我收到了这个错误:

topic-reader:
[topic-reader] Reading file:/C:/InfoShare/Data/PublishingService/Data/DataExports/GUID-CE32C6F9-B88A-4E25-B702-C484D3460BCA.1129492.20180621060207637/2/en-US/workset/temp/f413807680e5a768d5bc8cf7f9e40b9bd67490f1.ditamap
[topic-reader] Processing file:/C:/InfoShare/Data/PublishingService/Data/DataExports/GUID-CE32C6F9-B88A-4E25-B702-C484D3460BCA.1129492.20180621060207637/2/en-US/workset/GUID-0D9FFE68-743C-4F90-837A-07E9F2088225.xml to file:/C:/InfoShare/Data/PublishingService/Data/DataExports/GUID-CE32C6F9-B88A-4E25-B702-C484D3460BCA.1129492.20180621060207637/2/en-US/workset/temp/9b37d86563b268e88ad9d0bfb362fddd04aa5d56.xml
[topic-reader] [DOTJ013E][ERROR] Failed to parse the referenced file 'file:/C:/InfoShare/Data/PublishingService/Data/DataExports/GUID-CE32C6F9-B88A-4E25-B702-C484D3460BCA.1129492.20180621060207637/2/en-US/workset/GUID-0D9FFE68-743C-4F90-837A-07E9F2088225.xml'.: An element type is required in the declaration of element type "desc".

这是xml文件的示例数据:

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<!DOCTYPE concept PUBLIC "-//Test//DTD DITA Mathml Concept//EN" "file:///C:/InfoShare/Web/Author/ASP/DocTypes/dita-oasis/1.2/test/dtd/testConcept.dtd" [
    ]><?ish ishref="GUID-7EF28CDC-9213-4ECC-9EF6-9A49C627151D" version="1" lang="en-US"?>
<concept id="GUID-7EF28CDC-9213-4ECC-9EF6-9A49C627151D" xml:lang="en-US" ishlabelxpath="./title" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" ditaarch:DITAArchVersion="1.2" domains="(topic concept)                            (topic hi-d)                             (topic ut-d)                             (topic indexing-d)                            (topic hazard-d)                            (topic abbrev-d)                            (topic pr-d)                             (topic sw-d)                            (topic ui-d)                             (topic sidscDomain-d)                            (topic mathml-d)                            (topic equation-d)   " class="- topic/topic concept/concept ">

如果我删除 DOCTYPE,Xerces 会毫无问题地解析它,但如果我把它留在那里,它就会失败。

我创建了一个批处理文件来调用dita-ot:

C:\InfoShare\App\Utilities\DITA-OT\test\bin\dita --transtype=%4 --args.input=%1/%2 --output.dir=%3 --dita.temp.dir=%1/temp --args.draft=%5 --clean.temp=%6 --validate=%7 --args.rellinks="nofamily" --logfile %3/%2_%4.log --propertyfile=pdf.properties 

pdf.properties:

args.gen.task.lbl = YES
args.rellinks = nofamily
clean.temp = no
axf.cmd = C:\\Program\ Files\\Antenna House\\AHFormatterV64\\AHFCmd.exe
pdf.formatter = ah
args.grammar.cache=no
validate = no

我实际上已经设置了args.grammar.cachetonovalidateto no,但它仍然没有任何帮助。我做错了吗?或者有没有办法让 Xerces 忽略 DTD 验证?

标签: xercesdita-ot

解决方案


我花了一些时间才弄清楚是什么导致了问题。由于我们使用的是 SDL 知识中心,我认为他们已经对我们使用的旧版本的 dita-ot 进行了一些修改。所以我下载了dita-ot 1.8.5 并将其与我们当前的dita-ot 进行比较。

当我在 WinMerge 中比较它们时,我发现它确实有一些变化。在catalog-dita.xml中,我看到了一些对定制 dtd 组件的引用。

+   <nextCatalog catalog="../../../../Web/Author/ASP/DocTypes/catalog.xml"></nextCatalog>
+   
+   <!-- Java properties file DTD -->
+   <system systemId="http://java.sun.com/dtd/properties.dtd" uri="dtd/properties.dtd"></system>
+   

这解决了我的问题。希望它可以帮助某人。


推荐阅读