Search code examples
xmlxsltepubditadita-ot

Omit topics at the time of DITA OT Epub conversion dita to EPUB


I need to omit topics at the time of DITA OT EPUB conversion from DITA to EPUB in Epub output MY Input XML Dita map file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pubmap
  PUBLIC "urn:pubid:com.sam.doctypes:dita:pubmap" "pubmap.dtd">
<pubmap xml:lang="en-US">
  <pubtitle>
    <mainpubtitle outputclass="book">Sample Word</mainpubtitle>
  </pubtitle>
  <topicref href="topics/topic_1.dita">
    <topicmeta>
      <navtitle>Ram-Files-Raj (RFR)</navtitle>
      <metadata/>
    </topicmeta>
  </topicref>
  <topicref href="topics/topic_2.dita">
    <topicmeta>
      <navtitle>Files-Sampletitle (FST)</navtitle>
      <metadata/>
    </topicmeta>
  </topicref>
</pubmap>

My topic_1.dita file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "urn:pubid:com.sam.doctypes:dita:topic" "topic.dtd">
<topic id="topic_1" xml:lang="en-US" outputclass="Ram-Files-RajRFR"><title>Ram-Files-Raj (RFR)</title></topic>

My topic_2.dita file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "urn:pubid:com.sam.doctypes:dita:topic" "topic.dtd">
<topic id="topic_2" xml:lang="en-US" outputclass="Files-SampletitleFST"><title>Files-Sampletitle (FST)</title></topic>

Using DITA OT 1.8.5 base EPUB plugin named "org.dita4publishers.epub".

Out put i am getting all the the topics which are in dita map file but i want to omit the topic_2 in the epub output generated using epub plugin in oxygen.


Solution

  • In the DITA Map on the topicref to "topics/topic_2.dita" you can add a profiling attribute like 'product="X"' and then create a Ditaval filter file (which you can name for example "filter.xml") having the content like:

     <val>
        <prop action="exclude" att="product" val="X"/>  
     </val>
    

    Then edit (or duplicate and edit) the Oxygen transformation scenario and it has a "Filters" tab where you can add a reference to the Ditaval filter file. As an alternative in the same "Filters" tab you have a table where you can add exclude conditions. Some more details about using DITA profiling: https://www.oxygenxml.com/doc/versions/20.0/ug-editor/topics/dita-profiling-conditional-text.html