Changing characters in the output file names
The following Wiki article describes the general process for overriding 'names.xsl' in order to customize the output (HTML) file naming convention of ePublisher:
One user asked how to reproduce the Publisher 2003 option to convert white spaces in the file names to underscores, as well as to replace the periods added by ePublisher into underscores. While this kind of customization generally falls beyond the scope of basic technical support, here are the details for the procedure:
Once you have copied names.xsl into the appropriate directory in your project folder, open it in an XML- or text-editing application. Locate the SplitPath template. In that function, we follow this general process:
- Store the directory path for this particular output file.
- Build the base file name.
- If there is a filename marker, use that
- If not, use the source file's file name (sans extension).
- If there is more than one split from this document, add a series of periods and numbers representing the position of the split in the project/document.
- Combine the base file name with the output file extension.
- Return the full file name combined with the output directory for this file.
So, to replace the periods with underscores, just change the periods in the appropriate lines (<xsl:text>.</xsl:text>) to underscores (<xsl:text>_</xsl:text>).
To change spaces to underscores, you'll want to modify the base file name variable before it is combined with the extension. So, change this operation:
<xsl:variable name="VarName"> <xsl:value-of select="$VarBaseFileName" /> <xsl:value-of select="$VarExtension" /> </xsl:variable>
<xsl:variable name="VarName"> <xsl:value-of select="translate($VarBaseFileName,' ','_')" /> <xsl:value-of select="$VarExtension" /> </xsl:variable>
Then, save names.xsl and regenerate your output to apply the changes.