dita4publishers | Master project for the DITA for Publishers activity

 by   dita4publishers Java Updated: 1 month ago - v1.1.0 License: No License

Download this library from

Build Applications

kandi X-RAY | dita4publishers REVIEW AND RATINGS

Version 1.1.0 Under development. Master project for the DITA for Publishers activity. This project includes the toolkit plugins and samples as git submodules. See the wiki for details on how to set up new clones of this project. NOTE: Issues for specific transformation types (EPUB, HTML5, etc.) are maintained in the project each transformation type. If you're not sure which project an issue applies to, feel free to submit the issue against the dita4publishers project.

kandi-support
Support

  • dita4publishers has a low active ecosystem.
  • It has 32 star(s) with 16 fork(s).
  • There were 2 major release(s) in the last 6 months.
  • On average issues are closed in 39 days.
  • It has a neutral sentiment in the developer community.

quality kandi
Quality

  • dita4publishers has 0 bugs and 0 code smells.

security
Security

  • dita4publishers has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • dita4publishers code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.

license
License

  • dita4publishers does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.

build
Reuse

  • dita4publishers releases are available to install and integrate.
  • dita4publishers has no build file. You will be need to create the build yourself to build the component from source.
  • dita4publishers saves you 25585 person hours of effort in developing the same functionality from scratch.
  • It has 49820 lines of code, 2216 functions and 597 files with 0 % test coverage
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA

kandi has reviewed dita4publishers and discovered the below as its top functions. This is intended to give you an instant insight into dita4publishers implemented functionality, and help decide if they suit your requirements.

  • Add pages for page master .
  • Traverse map get list .
  • Recursively creates the directories of the given ZIP file .
  • Resolve object data to a URI .
  • Zip a map bos into an output zip file .
  • Add topics to a map .
  • Resolve dynamic operations
  • Sets link info attribute .
  • Apply shadow operation .
  • Parse generalized props attribute value .

dita4publishers Key Features

dita4publishers examples and code snippets

  • Omit topics at the time of DITA OT Epub conversion dita to EPUB
  • How to remove namespace from a an element of html2 transform created output
  • Custom XHTML plugin creation index.html not effecting

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

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

How to remove namespace from a an element of html2 transform created output

<xsl:template match="*">
  <xsl:element name="{local-name()}">
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

Custom XHTML plugin creation index.html not effecting

<feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>
  <antcall target="dita2xhtml"/>
<target name="dita2xhtml-custom">
    <echo>custom HTML transform</echo>
    <property name="args.xsl" value="${dita.plugin.com.custom.xhtml.dir}/xslhtml/dita2xhtml.xsl"/>
    <antcall target="dita2xhtml"/>
</target>
 <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
-----------------------
<feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>
  <antcall target="dita2xhtml"/>
<target name="dita2xhtml-custom">
    <echo>custom HTML transform</echo>
    <property name="args.xsl" value="${dita.plugin.com.custom.xhtml.dir}/xslhtml/dita2xhtml.xsl"/>
    <antcall target="dita2xhtml"/>
</target>
 <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
-----------------------
<feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>
  <antcall target="dita2xhtml"/>
<target name="dita2xhtml-custom">
    <echo>custom HTML transform</echo>
    <property name="args.xsl" value="${dita.plugin.com.custom.xhtml.dir}/xslhtml/dita2xhtml.xsl"/>
    <antcall target="dita2xhtml"/>
</target>
 <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
-----------------------
<feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>
  <antcall target="dita2xhtml"/>
<target name="dita2xhtml-custom">
    <echo>custom HTML transform</echo>
    <property name="args.xsl" value="${dita.plugin.com.custom.xhtml.dir}/xslhtml/dita2xhtml.xsl"/>
    <antcall target="dita2xhtml"/>
</target>
 <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>

COMMUNITY DISCUSSIONS

Top Trending Discussions on dita4publishers
  • Omit topics at the time of DITA OT Epub conversion dita to EPUB
  • Guide lines for chunk="to-content"
  • How to remove namespace from a an element of html2 transform created output
  • Merging all concepts , chapters and tpoicref's in to single into a single html using org.dita4publishers.html2 plugin
  • Custom XHTML plugin creation index.html not effecting
