diff options
author | buraq <buraq@epfl.ch> | 2003-10-29 09:18:45 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-29 09:18:45 +0000 |
commit | f6dab0da8d27f605677fe295a57ffa8a4f410b63 (patch) | |
tree | 820e4ab5307ffc39c103aa5c099d5b9cb5508e9c /doc/faq | |
parent | b960d0b0e58b06d26d17e94d807e2de1b80ceccf (diff) | |
download | scala-f6dab0da8d27f605677fe295a57ffa8a4f410b63.tar.gz scala-f6dab0da8d27f605677fe295a57ffa8a4f410b63.tar.bz2 scala-f6dab0da8d27f605677fe295a57ffa8a4f410b63.zip |
initial
Diffstat (limited to 'doc/faq')
-rw-r--r-- | doc/faq/.cvsignore | 1 | ||||
-rw-r--r-- | doc/faq/Makefile | 2 | ||||
-rw-r--r-- | doc/faq/faq.xml | 24 | ||||
-rw-r--r-- | doc/faq/scala-faq.dtd | 32 | ||||
-rw-r--r-- | doc/faq/scala-faq.xhtml.xsl | 101 | ||||
-rw-r--r-- | doc/faq/xhtml.templates.xsl | 19 |
6 files changed, 179 insertions, 0 deletions
diff --git a/doc/faq/.cvsignore b/doc/faq/.cvsignore new file mode 100644 index 0000000000..84ce3a06c6 --- /dev/null +++ b/doc/faq/.cvsignore @@ -0,0 +1 @@ +faq.html diff --git a/doc/faq/Makefile b/doc/faq/Makefile new file mode 100644 index 0000000000..9c35547a92 --- /dev/null +++ b/doc/faq/Makefile @@ -0,0 +1,2 @@ +faq.html: faq.xml + xsltproc -o $@ $^ diff --git a/doc/faq/faq.xml b/doc/faq/faq.xml new file mode 100644 index 0000000000..65f5f6bfeb --- /dev/null +++ b/doc/faq/faq.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml-stylesheet type="text/xsl" href="scala-faq.xhtml.xsl"?> +<!DOCTYPE faq PUBLIC "-//lamp.epfl.ch//DTD Scala FAQ//EN" + "scala-faq.dtd"> + +<faq> + + <section title="General"> + <entry id="why"> + <question>Why another programming language </question> + <answer>Read the rational on the <a + href="http://scala.epfl.ch">Scala homepage</a></answer> + </entry> + </section> + + <section title="Less General"> + <entry> + <question>Why is feature XYZ not integrated</question> + <answer>Convince us that it is useful. Make sure you read + <seealso ref="why"/> before </answer> + </entry> + </section> + +</faq>
\ No newline at end of file diff --git a/doc/faq/scala-faq.dtd b/doc/faq/scala-faq.dtd new file mode 100644 index 0000000000..1604489d4d --- /dev/null +++ b/doc/faq/scala-faq.dtd @@ -0,0 +1,32 @@ +<!ELEMENT faq (section)+> + +<!ELEMENT section (entry)+> +<!ATTLIST section + title CDATA #REQUIRED> + +<!ELEMENT entry (question,answer)> +<!ATTLIST entry + id ID #IMPLIED> + +<!ELEMENT question (#PCDATA)> +<!ELEMENT answer (#PCDATA|a|code|p|seealso|ul)*> + +<!ELEMENT code (#PCDATA)> + +<!ELEMENT seealso EMPTY> +<!ATTLIST seealso + ref IDREF #REQUIRED> + +<!-- xhtml tags --> + +<!ELEMENT a (#PCDATA)> +<!ATTLIST a + href CDATA #REQUIRED> + +<!ELEMENT em (#PCDATA)> + +<!ELEMENT p (#PCDATA|a|em|ul)*> + +<!ELEMENT ul (li+)> +<!ELEMENT li (#PCDATA|a|em)*> + diff --git a/doc/faq/scala-faq.xhtml.xsl b/doc/faq/scala-faq.xhtml.xsl new file mode 100644 index 0000000000..94620fba8e --- /dev/null +++ b/doc/faq/scala-faq.xhtml.xsl @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + <xsl:include href="xhtml.templates.xsl"/> + <xsl:output method="html"/> + + <xsl:template match="/"> + <html> + <body bgcolor="#FFFFFF"> + <xsl:apply-templates/> + </body> + </html> + + </xsl:template> + + <xsl:template match="faq"> + <table> + <tr><th>Table of Contents</th></tr> + <xsl:for-each select="./section"> + <tr> + <td> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="generate-id(.)"/> + </xsl:attribute> + <xsl:number/>. <xsl:value-of select="@title"/> + + </a> + </td> + </tr> + <xsl:for-each select="./entry"> + <tr> + <td> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="entry.getId"/> + </xsl:attribute> + <xsl:call-template name="entry.fullName"/> + </a> + </td> + </tr> + </xsl:for-each> + </xsl:for-each> + </table> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="section"> + <p/><p/> + <xsl:param name="id"/> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="generate-id()"/> + </xsl:attribute> + <xsl:number/>. <xsl:value-of select="@title"/> + </a> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="entry"> + <p> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="entry.getId"/> + </xsl:attribute> + <xsl:call-template name="entry.fullName"/> + </a> + <br/> + <xsl:apply-templates select="./answer"/> + </p> + </xsl:template> + + <xsl:template match="seealso"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#',@ref)"/> + </xsl:attribute> + <xsl:for-each select="id(@ref)"> + <xsl:call-template name="entry.fullName"/> + </xsl:for-each> + </a> + </xsl:template> + + <xsl:template name="entry.fullName"> + <xsl:number level="multiple" count="section|entry"/>. + <xsl:value-of select="./question"/> + </xsl:template> + + <xsl:template name="entry.getId"> + <xsl:choose> + <xsl:when test="string(@id)"> + <xsl:value-of select="@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="generate-id()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + +</xsl:stylesheet> diff --git a/doc/faq/xhtml.templates.xsl b/doc/faq/xhtml.templates.xsl new file mode 100644 index 0000000000..10ae56f7d8 --- /dev/null +++ b/doc/faq/xhtml.templates.xsl @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template match="a"> + <a><xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute><xsl:value-of select="."/></a></xsl:template> + + <xsl:template match="em"><em><xsl:value-of select="."/></em></xsl:template> + + <xsl:template match="p"><p><xsl:apply-templates/></p></xsl:template> + + <xsl:template match="ul"><ul><xsl:apply-templates/></ul></xsl:template> + + <xsl:template match="li"><li><xsl:apply-templates/></li></xsl:template> + +</xsl:stylesheet>
\ No newline at end of file |