Making XSL changes and overrides

Previous: Creating the stationery in ePublisher for Confluence wiki

We had no experience with XSL and XSLT, though we had some familiarity with XML. We made the following changes for our documentation to display correctly in Confluence.

Modifying confluence.xsl

When we deployed test content to Confluence, we noticed that punctuation in page titles were displaying as their ASCII codes in the page tree (table of contents) and breadcrumb trail. The titles appeared correctly on the wiki page headings.

To resolve this issue, we modified confluence.xsl in <installation path>\WebWorks\ePublisher\2010.2\Formats\Wiki - Confluence\Transforms. In the XSL file, under Wiki Name Replacements, we replaced ASCII codes for punctuation with HTML number codes; see below. For example, the line <wwmultisere:Entry match="?" replacement="_63;" /> was changed to <wwmultisere:Entry match="?" replacement="?" />. We didn’t bother changing all of the codes--just the ones we use in our FrameMaker Heading1s and Heading2s (which are both set to Page break priority=1).

<\!-\- Wiki Name Replacements \-->
<\!-\-                        \-->
<xsl:variable name="GlobalWikiNameReplacementsAsXML">
<wwmultisere:Entry match=";" replacement="_59" />
<wwmultisere:Entry match="/" replacement="_47" />
<wwmultisere:Entry match="?" replacement="&#63;" />
<wwmultisere:Entry match="@" replacement="_64" />
<wwmultisere:Entry match="&" replacement="&#38;" />
<wwmultisere:Entry match="=" replacement="_61" />
<wwmultisere:Entry match="+" replacement="_43" />
<wwmultisere:Entry match="$" replacement="_36" />
<wwmultisere:Entry match="," replacement="&#44;" />
<wwmultisere:Entry match="#" replacement="_35" />
<wwmultisere:Entry match="<" replacement="_60" />
<wwmultisere:Entry match=">" replacement="_62" />
<wwmultisere:Entry match="%" replacement="&#37;" />
<wwmultisere:Entry match=""" replacement="_34" />
<wwmultisere:Entry match="{{" replacement="_123" />
<wwmultisere:Entry match="}}" replacement="_125" />
<wwmultisere:Entry match="\|" replacement="_124" />
<wwmultisere:Entry match="^" replacement="_94" />
<wwmultisere:Entry match="\[" replacement="_91" />
<wwmultisere:Entry match="\]" replacement="_93" />
<wwmultisere:Entry match="`" replacement="_96" />
</xsl:variable>
<xsl:variable name="GlobalWikiNameReplacements" select="msxsl:node-set($GlobalWikiNameReplacementsAsXML)" />

Overriding the XSL

Although Confluence has four admonition macros (Warning, Note, Info, and Tip), we preferred to create our own user macros for our admonitions. To render the styles for our Warning, Important, and Note macros, we had to perform an XSL override using wwtransform:super. Doing so created a match for the styles that we specified, namely FrameMaker paragraph styles Important, Warning, NumberedNote, CellNote, and Note.

During a Study Hall session, Jesse Wiles uploaded samples of markup needed to do this for Confluence's default Note macro, which we then used to do the same for the other admonition styles. Ben Allums's update allowed hyperlinks to work in the macros. See the sample files here.

We did the following to override the XSL for admonitions:

  1. Created the user macros for our own Warning, Important, and Note styles.
  2. Updated Jesse's XSL with additional styles to be matched, referring to the names of the macros created in step 1.
  3. Updated XSL with parameters from Ben's sample and saved the file.
  4. Placed the content.xsl override in the directory <path>\ePublisher Pro Projects\<project folder>\Formats\<target name>\Transforms. This overrides the base content.xsl, i.e., <path>\ePublisher Stationery\Confluence\Formats\Wiki - Confluence.base\Transforms, for the specified styles. All other paragraph styles match to the base XSL.

Making XSL changes and overrides (last edited 2011-05-13 17:08:08 by IreneYuen)