Top Trending Discussions on dita4publishers

QUESTION

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

Asked 2018-Apr-25 at 12:36

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.

ANSWER

Answered 2018-Apr-25 at 12:36

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

Source https://stackoverflow.com/questions/50000527

QUESTION

Guide lines for chunk="to-content"

Asked 2017-May-29 at 10:10

I am using chunk="to-content" in topichead tag like below to generate merged topic html file using DITA OT 1.8.5 Plugin org.dita4publishers.html2 plugin then its generating Chunk363995000.html output

My ditamap file

<map>
<title>Directory</title>
<topichead chunk="to-content">
<topicmeta class="- map/topicmeta "><navtitle>Details</navtitle></topicmeta>
<topicref class="- map/topicref " href="dita1.xml"/>
    <topicref class="- map/topicref " href="dita2.xml"/>
    <topicref class="- map/topicref " href="dita3.xml"/></topichead>
</map>

If used chunk="to-content" in root element its not generating merged topic html file using DITA OT 1.8.5 Plugin org.dita4publishers.html2 plugin

<map chunk="to-content">
<title>Directory</title>
<topicref class="- map/topicref " href="dita1.xml"/>
    <topicref class="- map/topicref " href="dita2.xml"/>
    <topicref class="- map/topicref " href="dita3.xml"/>
</map>

For this i have to do any xsl changes or plugin code?

Please give any guidelines or suggestions to overcome this issue.

Thanks in Advance.

ANSWER

Answered 2017-May-29 at 10:10

The reason the numbered chunk HTML file is generated is because the topichead element does not (and should not) include a filename. When a chunk attribute is added to the map, pubmap or bookmap references, the filename is taken from the name of the .ditamap file.

I've tried your examples here and both of them worked for chunking content if I used the D4P XHTML transformation or a variation of it. So there's nothing wrong with the DITA XML you're using, just with the old HTML 2 plugin. You probably need to switch to either the HTML 5 plugin or the XHTML plugin. The HTML 2 plugin is no longer developed and only included for legacy users.

Source https://stackoverflow.com/questions/43039235

QUESTION

How to remove namespace from a an element of html2 transform created output

Asked 2017-Mar-13 at 15:59

Is it possible to remove namespace from an output which is generated by html2 transform output using plugin named org.dita4publishers.html2

I have generated the output from dita to html2 out put i am getting for fig

I am getting output from html2 transform

<div xmlns="http://www.w3.org/1999/xhtml" class="fignone" id="call1">
<div class="figbody">
<img xmlns="" src="images/imag1.png"></img>
</div>
<span class="figcap"><span class="enumeration fig-enumeration">Figure 1. </span>Nursing image</span></div>

But i want to exclude namespace as like this

<div class="fignone" id="call1">
<div class="figbody">
<img xmlns="" src="images/imag1.png"></img>
</div>
<span class="figcap"><span class="enumeration fig-enumeration">Figure 1. </span>Nursing image</span></div>

and i am generating css links using template

<xsl:template match="*" mode="chapterHead">
   <head><xsl:value-of select="$newline"/>
     <!-- initial meta information -->
   <link rel="stylesheet" type="text/css" href="css/care.css"/><xsl:value-of select="$newline"/>
   </head>
   <xsl:value-of select="$newline"/>
 </xsl:template>

but generating output as like this

<head>
<link rel="stylesheet" type="text/css" href="care.css"></link>
</head>

its neglecting the text before / and also neglecting the /

I want output as

<head>
<link rel="stylesheet" type="text/css" href="css/care.css"></link>
</head>

Please suggest me on these issues.

Note: I had used exclude-result-prefixes="#all" also. But its not working.

Thanks in Advance

ANSWER

Answered 2017-Mar-13 at 15:59

You've described the problem incorrectly. In terms of the XDM data model, you don't want to "remove a namespace" from the output, you want every element in the output to be in a different namespace from the one it is currently in. (Specifically, you want it to be in no namespace). That affects every instruction that creates an element. So the easiest way to achieve this is probably by a post-processing pass on the current output, changing the namespace using the template rule

