是否可以使用DITA OT 1.8.5中的插件com.elovirta.ooxml将DITA转换为DOCX
输入dita地图文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "urn:pubid:org:doctypes:dita:map" "map.dtd">
<map>
<title>This is a test DITA Map</title>
<topicref href="Bank.dita"/>
</map>
输入dita文件:
<?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>
运行docx转换后,我收到错误日志,如下所示:
docx.convert:
>[xslt] Processing E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\Test_MERGED.xml to E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml
[xslt] Loading stylesheet C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\docx\word\document.flat.xsl
[xslt] Processing E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\docx\docProps\core.xml
[xslt] Loading stylesheet C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\docx\docProps\core.xsl
[xslt] Processing E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\docx\word\document.xml
[xslt] Loading stylesheet C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\docx\word\document.xsl
[xslt] C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\docx\word\document.topic.xsl:22:30: Warning! Stylesheet module file:/C:/DITA-OT/DITA-OT1.8.5-ELED/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl is included or imported more than once. This is permitted, but may lead to errors or unexpected behavior
[xslt] C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\docx\word\document.topic.xsl:604:47: Fatal Error! No template exists named getVariable
[xslt] Failed to process E:\Vinod\2017\Jan\4-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml
建立失败 C:\ DITA-OT \ DITA-OT1.8.5-ELED \ build.xml:44:执行此行时发生以下错误: C:\ DITA-OT \ DITA-OT1.8.5-ELED \ plugins \ com.elovirta.ooxml \ build.xml:74:javax.xml.transform.TransformerConfigurationException:net.sf.saxon.s9api.SaxonApiException:样式表编译失败:报告1错误 at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178) 在org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876) 在org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414) 在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(未知来源) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) 在org.apache.tools.ant.Target.execute(Target.java:435) 在org.apache.tools.ant.Target.performTasks(Target.java:456) 在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 在org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) 在org.apache.tools.ant.Project.executeTargets(Project.java:1248) 在org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440) 在org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) 在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(未知来源) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at&gt; org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) 在org.apache.tools.ant.Target.execute(Target.java:435) 在org.apache.tools.ant.Target.performTasks(Target.java:456) 在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 在org.apache.tools.ant.Project.executeTarget(Project.java:1364) at&gt; org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 在org.apache.tools.ant.Project.executeTargets(Project.java:1248) 在org.apache.tools.ant.Main.runBuild(Main.java:851) 在org.apache.tools.ant.Main.startAnt(Main.java:235) 在org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 在org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) 引起:net.sf.saxon.s9api.SaxonApiException:样式表编译失败:报告1错误 在net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546) ......还有35个 引起:net.sf.saxon.trans.XPathException:样式表编译失败:报告1错误 at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97) 在net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
... 35更多
net.sf.saxon.s9api.SaxonApiException:样式表编译失败:报告了1个错误 在net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546) at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317) 在org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178) 在org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876) 在org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414) 在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(未知来源) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) 在org.apache.tools.ant.Target.execute(Target.java:435) 在org.apache.tools.ant.Target.performTasks(Target.java:456) 在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 在org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) 在org.apache.tools.ant.Project.executeTargets(Project.java:1248) 在org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440) 在org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) 在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(未知来源) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) 在org.apache.tools.ant.Target.execute(Target.java:435) 在org.apache.tools.ant.Target.performTasks(Target.java:456) 在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 在org.apache.tools.ant.Project.executeTarget(Project.java:1364) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 在org.apache.tools.ant.Project.executeTargets(Project.java:1248) 在org.apache.tools.ant.Main.runBuild(Main.java:851) 在org.apache.tools.ant.Main.startAnt(Main.java:235) 在org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 在org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) 引起:net.sf.saxon.trans.XPathException:样式表编译失败:报告1错误 at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97) 在net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543) ......还有35个
总时间:6秒
该过程以退出代码完成:1
请帮助我。
答案 0 :(得分:4)
您的插件不适用于DITA-OT 1.8.5
,即EOL。您的转换失败,因为找不到getVariable
函数,该函数已随DITA-OT 2.x
引入。您应该定义考虑将您的环境迁移到DITA-OT 2.x
。如果您不能,请使用docx
和您的DITA专精为com.elovirta.ooxml
转换设置第二个工具包。您可以通过设置dita.dir
参数在转换期间选择OT。您也可以在构建脚本中执行此操作。不值得尝试向后移植com.elovirta.ooxml
,您最好将资源用于升级环境。