Content insertions
Content insertions are sections in TemplateSpecification.xml that affect the behavior of Authoring Bridge.
To insert a conref or a variable, the user selects a node from a source (typically a library) that needs to be inserted in the current (target) document. The content of the source cannot be directly copied into the target but must be transformed. For example extra attributes must be added, some elements and attributes must be removed, text must be placed in processing instructions, DITA specialization must be generalized... To make this all configurable for any DTD, an XSL is included that is applied to the source content selection. The result of this XSL will be inserted into the target document.
For Example:
<contentinsertion type="variable">
<applyxsl>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- xsl parameters set by the authoring bridge -->
<xsl:param name="selectedLogicalId" />
<xsl:param name="selectedTargetId" />
<xsl:param name="selectedVersion" />
<xsl:param name="selectedLanguage" />
<xsl:param name="insertableElements" />
<!-- xsl starting template excuted on the selected node in the source content -->
<xsl:template match="/*">
<xsl:copy>
<!-- add varref attribute -->
<xsl:attribute name="varref">
<xsl:value-of select="$selectedTargetId" />
</xsl:attribute>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<!-- xsl template to remove varid and all default attributes -->
<xsl:template match="@id | @cid | @varid | @varref | @class" />
<!-- xsl template to copy all other content -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</applyxsl>
</contentinsertion>