<xsl:template match="*">
  <xsl:element name="{local-name()}">
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

Source https://stackoverflow.com/questions/42763953

QUESTION

Merging all concepts , chapters and tpoicref's in to single into a single html using org.dita4publishers.html2 plugin

Asked 2017-Mar-10 at 19:50

Is it possible to get the all topicref's concept's, chapter's in to single html file using org.dita4publishers.html2 plugin

My ditamap or xml file is like this

<?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 referenced files 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>

these all the files into single html file needed as below using org.dita4publishers.html2 plugin

<?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>

Please suggest me on this

ANSWER

Answered 2017-Mar-10 at 11:12

You can either set the chunk attribute of your <bookmap> element to the value to-content or call your DITA-OT transformation with the parameter -Droot-chunk-override=to-content.

Source https://stackoverflow.com/questions/42714715

QUESTION

Custom XHTML plugin creation index.html not effecting

Asked 2017-Feb-22 at 12:03

I have created the custom xhtml plugin like this

my plugin.xml code is

<?xml version="1.0" encoding="UTF-8"?>
<!--
  This file is part of the DITA Open Toolkit project.
  See the accompanying license.txt file for applicable licenses.
-->
<plugin id="com.custom.xhtml">
  <!-- extensions -->
  <feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>
  <feature extension="dita.conductor.transtype.check" value="xhtml-custom" type="txt"/>
  <feature extension="dita.conductor.target.relative" file="build.xml"/>
  <!-- change value to match your custom transtype -->
</plugin>

build.xml code is

<?xml version="1.0" encoding="UTF-8"?>
<project name="com.custom.xhtml">
  <import file="build_transtype-custom.xml"/>
</project>

the build_transtype-custom.xml is

<project name="xhtml-custom" default="dita2xhtml-custom">
<property name="transtype" value="xhtml-custom"/>
<target name="dita2xhtml-custom">
<echo>custom HTML transform</echo>
<!-- Set properties here -->
<antcall target="dita2xhtml"/>
</target>
</project>

then I have pasted the base plugin xsl folder to customized plugin the I have changed the xsl named dita2xhtml.xsl

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:import href="dita2html-base.xsl"/>

<xsl:output method="xml" encoding="UTF-8" indent="no"/>

<xsl:variable name="source-chars" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ .'"/>
<xsl:variable name="target-chars" select="'abcdefghijklmnopqrstuvwxyz__'"/>



<xsl:template match="task">
<div class="topic">
<xsl:attribute name="id">
<xsl:value-of select="attribute::id"/>
</xsl:attribute>
<xsl:apply-templates/>
</div>
</xsl:template>



<xsl:template match="task/title">
<h1>Chapter <xsl:number count="task"/>. <xsl:apply-templates/><xsl:text>&#x00A0;</xsl:text><script type="text/javascript" language="JavaScript" src="find5.js"><xsl:text>&#x200B;</xsl:text></script></h1>
</xsl:template>

<xsl:template match="section">
<div class="section" id="{translate(title, $source-chars, $target-chars )}">
<xsl:apply-templates/>
</div>
</xsl:template>


<xsl:template match="taskbody">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="title">

<h2 class="sectiontitle">
<xsl:apply-templates/>
</h2>

</xsl:template>


<xsl:template match="p">
<p>
<xsl:apply-templates/>
</p>    
</xsl:template>

<xsl:template match="steps">
<ol>
<xsl:apply-templates/>
</ol>    
</xsl:template>

<xsl:template match="step">
<li>
<xsl:apply-templates/>
</li>    
</xsl:template>

<xsl:template match="cmd">
<span>
<xsl:apply-templates/>
</span>    
</xsl:template>

<xsl:template match="b">
<strong>
<xsl:apply-templates/>
<xsl:text>&#x200B;</xsl:text>
</strong>    
</xsl:template>

<xsl:template match="menucascade">
<span class="menucascade">
<xsl:apply-templates/>
</span>    
</xsl:template>

<xsl:template match="uicontrol">
<span class="uicontrol">
<xsl:apply-templates/>
</span>    
</xsl:template>

