csharpfftfsharpintegrationinterpolationlinear-algebramathdifferentiationmatrixnumericsrandomregressionstatisticsmathnet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.7 KiB
79 lines
2.7 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!-- Doc Studio Contents to HTML Help Compiler Contents Transform
|
|
|
|
Invoke with: xsltransform TocToChmContents.xsl toc.xml [/arg:html=html-dir] /out:output.hhc
|
|
|
|
- comments - specifies the directory where the HTML files are stored.
|
|
|
|
NOTE: The output looks like HTML, but it isn't. Whitespace is significant.
|
|
-->
|
|
|
|
<xsl:stylesheet version="1.0"
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
|
|
xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5">
|
|
|
|
<msxsl:script language="C#" implements-prefix="ddue">
|
|
<msxsl:using namespace="System.Xml" />
|
|
<msxsl:using namespace="System.Xml.XPath" />
|
|
<![CDATA[
|
|
public static string getTitle(string fileName) {
|
|
XPathDocument doc = new XPathDocument(fileName);
|
|
XPathNavigator node = doc.CreateNavigator().SelectSingleNode("/html/head/title");
|
|
if (node != null)
|
|
return node.Value;
|
|
else
|
|
return String.Empty;
|
|
}
|
|
]]>
|
|
</msxsl:script>
|
|
|
|
|
|
<xsl:param name="html" select="string('Output/html')"/>
|
|
|
|
<xsl:output method="text" encoding="utf-8"/>
|
|
|
|
<xsl:template match="/">
|
|
<xsl:text><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/EN">
</xsl:text>
|
|
<xsl:text><HTML>
</xsl:text>
|
|
<xsl:text> <BODY>
</xsl:text>
|
|
<xsl:apply-templates select="topics"/>
|
|
<xsl:text> </BODY>
</xsl:text>
|
|
<xsl:text></HTML>
</xsl:text>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="topics">
|
|
<xsl:call-template name="parentNode"/>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="parentNode">
|
|
<xsl:if test="topic">
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text><UL>
</xsl:text>
|
|
<xsl:apply-templates select="topic"/>
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text></UL>
</xsl:text>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="topic">
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text><![CDATA[<LI><OBJECT type="text/sitemap">]]>
</xsl:text>
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text> <param name="Name" value="</xsl:text>
|
|
<xsl:value-of select="ddue:getTitle(concat($html,'/', @file, '.htm'))"/>
|
|
<xsl:text>">
</xsl:text>
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text> <param name="Local" value="html\</xsl:text>
|
|
<xsl:value-of select="@file"/>
|
|
<xsl:text>.htm">
</xsl:text>
|
|
<xsl:call-template name="indent"/>
|
|
<xsl:text><![CDATA[</OBJECT></LI>]]>
</xsl:text>
|
|
|
|
<xsl:call-template name="parentNode"/>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="indent"><xsl:for-each select="ancestor::*"><xsl:text>  </xsl:text></xsl:for-each></xsl:template>
|
|
|
|
</xsl:stylesheet>
|
|
|