summaryrefslogtreecommitdiffstats
path: root/tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl')
-rw-r--r--tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl b/tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl
new file mode 100644
index 0000000..44a4484
--- /dev/null
+++ b/tools/Sandcastle/ProductionTransforms/TocToHxsContents.xsl
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+
+ <xsl:output indent="yes" encoding="UTF-8" doctype-system="MS-Help://Hx/Resources/HelpTOC.dtd" />
+
+ <xsl:param name="segregated" />
+ <xsl:param name="includeIds" />
+
+ <xsl:template match="/">
+ <HelpTOC DTDVersion="1.0">
+ <xsl:apply-templates select="/topics" />
+ </HelpTOC>
+ </xsl:template>
+
+ <xsl:template match="topic">
+ <HelpTOCNode>
+ <xsl:if test="boolean($includeIds)">
+ <xsl:attribute name="Id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@file">
+ <xsl:attribute name="Url">
+ <xsl:choose>
+ <xsl:when test="boolean($segregated)">
+ <xsl:value-of select="concat('ms-help:/../',@project,'/html/',@file,'.htm')" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('html\',@file,'.htm')" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="Title">
+ <xsl:value-of select="@id" />
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates />
+ </HelpTOCNode>
+ </xsl:template>
+
+ <xsl:template match="stoc">
+ <HelpTOCNode NodeType="TOC" Url="{@project}" />
+ </xsl:template>
+
+ <xsl:template match="stopic">
+ <HelpTOCNode Url="ms-help:/../{@project}/html/{@file}.htm" Id="{@id}">
+ <xsl:apply-templates />
+ </HelpTOCNode>
+ </xsl:template>
+</xsl:stylesheet>