在 DITA OT 1.8.5 中使用插件 com.elovirta.ooxml 将 DITA 转为 DOCX
DITA to DOCX using plugin com.elovirta.ooxml in DITA OT 1.8.5
是否可以使用 DITA OT 1.8.5 中的插件 com.elovirta.ooxml 将 DITA 转换为 DOCX
输入数据映射文件:
<?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>
并输入数据文件:
<?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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_MERGED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml
BUILD FAILED
C:\DITA-OT\DITA-OT1.8.5-ELED\build.xml:44: The following error occurred while executing this line:
C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\build.xml:74: javax.xml.transform.TransformerConfigurationException: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at >org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546)
... 35 more
Caused by: net.sf.saxon.trans.XPathException: Stylesheet compilation failed: 1 error reported
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
... 35 more
net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: net.sf.saxon.trans.XPathException: Stylesheet compilation failed: 1 error reported
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
... 35 more
Total time: 6 seconds
The process finished with exit code: 1
请帮助我。
您的插件将无法与 DITA-OT 1.8.5
一起使用,即 EOL。您的转换失败,因为未找到 getVariable
函数,该函数已通过 DITA-OT 2.x
引入。您应该明确考虑将您的环境迁移到 DITA-OT 2.x
。如果不能,请使用 com.elovirta.ooxml
和您的 DITA 专业化为您的 docx
转换设置第二个工具包。您可以通过设置 dita.dir
参数在转换过程中选择 OT。您也可以在构建脚本中执行此操作。不值得尝试向后移植com.elovirta.ooxml
,你最好把你的资源花在升级你的环境上。
是否可以使用 DITA OT 1.8.5 中的插件 com.elovirta.ooxml 将 DITA 转换为 DOCX
输入数据映射文件:
<?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>
并输入数据文件:
<?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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_MERGED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml to E:\Vinod17\Jan-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:\Vinod17\Jan-1\temp\docx\oxygen_dita_temp\Test_CLEANED.xml
BUILD FAILED C:\DITA-OT\DITA-OT1.8.5-ELED\build.xml:44: The following error occurred while executing this line: C:\DITA-OT\DITA-OT1.8.5-ELED\plugins\com.elovirta.ooxml\build.xml:74: javax.xml.transform.TransformerConfigurationException: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178) at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876) at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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:1393) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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:1393) at org.apache.tools.ant.Project.executeTarget(Project.java:1364) at >org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.Main.runBuild(Main.java:851) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546) ... 35 more Caused by: net.sf.saxon.trans.XPathException: Stylesheet compilation failed: 1 error reported at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97) at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
... 35 more
net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546) at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317) at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178) at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876) at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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:1393) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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:1393) at org.apache.tools.ant.Project.executeTarget(Project.java:1364) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.Main.runBuild(Main.java:851) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: net.sf.saxon.trans.XPathException: Stylesheet compilation failed: 1 error reported at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97) at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543) ... 35 more
Total time: 6 seconds
The process finished with exit code: 1
请帮助我。
您的插件将无法与 DITA-OT 1.8.5
一起使用,即 EOL。您的转换失败,因为未找到 getVariable
函数,该函数已通过 DITA-OT 2.x
引入。您应该明确考虑将您的环境迁移到 DITA-OT 2.x
。如果不能,请使用 com.elovirta.ooxml
和您的 DITA 专业化为您的 docx
转换设置第二个工具包。您可以通过设置 dita.dir
参数在转换过程中选择 OT。您也可以在构建脚本中执行此操作。不值得尝试向后移植com.elovirta.ooxml
,你最好把你的资源花在升级你的环境上。