diff options
Diffstat (limited to 'doc/site.xsl')
-rw-r--r-- | doc/site.xsl | 225 |
1 files changed, 119 insertions, 106 deletions
diff --git a/doc/site.xsl b/doc/site.xsl index 18a0339c..d2b89c0f 100644 --- a/doc/site.xsl +++ b/doc/site.xsl @@ -6,7 +6,7 @@ href_base The most superior documentation directory (e.g. XML/) --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" encoding="ISO-8859-1" indent="yes" + <xsl:output method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> @@ -91,6 +91,7 @@ </xsl:otherwise> </xsl:choose> </xsl:template> + <!-- - The table of content --> @@ -131,6 +132,7 @@ <li><a href="html/index.html" style="font-weight:bold">API Menu</a></li> </ul> </xsl:variable> + <xsl:variable name="api"> <ul> <li><a href="{$href_base}APIchunk0.html">Alphabetic</a></li> @@ -140,6 +142,7 @@ <li><a href="{$href_base}APIsymbols.html">Symbols</a></li> </ul> </xsl:variable> + <xsl:variable name="related"> <ul> <xsl:choose> @@ -161,6 +164,7 @@ <li><a href="http://www.mod-xslt.com/mod-xslt/">Apache module</a></li> </ul> </xsl:variable> + <xsl:template name="develtoc"> <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"> <tr> @@ -211,6 +215,7 @@ </tr> </table> </xsl:template> + <xsl:template mode="head" match="title"> <title> <xsl:apply-templates/> @@ -218,6 +223,7 @@ </xsl:template> <xsl:template mode="head" match="meta"> </xsl:template> + <!-- - The global title --> @@ -233,48 +239,50 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -</style> + </style> </xsl:template> + <!-- - Write the title box on top --> <xsl:template name="titlebox"> <xsl:param name="title" select="'Main Page'"/> <table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"> - <tr> - <td width="120"> - <a href="http://swpat.ffii.org/"><img src="{$logo_base}epatents.png" alt="Action against software patents"/></a> - </td> - <td width="100"> - <a href="http://www.gnome.org/"><img src="{$logo_base}gnome2.png" alt="Gnome2 Logo"/></a> - <a href="http://www.redhat.com"><img src="{$logo_base}redhat.gif" alt="Red Hat Logo"/></a> - <div align="left"> - <a href="http://xmlsoft.org/XSLT/"><img src="{$logo_base}Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo"/></a> - </div> - </td> - <td> - <table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"> <tr> + <td width="120"> + <a href="http://swpat.ffii.org/"><img src="{$logo_base}epatents.png" alt="Action against software patents"/></a> + </td> + <td width="100"> + <a href="http://www.gnome.org/"><img src="{$logo_base}gnome2.png" alt="Gnome2 Logo"/></a> + <a href="http://www.redhat.com"><img src="{$logo_base}redhat.gif" alt="Red Hat Logo"/></a> + <div align="left"> + <a href="http://xmlsoft.org/XSLT/"><img src="{$logo_base}Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo"/></a> + </div> + </td> <td> - <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"> + <table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"> <tr> - <td align="center"> - <xsl:element name="h1"> - <xsl:value-of select="$globaltitle"/> - </xsl:element> - <xsl:element name="h2"> - <xsl:value-of select="$title"/> - </xsl:element> + <td> + <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"> + <tr> + <td align="center"> + <xsl:element name="h1"> + <xsl:value-of select="$globaltitle"/> + </xsl:element> + <xsl:element name="h2"> + <xsl:value-of select="$title"/> + </xsl:element> + </td> + </tr> + </table> </td> </tr> </table> </td> </tr> </table> - </td> - </tr> - </table> </xsl:template> + <!-- - Handling of nodes in the body before the first H2, table of content - Everything is just copied over, except href which may get rewritten @@ -293,6 +301,7 @@ A:link, A:visited, A:active { text-decoration: underline } <xsl:apply-templates mode="subcontent" select="node()"/> </xsl:copy> </xsl:template> + <xsl:template mode="subcontent" match="@*|node()"> <xsl:copy> <xsl:apply-templates mode="subcontent" select="@*|node()"/> @@ -305,6 +314,7 @@ A:link, A:visited, A:active { text-decoration: underline } </xsl:copy> </xsl:if> </xsl:template> + <!-- - Handling of nodes in the body after an H2 - Open a new file and dump all the siblings up to the next H2 @@ -319,20 +329,92 @@ A:link, A:visited, A:active { text-decoration: underline } <xsl:variable name="title"> <xsl:value-of select="$header"/> </xsl:variable> - <xsl:document href="{$dirname}{$filename}" method="xml" encoding="ISO-8859-1" - doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" - doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <xsl:variable name="content"> + <xsl:apply-templates mode="subfile" select= + "$header/following-sibling::*[preceding-sibling::h2[1] = $header and name() != 'h2' and position() != last()]"/> + </xsl:variable> + <xsl:call-template name="new_page"> + <xsl:with-param name="filename" select="concat($dirname, $filename)"/> + <xsl:with-param name="title" select="$title"/> + <xsl:with-param name="target" select="$content"/> + </xsl:call-template> + </xsl:template> + + <xsl:template mode="subfile" match="@*|node()"> + <xsl:copy> + <xsl:apply-templates mode="content" select="@*|node()"/> + </xsl:copy> + </xsl:template> + +<!-- + - Handling of the initial body and head HTML document + --> + <xsl:template match="body"> + <xsl:variable name="firsth2" select="./h2[1]"/> + <xsl:variable name="rest2" select="./h2[position()>1]"/> + <xsl:variable name="content"> + <xsl:apply-templates mode="content" select="($firsth2/preceding-sibling::*)"/> + <xsl:for-each select="./h2"> + <xsl:call-template name="subfile"> + <xsl:with-param name="header" select="."/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:call-template name="generic_page"> + <xsl:with-param name="title" select="$libname"/> + <xsl:with-param name="target" select="$content"/> + </xsl:call-template> + + </xsl:template> + + <xsl:template match="head"> + <!-- + The output <head> node is created during initial processing + --> + </xsl:template> + + <xsl:template match="html"> + <!-- + The output <html> node is created during initial processing + --> + <xsl:apply-templates/> + </xsl:template> + +<!-- + new_page creates a new output document using the parameter "filename", then calls upon + the template generic_page to do the actual page generation. +--> + <xsl:template name="new_page"> + <xsl:param name="filename"/> <!-- Output filename --> + <xsl:param name="title"/> <!-- Page title --> + <xsl:param name="target"/> <!-- The nodes (RTF) to be copied into document --> + <xsl:document href="{$filename}" method="xml" encoding="ISO-8859-1" + doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <xsl:call-template name="generic_page"> + <xsl:with-param name="title" select="$title"/> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:document> + </xsl:template> + +<!-- + generic_page produces the "standard" page used by all the different doc files. +--> + <xsl:template name="generic_page"> + <xsl:param name="title"/> + <xsl:param name="target"/> <!-- The nodes (RTF) that make up the main page content --> <html> <head> - <xsl:call-template name="style"/> - <xsl:element name="title"> - <xsl:value-of select="$title"/> - </xsl:element> + <xsl:call-template name="style"/> + <xsl:element name="title"> + <xsl:value-of select="$title"/> + </xsl:element> </head> <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"> <xsl:call-template name="titlebox"> - <xsl:with-param name="title" select="$title"/> - </xsl:call-template> + <xsl:with-param name="title" select="$title"/> + </xsl:call-template> <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"> <tr> <td bgcolor="#8b7765"> @@ -351,8 +433,8 @@ A:link, A:visited, A:active { text-decoration: underline } <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr> <td bgcolor="#fffacd"> - <xsl:apply-templates mode="subfile" select="$header/following-sibling::*[preceding-sibling::h2[1] = $header and name() != 'h2' and position() != last()]"/> - <p><a href="bugs.html">Daniel Veillard</a></p> + <xsl:copy-of select="$target"/> + <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p> </td> </tr> </table> @@ -370,74 +452,5 @@ A:link, A:visited, A:active { text-decoration: underline } </table> </body> </html> - </xsl:document> - </xsl:template> - <xsl:template mode="subfile" match="@*|node()"> - <xsl:copy> - <xsl:apply-templates mode="content" select="@*|node()"/> - </xsl:copy> - </xsl:template> -<!-- - - Handling of the initial body and head HTML document - --> - <xsl:template match="body"> - <xsl:variable name="firsth2" select="./h2[1]"/> - <xsl:variable name="rest2" select="./h2[position()>1]"/> - <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"> - <xsl:call-template name="titlebox"> - <xsl:with-param name="title" select="$libname"/> - </xsl:call-template> - <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"> - <tr> - <td bgcolor="#8b7765"> - <table border="0" cellspacing="0" cellpadding="2" width="100%"> - <tr> - <td valign="top" width="200" bgcolor="#8b7765"> - <xsl:call-template name="develtoc"/> - </td> - <td valign="top" bgcolor="#8b7765"> - <table border="0" cellspacing="0" cellpadding="1" width="100%"> - <tr> - <td> - <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"> - <tr> - <td> - <table border="0" cellpadding="3" cellspacing="1" width="100%"> - <tr> - <td bgcolor="#fffacd"> - <xsl:apply-templates mode="content" select="($firsth2/preceding-sibling::*)"/> - <xsl:for-each select="./h2"> - <xsl:call-template name="subfile"> - <xsl:with-param name="header" select="."/> - </xsl:call-template> - </xsl:for-each> - <p><a href="bugs.html">Daniel Veillard</a></p> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - </body> - </xsl:template> - <xsl:template match="head"> - <head> - <xsl:call-template name="style"/> - <xsl:apply-templates mode="head"/> - </head> - </xsl:template> - <xsl:template match="html"> - <html> - <xsl:apply-templates/> - </html> </xsl:template> </xsl:stylesheet> |