我需要使用此链接使用名为com.elovirta.ooxml的插件名称将 DITA 转换为氧气中的文字处理的步骤,
输入 Dita xml 文件为:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
PUBLIC "urn:pubid:doctypes:dita:topic" "topic.dtd">
<topic id="d63e3" xml:lang="en-US" outputclass="Student_Notebook">
<title outputclass="Title">Student Notebook</title>
<body>
<section outputclass="Handout"><title>Labs Student Notebook
1</title><p outputclass="SC_P_Large_Center">Module 1</p><p
outputclass="SC_P_Large_Center">Literacy Labs</p><p outputclass="SC_P_Large_Center">Student
Notebook</p><p outputclass="SC_P_Medium">________________ _______________ _______________
_______________ </p></section>
</body>
</topic>
我尝试通过 DITA-OT 2.1.0,在 dita ot 中安装三个插件 com.elovirta.ooxml、org.dita.base、org.dita.pdf2 后,因为这三个插件相互依赖,所以我安装了三个插件。在com.elovirta.ooxml plugin.xml 中提到这样的代码:
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.elovirta.ooxml">
<require plugin="org.dita.pdf2"/>
<feature extension="dita.conductor.transtype.check" value="docx"/>
<feature extension="dita.transtype.print" value="docx"/>
<feature extension="dita.conductor.target.relative" file="integrator.xml"/>
</plugin>
所以我安装了三个插件。之后,我在命令提示符下运行了命令,如下所示:
C:\DITA-OT\dita-ot-2.1.0-dita2word>ant -f integrator.xml
Buildfile: C:\DITA-OT\dita-ot-2.1.0-dita2word\integrator.xml
strict:
integrate:
[jar] Building jar: C:\DITA-OT\dita-ot-2.1.0-dita2word\lib\dost-configuration.jar
BUILD SUCCESSFUL
Total time: 0 seconds
在那之后
我在氧气中完成了这个过程:
在transformation Scenario中,我选择了DITA OT Transformation,
我选择的转换类型,
我没有改变任何参数
下面的屏幕截图中显示了 3 个点
通过单击确定按钮,我在转换运行后创建了场景,但出现此错误:
Description: [DOTJ025E] The input to the "topic merge" transform process could not be found. Correct any earlier transform errors and try the build again, or see the DITA-OT User Guide for additional causes.
所以我尝试在插件安装后使用 dita-ot-2.4.1 更新版本,我运行了命令:
C:\DITA-OT\dita-ot-2.4.1>ant -f integrator.xml
Buildfile: C:\DITA-OT\dita-ot-2.4.1\integrator.xml
integrate:
BUILD FAILED
C:\DITA-OT\dita-ot-2.4.1\integrator.xml:43: java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableSet
at org.dita.dost.platform.Integrator.<clinit>(Integrator.java:79)
at org.dita.dost.platform.IntegratorTask.execute(IntegratorTask.java:32)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:854)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableSet
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1388)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1337)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1089)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
Total time: 0 seconds
我收到此错误,所以我没有使用 DITA OT 较新版本。
在git中执行此命令后
$ ./dita --input=/E/SampleFile.dita -f docx
我收到的错误是:
[pipeline] Error at xsl:element on line 64 of topicmergeImpl.xsl:
[pipeline] XTDE0820: Invalid element name. Invalid QName {}
[pipeline] in built-in template rule
Error: Failed to run pipeline: Failed to process merged topics: Invalid element name. Invalid QName {}
请向我提供解决此错误以及最多 dita2word 转换的建议。
提前致谢