<xsl:template match="filepath">
<span class="filepath">
<xsl:apply-templates/>
</span>    
</xsl:template>

<xsl:template match="xref">
<xsl:apply-templates/> 
</xsl:template>

<xsl:template match="info">
<div>
<xsl:apply-templates/>
</div>    
</xsl:template>

<xsl:template match="i">
<em>
<xsl:apply-templates/>
</em>    
</xsl:template>








<!-- Add both lang and xml:lang attributes -->
<xsl:template match="@xml:lang" name="generate-lang">
<xsl:param name="lang" select="."/>
<xsl:attribute name="xml:lang">
<xsl:value-of select="$lang"/>
</xsl:attribute>
<xsl:attribute name="lang">
<xsl:value-of select="$lang"/>
</xsl:attribute>
</xsl:template>




</xsl:stylesheet>

then changed the xsl named map2htmtocImpl.xsl template named as generate-toc in xslhtml\map2htmtoc folder as like this

template changes only done

<xsl:template name="generate-toc">
<html style="overflow-y:auto"><xsl:value-of select="$newline"/>
<head><xsl:value-of select="$newline"/><title>Configuring Workflow</title><xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:call-template name="generateDefaultCopyright"/>
<xsl:call-template name="generateCharset"/>
<xsl:if test="string-length($contenttarget)>0 and
            $contenttarget!='NONE'">
<base target="{$contenttarget}"/>
<xsl:value-of select="$newline"/>
</xsl:if>
<!-- initial meta information -->
<!-- Set the character set to UTF-8 -->
<!-- Generate a default copyright, if needed -->
<xsl:call-template name="generateDefaultMeta"/> <!-- Standard meta for security, robots, etc -->
<xsl:call-template name="copyright"/>         <!-- Generate copyright, if specified manually -->
<xsl:call-template name="generateCssLinks"/>  <!-- Generate links to CSS files -->
<xsl:call-template name="generateMapTitle"/> <!-- Generate the <title> element -->
<xsl:call-template name="gen-user-head" />    <!-- include user's XSL HEAD processing here -->
<xsl:call-template name="gen-user-scripts" /> <!-- include user's XSL javascripts here -->
<xsl:call-template name="gen-user-styles" />  <!-- include user's XSL style element and content here -->
</head><xsl:value-of select="$newline"/>

<body>
<xsl:if test="string-length($OUTPUTCLASS) &gt; 0">
<xsl:attribute name="class">
<xsl:value-of select="$OUTPUTCLASS"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$newline"/>
<nav><xsl:value-of select="$newline"/>
<div xmlns:glossdata="http://dita4publishers.org/glossdata" xmlns:mapdriven="http://dita4publishers.org/mapdriven" xmlns:enum="http://dita4publishers.org/enumerables" class="dynamic-toc"><xsl:value-of select="$newline"/>
<div id="container" ><xsl:value-of select="$newline"/>
<div id="containerTop"><xsl:value-of select="$newline"/>
<div id="main"><xsl:value-of select="$newline"/>
<div id="content"><xsl:value-of select="$newline"/>
<form name="mainForm" action="javscript:;"><xsl:value-of select="$newline"/>
<div class="newsItem"><xsl:value-of select="$newline"/>
<div id="expandcontractdiv"><xsl:value-of select="$newline"/>
<a href="javascript:tree.expandAll()" class="treetools">Expand all</a><xsl:value-of select="$newline"/>
<a href="javascript:tree.collapseAll()" class="treetools">Collapse all</a><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
<div id="treeDiv1"> </div><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
</form><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
</div><xsl:value-of select="$newline"/>
<xsl:apply-templates/>
</nav><xsl:value-of select="$newline"/>
<iframe class="contentwin" id="contentwin" name="contentwin" src="test.html"> 
</iframe><xsl:value-of select="$newline"/>
<div id="footer" class="footer"></div><xsl:value-of select="$newline"/>
<script xmlns:glossdata="http://dita4publishers.org/glossdata" xmlns:mapdriven="http://dita4publishers.org/mapdriven" xmlns:enum="http://dita4publishers.org/enumerables" type="text/javascript" src="yahoo.js"> </script><xsl:value-of select="$newline"/>
<script xmlns:glossdata="http://dita4publishers.org/glossdata" xmlns:mapdriven="http://dita4publishers.org/mapdriven" xmlns:enum="http://dita4publishers.org/enumerables" type="text/javascript" src="event.js"> </script><xsl:value-of select="$newline"/>
<script xmlns:glossdata="http://dita4publishers.org/glossdata" xmlns:mapdriven="http://dita4publishers.org/mapdriven" xmlns:enum="http://dita4publishers.org/enumerables" type="text/javascript" src="treeview.js"> </script><xsl:value-of select="$newline"/>
</body><xsl:value-of select="$newline"/>
</html>
</xsl:template>

then I have run integrator.xml command ant -f integrator.xml in command prompt after that i have run the transformation named xhtml-custom in oxygen then I am getting the transformation successful but oxygen showing some error as shown below

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[3]/cmd[1]/image[1]

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[6]/info[1]/image[1]

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[7]/stepresult[1]/image[1]

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[9]/info[1]/image[1]

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[8]/info[1]/image[1]

System ID: E:\task\Test.ditamap
Scenario: Test (xhtml-common)
Input file: E:\task\Test.ditamap
Engine name: DITA-OT
Severity: error
Description: Ambiguous rule match for /task/taskbody[1]/steps[1]/step[12]/cmd[1]/image[1]

and the index.html which is created by the transform template changes not applying

Please assist me on this issue

ANSWER

Answered 2017-Feb-22 at 12:03

You seem to have two use cases: 1) Customize the HTML output produced for each topic. 2) Customize the HTML output produced for the index.html table of contents.

By answer will be mostly about (1). Once in your plugin.xml you add this extension:

<feature extension="dita.xsl.xhtml" file="xslhtml/dita2xhtml.xsl"/>

your custom "dita2xhtml.xsl" will be contributed as an XSLT customization stylesheet to all the XHTML-based outputs. So the extension will not be limited to your custom transtype, even the base XHTML output will use your XSLT changes. Your custom "dita2xhtml.xsl" will not be the main XSLT stylesheet in the transformation, but the xsl:templates you write in it will take precedence over the ones in the base XSLT stylesheets. So your custom "dita2xhtml.xsl" should not contain imports to other XSLT stylesheets like "dita2html-base.xsl" which you probably copied from the base XHTML plugin, it should just contain the xsl:templates which override the base processing. Your custom XSLT processing will be applied when DITA topics are converted to equivalent HTML files.

If you also want to influence how the index.html (table of contents) is generated there is another plugin extension called "dita.xsl.htmltoc" which you can declare in the plugin.xml and have it point to another custom XSLT stylesheet which will override templates specified in the base XHTML plugin for the TOC processing.

But as I mentioned both the "dita.xsl.xhtml" and "dita.xsl.htmltoc" extensions will be applied to all XHTML-based outputs, including to the default XHTML output.

If you want your XSLT customizations to apply only for you custom transformation type things get harder, you no longer declare the extensions in the plugin.xml but in your "build_transtype-custom.xml" instead of adding a simple antcall to the main xhtml target:

  <antcall target="dita2xhtml"/>

you would do something like:

<target name="dita2xhtml-custom">
    <echo>custom HTML transform</echo>
    <property name="args.xsl" value="${dita.plugin.com.custom.xhtml.dir}/xslhtml/dita2xhtml.xsl"/>
    <antcall target="dita2xhtml"/>
</target>

After you do that, your custom "dita2xhtml.xsl" will become the main XSLT stylesheet applied when producing the HTML file for each DITA topic. So your custom "dita2xhtml.xsl" will need to have an import to the base XHTML XSLT processing:

 <xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>

Source https://stackoverflow.com/questions/42360542

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

VULNERABILITIES

No vulnerabilities reported

INSTALL dita4publishers

You can use dita4publishers like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the dita4publishers component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

SUPPORT

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

Implement dita4publishers faster with kandi.

  • Use the support, quality, security, license, reuse scores and reviewed functions to confirm the fit for your project.
  • Use the, Q & A, Installation and Support guides to implement faster.

Discover Millions of Libraries and
Pre-built Use Cases on kandi