首页 > 解决方案 > 如何在DITA OT中进行html转换时根据章节创建文件夹并移动该文件夹下的所有关联文件

问题描述

我正在使用 DITA-OT 3.4.1 将 DITA xml 转换为 html。我要做的是在转换基于章节名称的创建文件夹并将所有转换后的 html 文件和图像移动到单个章节文件夹下。目前我在同一个文件夹中获取所有 html 和图像。如何使用 xslt 或 ANT 来实现这一点

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN" "bookmap.dtd">
<bookmap>
  <booktitle>
    <mainbooktitle>Title of the docuemnt</mainbooktitle>
  </booktitle>
  <chapter href="chapter1.xml">
    <topicmeta>
      <navtitle>chapter 1</navtitle>
    </topicmeta>
    <topicref href="topic1.xml">
      <topicmeta>
        <navtitle>topic 1</navtitle>
      </topicmeta>
    </topicref>
    <topicref href="topic2.xml">
      <topicmeta>
        <navtitle>topic2</navtitle>
      </topicmeta>
    </topicref>
  </chapter>
  <chapter href="chapter 2.xml">
    <topicmeta>
      <navtitle>chapter 2</navtitle>
    </topicmeta>
    <topicref href="topic1.xml">
      <topicmeta>
        <navtitle>topic1</navtitle>
      </topicmeta>
    </topicref>
  </chapter>
</bookmap>

我的示例书图

标签: xsltantditadita-ot

解决方案


推荐阅读