我正在使用 DITA OT 将 XML 转换为 xhtml。我的 xsl 看起来像
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE some_name [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon" extension-element-prefixes="saxon">
<xsl:import href="../map2xhtmtoc.xsl"/>
<!--<xsl:import href="result-doc.xsl"/>-->
<!--<xsl:import href="custom-ecollege-dita2xhtml.xsl"/>-->
<xsl:output name="html" method="html" indent="yes" encoding="UTF-8"/>
<!-- Define a newline character -->
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:template match="/">
<html>
<head>
<body>
<xsl:apply-templates select="myProduct"/>
</body>
</head>
</html>
</xsl:template>
<!--other templates goes here-->
<div class="floatRight"/>
<div class="headerSeparator">
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</div>
</xsl:template>
</xsl:stylesheet>
现在,如果我尝试使用 DITA OT jar cmd 对我的 xml 执行此 xsl 以进行 xhtml 转换。
java -jar .\lib\dost.jar /i:samples/mycompany/myContent/myContent.ditamap /transtype:xhtml /xsl:xsl/mycompany/custom-map2xhtml.xsl
执行上述命令后,我收到以下错误。
[xslt] D:\DITA-OT1.5.2\xsl\mycompany\custom-map2xhtm.xsl:21: Fatal Error! When 'standalone' or 'doctype-system' is specified, the document must be well-formed; but this document contains a top-level text node
[xslt] Failed to process null
我打破了我的头,找出为什么会发生这个错误。
谢谢。