XMLをxhtmlに変換するためにDITAOTを使用しています。私の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を使用して、xhtml変換用のxmlに対してこのxslを実行しようとした場合。
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
このエラーが発生している理由を調べるために頭を悩ませています。
ありがとう。