简体   繁体   English

DocBook-XML和webhelp

[英]DocBook-XML and webhelp

Following the steps mentioned here: http://docbook.sourceforge.net/release/xsl/current/webhelp/docs/ch02s01.html 按照这里提到的步骤: http//docbook.sourceforge.net/release/xsl/current/webhelp/docs/ch02s01.html

ant webhelp -Doutput-dir=test-ouput (ouput is a typo in the documentation I think, but I tested it with test-ouput and test-output with the same result) ant webhelp -Doutput-dir=test-ouput (ouput是我认为的文档中的拼写错误,但我用test-ouputtest-output测试了它的结果相同)

Tested with 经过测试

  • Windows 8 and Windows 8.1 Windows 8和Windows 8.1
  • java version "1.7.0_51" java版“1.7.0_51”
  • ant 1.8.2 and ant 1.9.3 蚂蚁1.8.2和蚂蚁1.9.3
  • docbook-xsl-1.78.1 的DocBook-XSL-1.78.1
  • xerces-2_11_0 的Xerces-2_11_0
  • saxon6-5-5 saxon6-5-5

Any idea where I should look towards? 知道我应该去哪看?

Output: 输出:

Buildfile: D:\apps\docbook-xsl-1.78.1\webhelp\build.xml

validate:

clean:
   [delete] Deleting directory D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput

chunk:
    [mkdir] Created dir: D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput
     [xslt] Processing D:\apps\docbook-xsl-1.78.1\webhelp\docsrc\readme.xml to D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput\null2007605189
     [xslt] Loading stylesheet D:\apps\docbook-xsl-1.78.1\profiling\profile.xsl
     [xslt] Processing D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput\null2007605189 to D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput\null295245132
     [xslt] Loading stylesheet D:\apps\docbook-xsl-1.78.1\webhelp\xsl\webhelp.xsl
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/autoidx.xsl: line 551: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/autoidx.xsl: line 600: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/autoidx.xsl: line 600: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/autoidx.xsl: line 624: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/autoidx.xsl: line 624: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/lists.xsl: line 815: Attribut 'type' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/callout.xsl: line 109: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/xref.xsl: line 181: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/xref.xsl: line 966: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 96: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 96: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 131: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 131: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 171: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 171: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 707: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 924: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 1041: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 1171: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 1171: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 1271: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/inline.xsl: line 1309: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/glossary.xsl: line 329: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/glossary.xsl: line 329: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/glossary.xsl: line 402: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/glossary.xsl: line 402: Attribut 'href' befindet sich nicht in einem Element.
     [xslt] : Warning! file:/D:/apps/docbook-xsl-1.78.1/xhtml/annotations.xsl: line 106: Attribut 'onClick' befindet sich nicht in einem Element.
     [xslt] : Error! null
     [xslt] Failed to process D:\apps\docbook-xsl-1.78.1\webhelp\test-ouput\null2007605189

BUILD FAILED
D:\apps\docbook-xsl-1.78.1\webhelp\build.xml:62: javax.xml.transform.TransformerException: java.lang.NullPointerException
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:716)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
        at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:194)
        at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:852)
        at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:388)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
        at com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary.referenceToNodeSet(BasisLibrary.java:998)
        at webhelp.l10n$dot$language()
        at webhelp.topLevel()
        at webhelp.transform()
        at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:603)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709)
        ... 21 more
---------
java.lang.NullPointerException
        at com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary.referenceToNodeSet(BasisLibrary.java:998)
        at webhelp.l10n$dot$language()
        at webhelp.topLevel()
        at webhelp.transform()
        at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:603)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
        at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:194)
        at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:852)
        at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:388)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 13 seconds

Based on the stack trace, it seems you are using Xalan for xsl transformation. 基于堆栈跟踪,您似乎正在使用Xalan进行xsl转换。 It is recommended to use Saxon 6.5.5 with Webhelp which too is a Java impl. 建议将Saxon 6.5.5与Webhelp一起使用,这也是一个Java impl。 You can point to Saxon by setting xslt-processor-classpath in build.properties to the location of your saxon jar. 您可以通过将build.properties中的xslt-processor-classpath设置为撒克逊jar的位置来指向Saxon。 In the meanwhile, you should also set xercesImpl.jar and xml-apis.jar properties. 同时,您还应该设置xercesImpl.jar和xml-apis.jar属性。

Modify the following in the webhelp build.properties so that they point to your local copy of the jars indicated: 修改webhelp build.properties中的以下内容,以便它们指向您指示的jar的本地副本:

  • Saxon 6.5 jar Saxon 6.5罐子
  • Xerces 2: xercesImpl.jar Xerces 2:xercesImpl.jar
  • xml-commons: xml-apis.jar xml-commons:xml-apis.jar

    xslt-processor-classpath=/usr/share/java/saxon-6.5.5.jar XSLT处理器的类路径= / USR /共享/爪哇/撒克逊6.5.5.jar

    xercesImpl.jar=/usr/share/java/xercesImpl.jar xercesImpl.jar =的/ usr /共享/ JAVA / xercesImpl.jar

    xml-apis.jar=/usr/share/java/xml-apis.jar XML-apis.jar =的/ usr /共享/ JAVA / XML的apis.jar

Very important 很重要

build.properties

xslt-processor-classpath=d:\\apps\\saxon\\saxon.jar
xercesImpl.jar=d:\\apps\\xerces\\xercesImpl.jar;d:\\apps\\saxon\\saxon.jar
xml-apis.jar=d:\\apps\\xerces\\xml-apis.jar

The line starting xercesImpl... needs an additional reference to saxon.jar to work also with larger xml input files. xercesImpl...开始的行xercesImpl...需要对saxon.jar的附加引用才能使用更大的xml输入文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM