2017-01-03 75 views
1

我需要的步骤DITA转换为Word的过程中的氧链接,我需要的步骤如何使用DITA OT DITA插件名为com.elovirta.ooxml使用被称为使用<a href="https://github.com/jelovirt/com.elovirta.ooxml" rel="nofollow noreferrer">this</a><strong>com.elovirta.ooxml</strong>插件名称转换为Word中的氧

输入迪塔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,安装的三个插件com.elovirta.ooxml,org.dita.base,org.dita后。因为这三个插件相互依赖,所以我安装了三个插件。在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> 

所以我已经安装了三个插件。从那以后,我在命令提示符都拼命地跑的命令是这样的:

  • 在改造方案,我选择了DITA OT:

    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 
    

    后,我已经在氧气完成这一过程转化,

    转化类型我选择了,

    个我并没有改变屏幕下方所示的任何参数

    3分出手

enter image description here

点击确定按钮,我已经创建的方案改造后的运行我得到这个错误:

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更新的版本n安装,我运行命令:

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较新的版本。

做的过程中混帐此命令后后

$ ./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转换。

由于提前

回答

1

有一个Java类失踪,可能是因为你混合工具包或它的插件版本不兼容。

由于您在Windows计算机上,因此需要一个可用的命令行界面来执行以下命令。我建议你安装Git,因为它船舶的Git的Bash,其中包含一个很好的命令行界面,使您可以执行基本类似LS Unix命令,卷曲

混帐猛砸,执行:

  1. 打开你的用户主目录。

    cd ~ 
    
  2. 创建临时目录。

    mkdir temp 
    
  3. 转到临时目录。

    cd temp 
    
  4. 下载最新的DITA-OT。

    curl -LO https://github.com/dita-ot/dita-ot/releases/download/2.4.1/dita-ot-2.4.1.zip 
    
  5. 解压OT。

    unzip dita-ot-2.4.1.zip 
    
  6. 转到了目录。

    cd dita-ot-2.4.1/bin/ 
    
  7. 安装com.elovirta.ooxml插件。

    ./dita --install https://github.com/jelovirt/com.elovirta.ooxml/archive/master.zip 
    
  8. 生成docx rom DITA-OT文档。

    我们可以添加这样
    ./dita --input ../docsrc/userguide-book.ditamap -f docx 
    
+0

'输入' 格式? ./dita --E:/Batch_4.dita ../docsrc/userguide-book.ditamap -f docx 这是正确的方法吗? – User515

+0

不,您可以在文档中找到参数参考: http://www.dita-ot.org/2.4/user-guide/build-using-dita-command.html –

+0

如果我的回答对您有帮助,请接受它。 –