使用org.dita4publishers.html2插件将所有概念,章节和tpoicref合并为单个html

时间:2017-03-10 09:25:22

标签: xml xslt dita dita-ot

是否可以使用org.dita4publishers.html2插件获取所有topicref的概念,章节中的单个html文件

我的ditamap或xml文件就像这样

<?xml version="1.0" encoding="UTF-8"?>
<bookmap>
    <title class="- topic/title ">Workflow</title>
    <frontmatter class="- map/topicref bookmap/frontmatter ">
      <preface class="- map/topicref bookmap/preface " href="concept/guide.xml"/>
      <preface class="- map/topicref bookmap/preface " href="concept/notices.xml"/>
        <booklists class="- map/topicref bookmap/booklists ">
            <toc class="- map/topicref bookmap/toc "/>
            <tablelist class="- map/topicref bookmap/tablelist "/>
        </booklists>
    </frontmatter>
   <chapter class="- map/topicref bookmap/chapter " href="concept/workflow.xml"/>
  <chapter class="- map/topicref bookmap/chapter " href="concept/plug.xml"/>
  <chapter class="- map/topicref bookmap/chapter " href="task/deve.xml"/>
  <chapter class="- map/topicref bookmap/chapter " href="concept/overview.xml">
    <topicref class="- map/topicref " href="task/existing.xml"/>
      <topicref class="- map/topicref " href="task/Edit.xml"/>
      <topicref class="- map/topicref " href="task/original.xml"/>
    </chapter>
    <chapter class="- map/topicref bookmap/chapter " href="task/Start.xml"/>

</bookmap>

ditamap引用文件 Start.xml

<task>
<title>intro1</title>
<tbody>
<p>intro1</p>
</tbody>
</task>

overview.xml

<task>
<title>intro2</title>
<tbody>
<p>intro2</p>
</tbody>
</task>

existing.xml

<task>
<title>intro3</title>
<tbody>
<p>intro3</p>
</tbody>
</task>

Edit.xml

<task>
<title>intro4</title>
<tbody>
<p>intro4</p>
</tbody>
</task>

original.xml

<task>
<title>intro5</title>
<tbody>
<p>intro5</p>
</tbody>
</task>

Start.xml

<task>
<title>intro6</title>
<tbody>
<p>intro6</p>
</tbody>
</task>

guide.xml

<concept>
<title>intro7</title>
<conbody>
<p>intro7</p>
</conbody>
</concept>

notices.xml

<concept>
<title>intro8</title>
<conbody>
<p>intro8</p>
</conbody>
</concept>

workflow.xml

<concept>
<title>intro9</title>
<conbody>
<p>intro9</p>
</conbody>
</concept>

plug.xml

<concept>
<title>intro10</title>
<conbody>
<p>intro10</p>
</conbody>
</concept>

overview.xml

<concept>
<title>intro11</title>
<conbody>
<p>intro11</p>
</conbody>
</concept>

使用org.dita4publishers.html2插件将这些所有文件转换为单个html文件,如下所示

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:df="http://dita2indesign.org/dita/functions" xml:lang="en-us" lang="en-us">
<head>
<link rel="stylesheet" type="text/css" href="css/topic.css"></link>
</head>

<body id="topicid">
<div class="topic">
<h1>intro7</h1>
<p>intro7</p>
</div>
<div class="topic">
<h1>intro8</h1>
<p>intro8</p>
</div>
<div class="topic">
<h1>intro9</h1>
<p>intro9</p>
</div>
<div class="topic">
<h1>intro8</h1>
<p>intro8</p>
</div>
<div class="topic">
<h1>intro10</h1>
<p>intro10</p>
</div>
<div class="topic">
<h1>intro8</h1>
<p>intro8</p>
</div>
</body>
</html>

请在此建议我

2 个答案:

答案 0 :(得分:1)

请注意,D4P转换仍然停留在1.8.5上,因为依赖于不能与2.x一起使用的预处理扩展,还因为我还没有完全更新处理。

但请注意,HTML2转换已过时,可能无法正确处理地图级别的分块。

D4P HTML5转换应该正确处理它,但HTML5转换并不是HTML2转换的直接替代品。

答案 1 :(得分:0)

您可以将chunk元素的<bookmap>属性设置为值to-content,也可以使用参数-Droot-chunk-override=to-content调用DITA-OT转换。