Date: Sun, 15 Jul 2012 10:41:06 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-projects@freebsd.org Subject: svn commit: r39210 - projects/sgml2xml/share/sgml Message-ID: <201207151041.q6FAf6B4042134@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Sun Jul 15 10:41:05 2012 New Revision: 39210 URL: http://svn.freebsd.org/changeset/doc/39210 Log: - Add an XSLT stylesheet that will be used to transform individual files to full pages with usual headers and footers Approved by: doceng (implicit) Added: projects/sgml2xml/share/sgml/xhtml.xsl (contents, props changed) Added: projects/sgml2xml/share/sgml/xhtml.xsl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/sgml2xml/share/sgml/xhtml.xsl Sun Jul 15 10:41:05 2012 (r39210) @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN" +"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd"> +<!-- $FreeBSD$ --> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:cvs="http://www.FreeBSD.org/XML/CVS" + xmlns:xhtml="http://www.w3.org/1999/xhtml"> + + <xsl:variable name="date"> + <xsl:value-of select="//cvs:keyword[@name='freebsd']"/> + </xsl:variable> + + <xsl:variable name="title"> + <xsl:value-of select="/xhtml:html/xhtml:head/xhtml:title"/> + </xsl:variable> + + <xsl:output type="xml" encoding="&xml.encoding;" + indent="yes" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" /> + + <xsl:template match="/"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title><xsl:value-of select="$title" /></title> + <meta http-equiv="Content-Type" content="text/html; charset=&xml.encoding;" /> + <meta name="MSSmartTagsPreventParsing" content="TRUE" /> + <xsl:copy-of select="/xhtml:html/xhtml:head/xhtml:meta"/> + <link rel="shortcut icon" href="&enbase;/favicon.ico" type="image/x-icon" /> + <link rel="icon" href="&enbase;/favicon.ico" type="image/x-icon" /> +<!-- +FOR TRANSLATORS: + +Do not translate the "Normal Text" and "Large Text" attributes in the +following two lines. They are not literal texts but JavaScript +parameters. Changing them will result in rendering errors. +--> + <link rel="stylesheet" media="screen" href="&stylesheet;" type="text/css" title="Normal Text" /> + <link rel="alternate stylesheet" media="screen" href="&stylesheetlarge;" type="text/css" title="Large Text" /> + &header1.rsslink; + <script type="text/javascript" src="&enbase;/layout/js/styleswitcher.js"></script> + &header1.googlejs; + </head> + + <body> + <div id="CONTAINERWRAP"> + <div id="CONTAINER"> + &header2.skipnav; + + <div id="HEADERCONTAINER"> + <div id="HEADER"> + + &header2.logo-red.label; + + <div id="HEADERLOGOLEFT"> + &header2.logo-red; + </div> <!-- HEADERLOGOLEFT --> + + <div id="HEADERLOGORIGHT"> + &header2.searchnav.label; + + &header2.searchnav; + + <div id="SEARCH"> + <form action="&cgibase;/search.cgi" method="get"> + <div> + <h2 class="blockhide"><label for="WORDS">&header2.word.search;</label></h2> + + &header2.searchinputs; + </div> + </form> + </div> <!-- SEARCH --> + </div> <!-- HEADERLOGORIGHT --> + </div> <!-- HEADER --> + + &header2.topnav.label; + + &header2.topnav; + + </div> <!-- HEADERCONTAINER --> + + <div id="CONTENT"> + <div id="SIDEWRAP"> + <xsl:choose xmlns:xhtml="http://www.w3.org/1999/xhtml"> + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.about'"> + &nav.about; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.community'"> + &nav.community; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.developers'"> + &nav.developers; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.docs'"> + &nav.docs; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.download'"> + &nav.download; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.gnome'"> + &nav.gnome; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.ports'"> + &nav.ports; + </xsl:when> + + <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.support'"> + &nav.support; + </xsl:when> + </xsl:choose> + </div> <!-- SIDEWRAP --> + + <div id="CONTENTWRAP"> + <xsl:call-template name="process.content"/> + </div> <!-- CONTENTWRAP --> + + <br class="clearboth" /> + </div> <!-- CONTENT --> + + <div id="FOOTER"> + ©right;<br/> + &lastmod; <xsl:value-of select="$date"/> + </div> <!-- FOOTER --> + </div> <!-- CONTAINER --> + </div> <!-- CONTAINERWRAP --> + </body> + </html> + </xsl:template> + + <xsl:template name="process.content"> + <h1><xsl:value-of select="$title" /></h1> + + <xsl:copy-of xmlns:xhtml="http://www.w3.org/1999/xhtml" select="xhtml:html/xhtml:body/*" /> + </xsl:template> +</xsl:stylesheet>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207151041.q6FAf6B4042134>