Page 1 of 1

Migrating from Flare to DITA

Posted: Tue May 29, 2018 7:05 pm
by smarvin
Hi, I've been testing the XHTML to DITA concept transform scenario to migrate Flare topics to DITA. It works well except for the MadCap variables, conditions, and snippets. The end result that the information is stripped-out and replaced with "<required-cleanup remap="variable">".

Apparently, I'm not smart enough to figure out how to edit my copy of the transform scenario so that I can keep the MadCap information in the generated page. Ideally, I'd like to create a <ph> element for each variable, snippet, or condition, with paths to the file that contains the DITA-specific information. For example, I want to take the original

<MadCap:variable name="Product.ProductName" />

and generate something like:

<ph conref="../../../project/variablesets/product.dita#productnames/product"/>

Is there a way to create a template for this?

Re: Migrating from Flare to DITA

Posted: Wed May 30, 2018 7:57 am
by Radu
Hi,

From what I heard MadCap also has a DITA export facility but I'm not sure in what version they added it. This might be better than migrating from HTML to DITA.
I'm assuming you are using Oxygen version 20.
Coming back to the "XHTML to DITA Concept" transformation scenario, it is based on this XSLT stylesheet:

OXYGEN_INSTALL_DIR\frameworks\xhtml\html2dita\h2d.xsl

Maybe you can add inside the stylesheet another xsl:template like:

Code: Select all

  <xsl:template match="MadCap:variable" xmlns:MadCap="INSERT_MADCAP_NAMESPACE_HERE">
<ph keyref="{@name}"/>
</xsl:template>
which would create a ph with keyref for each Madcap variable. You would need to find out to what namespace the "MadCap" prefix maps to in the original XHTML document.
Then you would have a DITA Map in which you would define the keys and map them to content:

Code: Select all

  <keydef keys="Product.ProductName">
<topicmeta>
<keywords>
<keyword>My product name</keyword>
</keywords>
</topicmeta>
</keydef>
Regards,
Radu