Skip to content

In a DITA-OT preprocessing plugin, how can I tell what transformation type is being run? #4443

Closed Answered by chrispy-snps
chrispy-snps asked this question in Q&A
Discussion options

You must be logged in to vote

One way would be to extend an existing transformation type, then add additional custom tasks to the preprocessing pipeline. I don't have an example for this, as I've never done it.

Another way is to import the TRANSTYPE Ant property into an existing XSLT preprocessing stage, then reference it like this:

  <!-- this is applied only in 'html5' transformations -->
  <xsl:template match="/your/xpath/here[$TRANSTYPE = 'html5']">
    <!-- your processing here -->
  </xsl:template>

You can import the property as an XSLT parameter using one of the dita.preprocess.*.param extension points. Here is a sample plugin showing how to do this:

com.synopsys.show-transtype.zip

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chrispy-snps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant