Commit 2952abbf authored by Davis King's avatar Davis King

Setup the XSLT for a FAQ page

parent e0f98d92
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
<doc>
<title>Frequently Asked Questions</title>
<!-- ************************************************************************* -->
<questions>
<question text="Which machine learning method should I use?">
answer goes here
</question>
<question text="another question?">
<questions>
<question text="yet another question?">
<questions>
<question text="what is 1 + 1?">
2!
</question>
<question text="what is 1 + 6?">
7!
</question>
</questions>
</question>
<question text="yet yet YET another question?">
yet another answer goes here
</question>
</questions>
</question>
</questions>
<!-- ************************************************************************* -->
</doc>
...@@ -104,6 +104,10 @@ ...@@ -104,6 +104,10 @@
<name>How to contribute</name> <name>How to contribute</name>
<link>howto_contribute.html</link> <link>howto_contribute.html</link>
</item> </item>
<item>
<name>FAQ</name>
<link>faq.html</link>
</item>
<item> <item>
<name>Index</name> <name>Index</name>
<link>term_index.html</link> <link>term_index.html</link>
......
...@@ -179,6 +179,15 @@ ...@@ -179,6 +179,15 @@
padding: 0.7em; padding: 0.7em;
} }
div#question {
background-color:white;
border: 2px solid rgb(102,102,102);
text-align:left;
margin-top: 1.5em;
margin-bottom: 90%;
padding: 0.7em;
}
div#function { div#function {
background-color:white; background-color:white;
border: 2px solid rgb(102,102,255); border: 2px solid rgb(102,102,255);
...@@ -270,6 +279,14 @@ ...@@ -270,6 +279,14 @@
<center><h1> <xsl:value-of select="title" /> </h1></center> <center><h1> <xsl:value-of select="title" /> </h1></center>
</xsl:if> </xsl:if>
<xsl:apply-templates select="body"/> <xsl:apply-templates select="body"/>
<ul>
<xsl:for-each select="questions/question">
<xsl:sort select="translate(name,$lcletters, $ucletters)"/>
<li><a href="#{@text}"><xsl:value-of select="@text"/></a></li>
</xsl:for-each>
</ul>
</td> </td>
<!-- ************************************************************************* --> <!-- ************************************************************************* -->
<xsl:choose> <xsl:choose>
...@@ -290,6 +307,12 @@ ...@@ -290,6 +307,12 @@
</table> </table>
<xsl:apply-templates select="components"/> <xsl:apply-templates select="components"/>
<xsl:apply-templates select="questions"/>
<xsl:apply-templates select="questions/question/questions"/>
<xsl:apply-templates select="questions/question/questions/question/questions"/>
<xsl:apply-templates select="questions/question/questions/question/questions/question/questions"/>
<xsl:apply-templates select="questions/question/questions/question/questions/question/questions/question/questions"/>
<xsl:apply-templates select="questions/question/questions/question/questions/question/questions/question/questions/question/questions"/>
</div> </div>
</body> </body>
...@@ -430,6 +453,39 @@ ...@@ -430,6 +453,39 @@
</ul> </ul>
</xsl:template> </xsl:template>
<!-- ************************************************************************* -->
<xsl:template match="questions">
<xsl:for-each select="question">
<xsl:sort select="translate(name,$lcletters, $ucletters)"/>
<xsl:variable name="checked" select="@checked"/>
<a name = "{@text}">
<div id="question">
<a href="#top"><font size='2'><center>[top]</center></font></a>
<h2><xsl:value-of select="@text"/></h2>
<xsl:for-each select=".">
<xsl:if test="questions">
<ul>
<xsl:for-each select="questions/question">
<xsl:sort select="translate(name,$lcletters, $ucletters)"/>
<li><a href="#{@text}"><xsl:value-of select="@text"/></a></li>
</xsl:for-each>
</ul>
</xsl:if>
<xsl:if test="not(questions)">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</div>
</a>
</xsl:for-each>
</xsl:template>
<!-- ************************************************************************* --> <!-- ************************************************************************* -->
<xsl:template match="components"> <xsl:template match="components">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment