Modified: forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl Mon Apr 9 18:43:14 2007 @@ -27,56 +27,51 @@ filename-noext: return the file part of a path without its last extension --> - <!-- Returns the directory part of a path. Equivalent to Unix 'dirname'. Examples: '' -> '' 'foo/index.html' -> 'foo/' --> -<xsl:template name="dirname"> - <xsl:param name="path" /> - <xsl:if test="contains($path, '/')"> - <xsl:value-of select="concat(substring-before($path, '/'), '/')" /> - <xsl:call-template name="dirname"> - <xsl:with-param name="path" - select="substring-after($path, '/')" /> - </xsl:call-template> - </xsl:if> -</xsl:template> - -<!-- Normalized (..'s eliminated) version of 'dirname' --> -<xsl:template name="dirname-nz"> - <xsl:param name="path" /> - <xsl:call-template name="normalize"> - <xsl:with-param name="path"> + <xsl:template name="dirname"> + <xsl:param name="path" /> + <xsl:if test="contains($path, '/')"> + <xsl:value-of select="concat(substring-before($path, '/'), '/')" /> <xsl:call-template name="dirname"> - <xsl:with-param name="path" select="$path" /> + <xsl:with-param name="path" + select="substring-after($path, '/')" /> </xsl:call-template> - </xsl:with-param> - </xsl:call-template> -</xsl:template> - - + </xsl:if> + </xsl:template> +<!-- Normalized (..'s eliminated) version of 'dirname' --> + <xsl:template name="dirname-nz"> + <xsl:param name="path" /> + <xsl:call-template name="normalize"> + <xsl:with-param name="path"> + <xsl:call-template name="dirname"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </xsl:template> <!-- Returns the filename part of a path. Equivalent to Unix 'basename' Examples: 'index.html' -> 'index.html' 'foo/bar/' -> '' 'foo/bar/index.html' -> 'index.html' --> -<xsl:template name="filename"> - <xsl:param name="path"/> - <xsl:choose> - <xsl:when test="contains($path, '/')"> - <xsl:call-template name="filename"> - <xsl:with-param name="path" select="substring-after($path, '/')"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$path"/> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - + <xsl:template name="filename"> + <xsl:param name="path"/> + <xsl:choose> + <xsl:when test="contains($path, '/')"> + <xsl:call-template name="filename"> + <xsl:with-param name="path" select="substring-after($path, '/')"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$path"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- Returns the last extension of a filename in a path. Examples: 'index.html' -> '.html' @@ -85,124 +80,115 @@ 'foo/bar/index.html' -> '.html' 'foo/bar/index' -> '' --> -<xsl:template name="ext"> - <xsl:param name="path"/> - <xsl:param name="subflag"/> <!-- Outermost call? --> - <xsl:choose> - <xsl:when test="contains($path, '.')"> - <xsl:call-template name="ext"> - <xsl:with-param name="path" select="substring-after($path, '.')"/> - <xsl:with-param name="subflag" select="'sub'"/> - </xsl:call-template> - </xsl:when> - <!-- Handle extension-less filenames by returning '' --> - <xsl:when test="not($subflag) and not(contains($path, '.'))"> - <xsl:text/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat('.', $path)"/> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - + <xsl:template name="ext"> + <xsl:param name="path"/> + <xsl:param name="subflag"/> +<!-- Outermost call? --> + <xsl:choose> + <xsl:when test="contains($path, '.')"> + <xsl:call-template name="ext"> + <xsl:with-param name="path" select="substring-after($path, '.')"/> + <xsl:with-param name="subflag" select="'sub'"/> + </xsl:call-template> + </xsl:when> +<!-- Handle extension-less filenames by returning '' --> + <xsl:when test="not($subflag) and not(contains($path, '.'))"> +<xsl:text/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('.', $path)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- Returns a filename of a path stripped of its last extension. Examples: 'foo/bar/index.dtdx.html' -> 'index.dtdx' --> -<xsl:template name="filename-noext"> - <xsl:param name="path"/> - <xsl:variable name="filename"> - <xsl:call-template name="filename"> - <xsl:with-param name="path" select="$path"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="ext"> - <xsl:call-template name="ext"> - <xsl:with-param name="path" select="$filename"/> - </xsl:call-template> - </xsl:variable> - <xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/> -</xsl:template> - + <xsl:template name="filename-noext"> + <xsl:param name="path"/> + <xsl:variable name="filename"> + <xsl:call-template name="filename"> + <xsl:with-param name="path" select="$path"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ext"> + <xsl:call-template name="ext"> + <xsl:with-param name="path" select="$filename"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/> + </xsl:template> <!-- Returns a path with the filename stripped of its last extension. Examples: 'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx' --> -<xsl:template name="path-noext"> - <xsl:param name="path"/> - <xsl:variable name="ext"> - <xsl:call-template name="ext"> - <xsl:with-param name="path" select="$path"/> - </xsl:call-template> - </xsl:variable> - <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/> -</xsl:template> - -<!-- Normalized (..'s eliminated) version of 'path-noext' --> -<xsl:template name="path-noext-nz"> - <xsl:param name="path" /> - <xsl:call-template name="normalize"> - <xsl:with-param name="path"> - <xsl:call-template name="path-noext"> - <xsl:with-param name="path" select="$path" /> + <xsl:template name="path-noext"> + <xsl:param name="path"/> + <xsl:variable name="ext"> + <xsl:call-template name="ext"> + <xsl:with-param name="path" select="$path"/> </xsl:call-template> - </xsl:with-param> - </xsl:call-template> -</xsl:template> - + </xsl:variable> + <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/> + </xsl:template> +<!-- Normalized (..'s eliminated) version of 'path-noext' --> + <xsl:template name="path-noext-nz"> + <xsl:param name="path" /> + <xsl:call-template name="normalize"> + <xsl:with-param name="path"> + <xsl:call-template name="path-noext"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </xsl:template> <!-- Returns a path with any fragment identifier ('#...') stripped off Examples: 'foo/bar/index.dtdx.html#blah' -> 'foo/bar/index.dtdx.html' --> -<xsl:template name="path-nofrag"> - <xsl:param name="path"/> - <xsl:if test="not(contains($path, '#'))"> - <xsl:value-of select="$path"/> - </xsl:if> - <xsl:if test="contains($path, '#')"> - <xsl:value-of select="substring-before($path, '#')"/> - </xsl:if> -</xsl:template> - - - + <xsl:template name="path-nofrag"> + <xsl:param name="path"/> + <xsl:if test="not(contains($path, '#'))"> + <xsl:value-of select="$path"/> + </xsl:if> + <xsl:if test="contains($path, '#')"> + <xsl:value-of select="substring-before($path, '#')"/> + </xsl:if> + </xsl:template> <!-- Normalizes a path, converting '/' to '\' and eliminating ..'s Examples: 'foo/bar/../baz/index.html' -> foo/baz/index.html' --> -<xsl:template name="normalize"> - <xsl:param name="path"/> - <!-- replace all \ with / --> - <xsl:variable name="path-" select="translate($path, '\', '/')"/> - <xsl:choose> - <!-- process relative refs here --> - <xsl:when test="contains($path-, '/../')"> - <!-- put part before /../ into $pa: "foo/bar" --> - <xsl:variable name="pa" select="substring-before($path-, '/../')"/> - <!-- put part after first occurrence /../ into $th: "baz/index.html" --> - <xsl:variable name="th" select="substring-after($path-, '/../')"/> - <!-- cut last real directory name before /../ and put rest in $pa- : "foo/" --> - <xsl:variable name="pa-"> - <xsl:call-template name="dirname"> - <xsl:with-param name="path" select="$pa"/> - </xsl:call-template> - </xsl:variable> - <!-- recombine pieces thus eliminating one .. and one dir step before it + <xsl:template name="normalize"> + <xsl:param name="path"/> +<!-- replace all \ with / --> + <xsl:variable name="path-" select="translate($path, '\', '/')"/> + <xsl:choose> +<!-- process relative refs here --> + <xsl:when test="contains($path-, '/../')"> +<!-- put part before /../ into $pa: "foo/bar" --> + <xsl:variable name="pa" select="substring-before($path-, '/../')"/> +<!-- put part after first occurrence /../ into $th: "baz/index.html" --> + <xsl:variable name="th" select="substring-after($path-, '/../')"/> +<!-- cut last real directory name before /../ and put rest in $pa- : "foo/" --> + <xsl:variable name="pa-"> + <xsl:call-template name="dirname"> + <xsl:with-param name="path" select="$pa"/> + </xsl:call-template> + </xsl:variable> +<!-- recombine pieces thus eliminating one .. and one dir step before it and recurse into this template to eliminate more /../ - --> - <xsl:variable name="pa-th" select="concat($pa-, $th)"/> - <xsl:call-template name="normalize"> - <xsl:with-param name="path" select="$pa-th"/> - </xsl:call-template> - </xsl:when> - - <xsl:otherwise> - <xsl:value-of select="$path-"/> - </xsl:otherwise> - </xsl:choose> - -</xsl:template> - + --> + <xsl:variable name="pa-th" select="concat($pa-, $th)"/> + <xsl:call-template name="normalize"> + <xsl:with-param name="path" select="$pa-th"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$path-"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- Uncomment this to test. Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar @@ -242,5 +228,4 @@ </xsl:message> </xsl:template> --> - </xsl:stylesheet>
Modified: forrest/trunk/main/webapp/skins/common/xslt/html/renderlogo.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/renderlogo.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/renderlogo.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/renderlogo.xsl Mon Apr 9 18:43:14 2007 @@ -15,7 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. --> - <!-- A simple callable template that renders a logo for an entity. The logo will be a hyperlink and may include an image (with width and height if specified) @@ -23,11 +22,9 @@ Note that text and image are mandatory parts of the template. --> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:template name="renderlogo"> <xsl:param name="name"/> <xsl:param name="url"/> @@ -35,29 +32,36 @@ <xsl:param name="width"/> <xsl:param name="height"/> <xsl:param name="root"/> - <xsl:param name="description"/> - <a href="{$url}"> - <xsl:choose> - <xsl:when test="$logo and not($logo = '')"> - <img alt="{$name}" class="logoImage"> - <xsl:attribute name="src"> - <xsl:if test="not(starts-with($logo, 'http://'))"><xsl:value-of select="$root"/></xsl:if> - <xsl:value-of select="$logo"/> - </xsl:attribute> - <xsl:if test="$width"> - <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute> - </xsl:if> - <xsl:if test="$height"> - <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute> + <xsl:param name="description"/><a href="{$url}"> + <xsl:choose> + <xsl:when test="$logo and not($logo = '')"> + <img alt="{$name}" class="logoImage"> + <xsl:attribute name="src"> + <xsl:if test="not(starts-with($logo, 'http://'))"> + <xsl:value-of select="$root"/> </xsl:if> - <xsl:if test="$description"> - <xsl:attribute name="title"><xsl:value-of select="$description"/></xsl:attribute> - </xsl:if> - </img> - </xsl:when> - <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise> - </xsl:choose> - </a> + <xsl:value-of select="$logo"/> + </xsl:attribute> + <xsl:if test="$width"> + <xsl:attribute name="width"> + <xsl:value-of select="$width"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$height"> + <xsl:attribute name="height"> + <xsl:value-of select="$height"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$description"> + <xsl:attribute name="title"> + <xsl:value-of select="$description"/> + </xsl:attribute> + </xsl:if> + </img> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$name"/> + </xsl:otherwise> + </xsl:choose></a> </xsl:template> - </xsl:stylesheet> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/site-to-xhtml.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/site-to-xhtml.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/site-to-xhtml.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/site-to-xhtml.xsl Mon Apr 9 18:43:14 2007 @@ -33,79 +33,72 @@ </site> --> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"> - <xsl:variable name="config" select="//skinconfig"/> - <!-- If true, a txt link for this page will not be generated --> +<!-- If true, a txt link for this page will not be generated --> <xsl:variable name="disable-txt-link" select="//skinconfig/disable-txt-link"/> - <!-- If true, a PDF link for this page will not be generated --> +<!-- If true, a PDF link for this page will not be generated --> <xsl:variable name="disable-pdf-link" select="//skinconfig/disable-pdf-link"/> - <!-- If true, a "print" link for this page will not be generated --> +<!-- If true, a "print" link for this page will not be generated --> <xsl:variable name="disable-print-link" select="//skinconfig/disable-print-link"/> - <!-- If true, an XML link for this page will not be generated --> +<!-- If true, an XML link for this page will not be generated --> <xsl:variable name="disable-xml-link" select="//skinconfig/disable-xml-link"/> - <!-- If true, a POD link for this page will not be generated --> +<!-- If true, a POD link for this page will not be generated --> <xsl:variable name="disable-pod-link" select="//skinconfig/disable-pod-link"/> - <!-- Get the location where to generate the minitoc --> +<!-- Get the location where to generate the minitoc --> <xsl:variable name="minitoc-location" select="//skinconfig/toc/@location"/> - <xsl:param name="path"/> - <xsl:include href="dotdots.xsl"/> <xsl:include href="pathutils.xsl"/> <xsl:include href="renderlogo.xsl"/> - - <!-- Path (..'s) to the root directory --> +<!-- Path (..'s) to the root directory --> <xsl:variable name="root"> <xsl:call-template name="dotdots"> <xsl:with-param name="path" select="$path"/> </xsl:call-template> </xsl:variable> - - <!-- Source filename (eg 'foo.xml') of current page --> +<!-- Source filename (eg 'foo.xml') of current page --> <xsl:variable name="filename"> <xsl:call-template name="filename"> <xsl:with-param name="path" select="$path"/> </xsl:call-template> </xsl:variable> - - <!-- Path of Lucene search results page (relative to $root) --> +<!-- Path of Lucene search results page (relative to $root) --> <xsl:param name="lucene-search" select="'lucene-search.html'"/> - <xsl:variable name="filename-noext"> <xsl:call-template name="filename-noext"> <xsl:with-param name="path" select="$path"/> </xsl:call-template> </xsl:variable> - - <!-- Whether to obfuscate email links --> +<!-- Whether to obfuscate email links --> <xsl:variable name="obfuscate-mail-links" select="//skinconfig/obfuscate-mail-links"/> - <!-- If true, the font size script will not be rendered --> +<!-- If true, the font size script will not be rendered --> <xsl:variable name="disable-font-script" select="//skinconfig/disable-font-script"/> - <!-- If true, an the images on all external links will not be added --> +<!-- If true, an the images on all external links will not be added --> <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/> <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/> <xsl:variable name="spacer" select="concat($root, 'skin/images/spacer.gif')"/> - <xsl:template name="breadcrumbs"> - <xsl:if test="(//skinconfig/trail/link1/@name)and(//skinconfig/trail/link1/@name!='')"><a href="{//skinconfig/trail/link1/@href}"><xsl:value-of select="//skinconfig/trail/link1/@name"/></a></xsl:if> - <xsl:if test="(//skinconfig/trail/link2/@name)and(//skinconfig/trail/link2/@name!='')"> > <a href="{//skinconfig/trail/link2/@href}"> <xsl:value-of select="//skinconfig/trail/link2/@name"/></a> </xsl:if> - <xsl:if test="(//skinconfig/trail/link3/@name)and(//skinconfig/trail/link3/@name!='')"> > <a href="{//skinconfig/trail/link3/@href}"> <xsl:value-of select="//skinconfig/trail/link3/@name"/></a> </xsl:if> - <script type="text/javascript" language="JavaScript" src="{$root}skin/breadcrumbs.js"/> + <xsl:if test="(//skinconfig/trail/link1/@name)and(//skinconfig/trail/link1/@name!='')"><a href="{//skinconfig/trail/link1/@href}"> + <xsl:value-of select="//skinconfig/trail/link1/@name"/></a> + </xsl:if> + <xsl:if test="(//skinconfig/trail/link2/@name)and(//skinconfig/trail/link2/@name!='')"> > <a href="{//skinconfig/trail/link2/@href}"> + <xsl:value-of select="//skinconfig/trail/link2/@name"/></a> + </xsl:if> + <xsl:if test="(//skinconfig/trail/link3/@name)and(//skinconfig/trail/link3/@name!='')"> > <a href="{//skinconfig/trail/link3/@href}"> + <xsl:value-of select="//skinconfig/trail/link3/@name"/></a> + </xsl:if> +<script type="text/javascript" language="JavaScript" src="{$root}skin/breadcrumbs.js"/> </xsl:template> - <xsl:template match="site"> <html> <head> <title><xsl:value-of select="[EMAIL PROTECTED]'content']/table/tr/td/h1"/></title> - <xsl:if test="//skinconfig/favicon-url"> - <link rel="shortcut icon"> - <xsl:attribute name="href"> - <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/> - </xsl:attribute> - </link> + <xsl:if test="//skinconfig/favicon-url"><link rel="shortcut icon"> + <xsl:attribute name="href"> + <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/> + </xsl:attribute></link> </xsl:if> </head> <body> @@ -134,20 +127,17 @@ <xsl:comment>================= start Content==================</xsl:comment> <xsl:apply-templates select="[EMAIL PROTECTED]'content']"/> <xsl:comment>================= end Content==================</xsl:comment> - <xsl:comment>================= start Footer ==================</xsl:comment> <xsl:choose> - <xsl:when test="$config/copyright-link"> - <a> - <xsl:attribute name="href"> - <xsl:value-of select="$config/copyright-link"/> - </xsl:attribute> + <xsl:when test="$config/copyright-link"><a> + <xsl:attribute name="href"> + <xsl:value-of select="$config/copyright-link"/> + </xsl:attribute> Copyright © <xsl:value-of select="$config/year"/> - <xsl:call-template name="current-year"> - <xsl:with-param name="copyrightyear" select="$config/year"/> - </xsl:call-template>  - <xsl:value-of select="$config/vendor"/> - </a> + <xsl:call-template name="current-year"> + <xsl:with-param name="copyrightyear" select="$config/year"/> + </xsl:call-template>  + <xsl:value-of select="$config/vendor"/></a> </xsl:when> <xsl:otherwise> Copyright © <xsl:value-of select="$config/year"/> @@ -161,15 +151,13 @@ <script language="JavaScript" type="text/javascript"><![CDATA[<!-- document.write(" - "+"Last Published: " + document.lastModified); // -->]]></script> - <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')"> - <a href="{//skinconfig/host-url}"> - <xsl:call-template name="renderlogo"> - <xsl:with-param name="name" select="//skinconfig/host-name"/> - <xsl:with-param name="url" select="//skinconfig/host-url"/> - <xsl:with-param name="logo" select="//skinconfig/host-logo"/> - <xsl:with-param name="root" select="$root"/> - </xsl:call-template> - </a> + <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')"><a href="{//skinconfig/host-url}"> + <xsl:call-template name="renderlogo"> + <xsl:with-param name="name" select="//skinconfig/host-name"/> + <xsl:with-param name="url" select="//skinconfig/host-url"/> + <xsl:with-param name="logo" select="//skinconfig/host-logo"/> + <xsl:with-param name="root" select="$root"/> + </xsl:call-template></a> </xsl:if> <xsl:if test="$filename = 'index.html' and //skinconfig/credits"> <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]"> @@ -182,68 +170,65 @@ <xsl:with-param name="height" select="height"/> </xsl:call-template> </xsl:for-each> - </xsl:if> - <a href="http://validator.w3.org/check/referer"><img class="skin" border="0" + </xsl:if><a href="http://validator.w3.org/check/referer"> + <img class="skin" border="0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"/></a> </body> </html> </xsl:template> - - <!-- Add links to any standards-compliance logos --> +<!-- Add links to any standards-compliance logos --> <xsl:template name="compliancy-logos"> - <xsl:if test="$filename = 'index.html' and //skinconfig/disable-compliance-links = 'false'"> - <a href="http://validator.w3.org/check/referer"><img class="logoImage" + <xsl:if test="$filename = 'index.html' and //skinconfig/disable-compliance-links = 'false'"><a href="http://validator.w3.org/check/referer"> + <img class="logoImage" src="{$skin-img-dir}/valid-html401.png" - alt="Valid HTML 4.01!" title="Valid HTML 4.01!" height="31" width="88" border="0"/></a> - - <a href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logoImage" + alt="Valid HTML 4.01!" title="Valid HTML 4.01!" height="31" width="88" border="0"/></a><a href="http://jigsaw.w3.org/css-validator/check/referer"> + <img class="logoImage" src="{$skin-img-dir}/vcss.png" alt="Valid CSS!" title="Valid CSS!" height="31" width="88" border="0"/></a> </xsl:if> </xsl:template> - - <!-- Generates the PDF link --> +<!-- Generates the PDF link --> <xsl:template match="[EMAIL PROTECTED]'skinconf-pdflink']"> <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'"> <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida"> - <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/> + <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/> + <br/> PDF</a> </td> </xsl:if> </xsl:template> - - <!-- Generates the TXT link --> +<!-- Generates the TXT link --> <xsl:template match="[EMAIL PROTECTED]'skinconf-txtlink']"> <xsl:if test="$disable-txt-link = 'false'"> <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.txt" class="dida"> - <img class="skin" src="{$skin-img-dir}/txtdoc.png" alt="TXT"/><br/> + <img class="skin" src="{$skin-img-dir}/txtdoc.png" alt="TXT"/> + <br/> TXT</a> </td> </xsl:if> </xsl:template> - - <!-- Generates the POD link --> +<!-- Generates the POD link --> <xsl:template match="[EMAIL PROTECTED]'skinconf-podlink']"> <xsl:if test="$disable-pod-link = 'false'"> <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pod" class="dida"> - <img class="skin" src="{$skin-img-dir}/poddoc.png" alt="POD"/><br/> + <img class="skin" src="{$skin-img-dir}/poddoc.png" alt="POD"/> + <br/> POD</a> </td> </xsl:if> </xsl:template> - - <!-- Generates the XML link --> +<!-- Generates the XML link --> <xsl:template match="[EMAIL PROTECTED]'skinconf-xmllink']"> <xsl:if test="$disable-xml-link = 'false'"> <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida"> - <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="XML"/><br/> + <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="XML"/> + <br/> XML</a> </td> </xsl:if> </xsl:template> - - <!-- Generates the "printer friendly version" link --> +<!-- Generates the "printer friendly version" link --> <xsl:template match="[EMAIL PROTECTED]'skinconf-printlink']"> <xsl:if test="$disable-print-link = 'false'"> <script type="text/javascript" language="Javascript"> @@ -264,34 +249,27 @@ document.write('</td>'); } </script> - </xsl:if> </xsl:template> - - <!-- handle all obfuscating mail links and disabling external link images --> +<!-- handle all obfuscating mail links and disabling external link images --> <xsl:template match="a"> <xsl:choose> <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')"> <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/> <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/> - <xsl:variable name="obfuscation" select="normalize-space(//skinconfig/obfuscate-mail-value)"/> - <a href="{$mailto-1}{$obfuscation}{$mailto-2}"> - <xsl:apply-templates/> - </a> - </xsl:when> - <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))"> - <a href="[EMAIL PROTECTED]" class="external"> - <xsl:apply-templates/> - </a> - </xsl:when> - <xsl:otherwise> - <!-- xsl:copy-of makes sure we copy <a href> as well as <a name> + <xsl:variable name="obfuscation" select="normalize-space(//skinconfig/obfuscate-mail-value)"/><a href="{$mailto-1}{$obfuscation}{$mailto-2}"> + <xsl:apply-templates/></a> + </xsl:when> + <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))"><a href="[EMAIL PROTECTED]" class="external"> + <xsl:apply-templates/></a> + </xsl:when> + <xsl:otherwise> +<!-- xsl:copy-of makes sure we copy <a href> as well as <a name> or any other <a ...> forms --> <xsl:copy-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:template> - <xsl:template match="[EMAIL PROTECTED]'skinconf-toc-page']"> <xsl:if test="$config/toc"> <xsl:if test="contains($minitoc-location,'page')"> @@ -303,29 +281,24 @@ </xsl:if> </xsl:if> </xsl:template> - <xsl:template name="minitoc"> <xsl:param name="tocroot"/> <xsl:if test="(count($tocroot/tocitem) >= $config/toc/@min-sections) or ($tocroot/@force = 'true')"> - <xsl:if test="contains($config/toc/@location,'page')"> - <ul class="minitoc"> - <xsl:for-each select="$tocroot/tocitem"> - <li> - <a href="[EMAIL PROTECTED]"> - <xsl:value-of select="@title"/> - </a> - <xsl:if test="@level<//skinconfig/toc/@max-depth+1"> - <xsl:call-template name="minitoc"> - <xsl:with-param name="tocroot" select="."/> - </xsl:call-template> - </xsl:if> - </li> - </xsl:for-each> - </ul> - </xsl:if> + <xsl:if test="contains($config/toc/@location,'page')"> + <ul class="minitoc"> + <xsl:for-each select="$tocroot/tocitem"> + <li><a href="[EMAIL PROTECTED]"> + <xsl:value-of select="@title"/></a> + <xsl:if test="@level<//skinconfig/toc/@max-depth+1"> + <xsl:call-template name="minitoc"> + <xsl:with-param name="tocroot" select="."/> + </xsl:call-template> + </xsl:if></li> + </xsl:for-each> + </ul> + </xsl:if> </xsl:if> </xsl:template> - <xsl:template name="html-meta"> <meta name="Generator" content="Apache Forrest"/> <meta name="Forrest-version"> @@ -339,33 +312,35 @@ </xsl:attribute> </meta> </xsl:template> - - <!-- meta information from v 2.0 documents +<!-- meta information from v 2.0 documents FIXME: the match is really inefficient --> <xsl:template name="meta-data"> <xsl:for-each select="//meta-data/meta"> <xsl:element name="meta"> - <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute> - <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute> + <xsl:attribute name="name"> + <xsl:value-of select="@name"/> + </xsl:attribute> + <xsl:attribute name="content"> + <xsl:value-of select="."/> + </xsl:attribute> <xsl:if test="@xml:lang"> - <xsl:attribute name="lang"><xsl:value-of select="@xml:lang"/></xsl:attribute> + <xsl:attribute name="lang"> + <xsl:value-of select="@xml:lang"/> + </xsl:attribute> </xsl:if> </xsl:element> </xsl:for-each> </xsl:template> - <xsl:template name="feedback"> <div id="feedback"> <xsl:value-of select="$config/feedback"/> <xsl:choose> - <xsl:when test="$config/feedback/@href and not($config/feedback/@href='')"> - <a id="feedbackto"> - <xsl:attribute name="href"> - <xsl:value-of select="$config/feedback/@href"/> - <xsl:value-of select="$path"/> - </xsl:attribute> - <xsl:value-of select="$config/feedback/@to"/> - </a> + <xsl:when test="$config/feedback/@href and not($config/feedback/@href='')"><a id="feedbackto"> + <xsl:attribute name="href"> + <xsl:value-of select="$config/feedback/@href"/> + <xsl:value-of select="$path"/> + </xsl:attribute> + <xsl:value-of select="$config/feedback/@to"/></a> </xsl:when> <xsl:otherwise> <xsl:value-of select="$config/feedback/@to"/> @@ -373,17 +348,15 @@ </xsl:choose> </div> </xsl:template> - <xsl:template match="node()|@*" priority="-1"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> - - <!-- inception year copyright management --> +<!-- inception year copyright management --> <xsl:template name="current-year"> - <!-- Displays the current year after the inception year (in the copyright i.e: 2002-2005) +<!-- Displays the current year after the inception year (in the copyright i.e: 2002-2005) - the copyright year (2005 by default) can be indicated in the copyrightyear parameter, - the year format (yyyy by default) can be indicated in the dateformat parameter, - the dates separator (- by default) can be indicated in the dateseparator parameter. @@ -398,18 +371,18 @@ Warning, to enable inception year, inception attribute must be set to "true" in copyright/year/@inception --> <xsl:param name="copyrightyear">2005</xsl:param> - <xsl:param name="dateformat">yyyy</xsl:param> - <xsl:param name="dateseparator">-</xsl:param> - <xsl:if test="[EMAIL PROTECTED] = 'true']"> - <xsl:variable name="tz" select='java:java.util.SimpleTimeZone.new(0,"GMT+00:00")' /> - <xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new($dateformat)"/> - <xsl:variable name="settz" select="java:setTimeZone($formatter, $tz)" /> - <xsl:variable name="date" select="java:java.util.Date.new()"/> - <xsl:variable name="year" select="java:format($formatter, $date)"/> - - <xsl:if test="$copyrightyear != $year"> - <xsl:value-of select="$dateseparator"/><xsl:value-of select="$year"/> - </xsl:if> + <xsl:param name="dateformat">yyyy</xsl:param> + <xsl:param name="dateseparator">-</xsl:param> + <xsl:if test="[EMAIL PROTECTED] = 'true']"> + <xsl:variable name="tz" select='java:java.util.SimpleTimeZone.new(0,"GMT+00:00")' /> + <xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new($dateformat)"/> + <xsl:variable name="settz" select="java:setTimeZone($formatter, $tz)" /> + <xsl:variable name="date" select="java:java.util.Date.new()"/> + <xsl:variable name="year" select="java:format($formatter, $date)"/> + <xsl:if test="$copyrightyear != $year"> + <xsl:value-of select="$dateseparator"/> + <xsl:value-of select="$year"/> </xsl:if> + </xsl:if> </xsl:template> </xsl:stylesheet> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/split.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/split.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/split.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/split.xsl Mon Apr 9 18:43:14 2007 @@ -1,13 +1,11 @@ <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <!-- This stylesheet was taken from the XSLT FAQ http://www.dpawson.co.uk/xsl/ Comments and adaption to be used without normalize-space() by [EMAIL PROTECTED] ---> - +--> <!-- Input: @@ -54,89 +52,73 @@ --> - - <xsl:template match="/body"> - <body> - <xsl:call-template name="format"> - <xsl:with-param select="source" name="txt" /> - <xsl:with-param name="width">40</xsl:with-param> - </xsl:call-template> - </body> + <xsl:template match="/body"> + <body> + <xsl:call-template name="format"> + <xsl:with-param select="source" name="txt" /> + <xsl:with-param name="width">40</xsl:with-param> + </xsl:call-template> + </body> </xsl:template> - <xsl:template name="format"> - <xsl:param name="txt" /> - <xsl:param name="width" /> - - <!-- if there is still text left --> + <xsl:param name="txt" /> + <xsl:param name="width" /> +<!-- if there is still text left --> <xsl:if test="$txt"> - - <xsl:variable name = "pretxt" select = "substring($txt,0, $width)" /> - - <xsl:choose> - <xsl:when test="contains($pretxt, '
')"> - <xsl:value-of select="substring-before($pretxt, '
')"/> - <xsl:text>
</xsl:text> - <xsl:call-template name="format"> - <xsl:with-param name="txt" select="substring-after($txt,'
')"/> - <xsl:with-param select="$width" name="width" /> - </xsl:call-template> - </xsl:when> - - <xsl:otherwise> - <!-- get the width at which to break--> - <xsl:variable name="real-width"> - <xsl:call-template name="tune-width"> - <xsl:with-param select="$txt" name="txt" /> - <xsl:with-param select="$width" name="width" /> - <xsl:with-param select="$width" name="def" /> - </xsl:call-template> - </xsl:variable> - - <!-- output the first part of the broken string --> - <xsl:value-of select="substring($txt, 1, $real-width)" /> - - <!-- output a newline --> - <xsl:text>
</xsl:text> - - <!-- call itself with the remaining part of the text --> - <xsl:call-template name="format"> - <xsl:with-param select="substring($txt,$real-width + 1)" name="txt" /> - <xsl:with-param select="$width" name="width" /> - </xsl:call-template> - </xsl:otherwise> + <xsl:variable name = "pretxt" select = "substring($txt,0, $width)" /> + <xsl:choose> + <xsl:when test="contains($pretxt, '
')"> + <xsl:value-of select="substring-before($pretxt, '
')"/> +<xsl:text>
</xsl:text> + <xsl:call-template name="format"> + <xsl:with-param name="txt" select="substring-after($txt,'
')"/> + <xsl:with-param select="$width" name="width" /> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> +<!-- get the width at which to break--> + <xsl:variable name="real-width"> + <xsl:call-template name="tune-width"> + <xsl:with-param select="$txt" name="txt" /> + <xsl:with-param select="$width" name="width" /> + <xsl:with-param select="$width" name="def" /> + </xsl:call-template> + </xsl:variable> +<!-- output the first part of the broken string --> + <xsl:value-of select="substring($txt, 1, $real-width)" /> +<!-- output a newline --> +<xsl:text>
</xsl:text> +<!-- call itself with the remaining part of the text --> + <xsl:call-template name="format"> + <xsl:with-param select="substring($txt,$real-width + 1)" name="txt" /> + <xsl:with-param select="$width" name="width" /> + </xsl:call-template> + </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> - - - <!-- used by template "format", it calculates the width at the given def +<!-- used by template "format", it calculates the width at the given def It starts at def length and comes back till it finds a space --> <xsl:template name="tune-width"> - <xsl:param name="txt" /> - <xsl:param name="width" /> - <xsl:param name="def" /> - + <xsl:param name="txt" /> + <xsl:param name="width" /> + <xsl:param name="def" /> <xsl:choose> <xsl:when test="$width = 0"> - <xsl:value-of select="$def" /> + <xsl:value-of select="$def" /> </xsl:when> - <xsl:when test="substring($txt, $width, 1 ) = ' '"> - <xsl:value-of select="$width" /> - </xsl:when> - - <xsl:otherwise> - <!-- otherwise need to tune again, trying with $width - 1 --> - <xsl:call-template name="tune-width"> - <xsl:with-param select="$width - 1" name="width" /> - <xsl:with-param select="$txt" name="txt" /> - <xsl:with-param select="$def" name="def" /> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - + <xsl:value-of select="$width" /> + </xsl:when> + <xsl:otherwise> +<!-- otherwise need to tune again, trying with $width - 1 --> + <xsl:call-template name="tune-width"> + <xsl:with-param select="$width - 1" name="width" /> + <xsl:with-param select="$txt" name="txt" /> + <xsl:with-param select="$def" name="def" /> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> </xsl:template> - - </xsl:stylesheet> +</xsl:stylesheet> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/strip_namespaces.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/strip_namespaces.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/strip_namespaces.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/strip_namespaces.xsl Mon Apr 9 18:43:14 2007 @@ -16,25 +16,24 @@ limitations under the License. --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <!-- FIXME: FOR-555. This might not be the best solution though, but it sure works --> +<!-- FIXME: FOR-555. This might not be the best solution though, but it sure works --> <xsl:template match="comment()|processing-instruction()"> <xsl:copy> <xsl:apply-templates select="@*|*|text()|processing-instruction()|comment()"/> </xsl:copy> </xsl:template> <!-- End fixme FOR-555 --> - - <xsl:template match="*"> - <!-- remove element prefix (if any) --> - <xsl:element name="{local-name()}"> - <!-- process attributes --> - <xsl:for-each select="@*"> - <!-- remove attribute prefix (if any) --> - <xsl:attribute name="{local-name()}"> - <xsl:value-of select="."/> - </xsl:attribute> - </xsl:for-each> - <xsl:apply-templates/> - </xsl:element> + <xsl:template match="*"> +<!-- remove element prefix (if any) --> + <xsl:element name="{local-name()}"> +<!-- process attributes --> + <xsl:for-each select="@*"> +<!-- remove attribute prefix (if any) --> + <xsl:attribute name="{local-name()}"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + <xsl:apply-templates/> + </xsl:element> </xsl:template> </xsl:stylesheet> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/tab-to-menu.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/tab-to-menu.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/tab-to-menu.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/tab-to-menu.xsl Mon Apr 9 18:43:14 2007 @@ -37,94 +37,68 @@ which is then merged by site-to-xhtml.xsl --> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - - <!-- ================================================================ --> - <!-- These templates SHOULD be overridden --> - <!-- ================================================================ --> - - <!-- Called before first level 1 tag --> - <xsl:template name="pre-separator"> - </xsl:template> - - <!-- Called after last level 1 tag --> - <xsl:template name="post-separator"> - </xsl:template> - - <!-- Called between level 1 tags --> +<!-- ================================================================ --> +<!-- These templates SHOULD be overridden --> +<!-- ================================================================ --> +<!-- Called before first level 1 tag --> + <xsl:template name="pre-separator"></xsl:template> +<!-- Called after last level 1 tag --> + <xsl:template name="post-separator"></xsl:template> +<!-- Called between level 1 tags --> <xsl:template name="separator"> - <xsl:text> | </xsl:text> - </xsl:template> - - <!-- Called before first level 2 tag --> - <xsl:template name="level2-pre-separator"> - </xsl:template> - - <!-- Called after last level 2 tag --> - <xsl:template name="level2-post-separator"> +<xsl:text> | </xsl:text> </xsl:template> - - <!-- Called between level 2 tags --> +<!-- Called before first level 2 tag --> + <xsl:template name="level2-pre-separator"></xsl:template> +<!-- Called after last level 2 tag --> + <xsl:template name="level2-post-separator"></xsl:template> +<!-- Called between level 2 tags --> <xsl:template name="level2-separator"> - <xsl:text> | </xsl:text> - </xsl:template> - - <!-- +<xsl:text> | </xsl:text> + </xsl:template> +<!-- Note: sub-stylesheets can't do apply-imports here, because it would choose the 'tags' template and infinitely recurse. Hence call-template used instead. --> - - <!-- Display a selected level 1 tab node --> +<!-- Display a selected level 1 tab node --> <xsl:template name="selected"> <xsl:call-template name="base-selected"/> </xsl:template> - - <!-- Display an unselected level 1 tab node --> +<!-- Display an unselected level 1 tab node --> <xsl:template name="not-selected"> <xsl:call-template name="base-not-selected"/> </xsl:template> - - <!-- Display a selected second level tab node --> +<!-- Display a selected second level tab node --> <xsl:template name="level2-selected"> <xsl:call-template name="base-selected"/> </xsl:template> - - <!-- Display an unselected second level tab node --> +<!-- Display an unselected second level tab node --> <xsl:template name="level2-not-selected"> <xsl:call-template name="base-not-selected"/> </xsl:template> - - <!-- ================================================================ --> - <!-- These templates CAN be overridden --> - <!-- ================================================================ --> - +<!-- ================================================================ --> +<!-- These templates CAN be overridden --> +<!-- ================================================================ --> <xsl:template match="tabs"> <div class="tab"> <xsl:call-template name="base-tabs"/> </div> </xsl:template> - - - <!-- ================================================================ --> - <!-- These templates SHOULD NOT be overridden --> - <!-- ================================================================ --> - +<!-- ================================================================ --> +<!-- These templates SHOULD NOT be overridden --> +<!-- ================================================================ --> <xsl:param name="path"/> - <xsl:include href="dotdots.xsl"/> <xsl:include href="tabutils.xsl"/> - - <!-- NOTE: Xalan has a bug (race condition?) where sometimes $root is only half-evaluated --> +<!-- NOTE: Xalan has a bug (race condition?) where sometimes $root is only half-evaluated --> <xsl:variable name="root"> <xsl:call-template name="dotdots"> <xsl:with-param name="path" select="$path"/> </xsl:call-template> </xsl:variable> - <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/> - - <!-- +<!-- The longest path of any level 1 tab, whose path is a subset of the current URL. Ie, the path of the 'current' level 1 tab. --> @@ -133,8 +107,7 @@ <xsl:with-param name="tabfile" select="/"/> </xsl:call-template> </xsl:variable> - - <!-- +<!-- The longest path of any level 2 tab, whose path is a subset of the current URL. Ie, the path of the 'current' level 2 tab. --> @@ -143,33 +116,33 @@ <xsl:with-param name="tabfile" select="/"/> </xsl:call-template> </xsl:variable> - <xsl:variable name="matching-id"> <xsl:call-template name="matching-id"/> </xsl:variable> - - <!-- Called from tabs, after it has written the outer 'div class=tabs' and +<!-- Called from tabs, after it has written the outer 'div class=tabs' and any other HTML --> <xsl:template name="base-tabs"> <xsl:call-template name="pre-separator"/> <xsl:for-each select="tab"> - <xsl:if test="position()!=1"><xsl:call-template name="separator"/></xsl:if> + <xsl:if test="position()!=1"> + <xsl:call-template name="separator"/> + </xsl:if> <xsl:apply-templates select="." mode="level1"/> </xsl:for-each> <xsl:call-template name="post-separator"/> </xsl:template> - - <!-- Called from tabs, after it has written the outer 'div class=tabs' and +<!-- Called from tabs, after it has written the outer 'div class=tabs' and any other HTML --> <xsl:template name="level2tabs"> <xsl:call-template name="level2-pre-separator"/> <xsl:for-each select="[EMAIL PROTECTED]/tab|[EMAIL PROTECTED]/tab|tab[tab/@id=$matching-id]/tab"> - <xsl:if test="position()!=1"><xsl:call-template name="level2-separator"/></xsl:if> + <xsl:if test="position()!=1"> + <xsl:call-template name="level2-separator"/> + </xsl:if> <xsl:apply-templates select="." mode="level2"/> </xsl:for-each> <xsl:call-template name="level2-post-separator"/> </xsl:template> - <xsl:template match="tab" mode="level1"> <xsl:choose> <xsl:when test="@id and @id = $matching-id"> @@ -186,7 +159,6 @@ </xsl:otherwise> </xsl:choose> </xsl:template> - <xsl:template match="tab" mode="level2"> <xsl:choose> <xsl:when test="@id and @id = $matching-id"> @@ -200,31 +172,24 @@ </xsl:otherwise> </xsl:choose> </xsl:template> - - <!-- Called from 'selected' --> - <xsl:template name="base-selected"> - <a class="selected"> - <xsl:attribute name="href"> - <xsl:call-template name="calculate-tab-href"> - <xsl:with-param name="tab" select="."/> - <xsl:with-param name="path" select="$path"/> - </xsl:call-template> - </xsl:attribute> - <xsl:value-of select="@label"/> - </a> - </xsl:template> - - <!-- Called from 'not-selected' --> - <xsl:template name="base-not-selected"> - <a class="unselected"> - <xsl:attribute name="href"> - <xsl:call-template name="calculate-tab-href"> - <xsl:with-param name="tab" select="."/> - <xsl:with-param name="path" select="$path"/> - </xsl:call-template> - </xsl:attribute> - <xsl:value-of select="@label"/> - </a> +<!-- Called from 'selected' --> + <xsl:template name="base-selected"><a class="selected"> + <xsl:attribute name="href"> + <xsl:call-template name="calculate-tab-href"> + <xsl:with-param name="tab" select="."/> + <xsl:with-param name="path" select="$path"/> + </xsl:call-template> + </xsl:attribute> + <xsl:value-of select="@label"/></a> + </xsl:template> +<!-- Called from 'not-selected' --> + <xsl:template name="base-not-selected"><a class="unselected"> + <xsl:attribute name="href"> + <xsl:call-template name="calculate-tab-href"> + <xsl:with-param name="tab" select="."/> + <xsl:with-param name="path" select="$path"/> + </xsl:call-template> + </xsl:attribute> + <xsl:value-of select="@label"/></a> </xsl:template> - </xsl:stylesheet> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/tabutils.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/tabutils.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/tabutils.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/tabutils.xsl Mon Apr 9 18:43:14 2007 @@ -15,42 +15,38 @@ See the License for the specific language governing permissions and limitations under the License. --> - <!-- Some callable templates useful when dealing with tab paths. Mostly used in tab-to-menu.xsl --> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:param name="site-file" select="'cocoon://abs-menulinks'"/> <xsl:variable name="site" select="document($site-file)"/> - - <!-- Given the current path and a tabs.xml entry, returns a relative path to +<!-- Given the current path and a tabs.xml entry, returns a relative path to the specified tab's URL. When rendering a set of tabs, this template will be called once per tab. --> <xsl:template name="calculate-tab-href"> - <xsl:param name="dir_index" select="'index.html'"/> - - <xsl:param name="tab"/> <!-- current 'tab' node --> + <xsl:param name="tab"/> +<!-- current 'tab' node --> <xsl:param name="path" select="$path"/> - - <xsl:if test="starts-with($tab/@href, 'http')"> <!-- Absolute URL --> + <xsl:if test="starts-with($tab/@href, 'http')"> +<!-- Absolute URL --> <xsl:value-of select="$tab/@href"/> </xsl:if> - <xsl:if test="not(starts-with($tab/@href, 'http'))"> <!-- Root-relative path --> + <xsl:if test="not(starts-with($tab/@href, 'http'))"> +<!-- Root-relative path --> <xsl:variable name="backpath"> <xsl:call-template name="dotdots"> <xsl:with-param name="path" select="$path"/> </xsl:call-template> - <xsl:text>/</xsl:text> +<xsl:text>/</xsl:text> <xsl:value-of select="$tab/@dir | $tab/@href"/> - <!-- If we obviously have a directory, add /index.html --> +<!-- If we obviously have a directory, add /index.html --> <xsl:if test="$tab/@dir or substring($tab/@href, string-length($tab/@href), string-length($tab/@href)) = '/'"> - <xsl:text>/</xsl:text> +<xsl:text>/</xsl:text> <xsl:if test="$tab/@indexfile"> <xsl:value-of select="$tab/@indexfile"/> </xsl:if> @@ -59,22 +55,19 @@ </xsl:if> </xsl:if> </xsl:variable> - <xsl:value-of select="translate(normalize-space(translate($backpath, ' /', '/ ')), ' /', '/ ')"/> - <!-- Link to backpath, normalizing slashes --> +<!-- Link to backpath, normalizing slashes --> </xsl:if> </xsl:template> - - <!-- +<!-- The id of any tab, whose path is a subset of the current URL. Ie, the path of the 'current' tab. --> <xsl:template name="matching-id" xmlns:l="http://apache.org/forrest/linkmap/1.0"> <xsl:value-of select="$site//*[starts-with(@href, $path)]/@tab"/> </xsl:template> - - <!-- +<!-- The longest path of any level 1 tab, whose path is a subset of the current URL. Ie, the path of the 'current' tab. --> @@ -88,8 +81,7 @@ </xsl:if> </xsl:for-each> </xsl:template> - - <!-- +<!-- The longest path of any level 2 tab, whose path is a subset of the current URL. Ie, the path of the 'current' tab. --> @@ -103,7 +95,4 @@ </xsl:if> </xsl:for-each> </xsl:template> - - </xsl:stylesheet> - Modified: forrest/trunk/main/webapp/skins/common/xslt/svg/document-to-svg.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/svg/document-to-svg.xsl?view=diff&rev=526992&r1=526991&r2=526992 ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/svg/document-to-svg.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/svg/document-to-svg.xsl Mon Apr 9 18:43:14 2007 @@ -16,35 +16,30 @@ limitations under the License. --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > - <xsl:output method="xml" media-type="image/svg" omit-xml-declaration="yes" indent="yes"/> - - <!-- the skinconf file --> + <xsl:output method="xml" media-type="image/svg" omit-xml-declaration="yes" indent="yes"/> +<!-- the skinconf file --> <xsl:param name="config-file"/> <xsl:variable name="config" select="document($config-file)/skinconfig"/> - <!-- Get the section depth to use when generating the minitoc (default is 2) --> +<!-- Get the section depth to use when generating the minitoc (default is 2) --> <xsl:variable name="toc-max-depth" select="number($config/toc/@max-depth)"/> - <xsl:param name="numbersections" select="'true'"/> - - <!-- Section depth at which we stop numbering and just indent --> +<!-- Section depth at which we stop numbering and just indent --> <xsl:param name="numbering-max-depth" select="'3'"/> <xsl:param name="ctxbasedir" select="."/> <xsl:param name="xmlbasedir"/> - <xsl:template match="/"> - <svg width="1305" height="1468" xmlns="http://www.w3.org/2000/svg"> + <svg width="1305" height="1468" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 0)"> <xsl:apply-templates/> </g> - </svg> + </svg> </xsl:template> - <xsl:template match="document"> - <text x="00px" y="30px" style="font-size:20;"><xsl:value-of select="header/title"/></text> - <text x="0px" y="50px" style="font-size:12;"> - <xsl:apply-templates/> - </text> + <text x="00px" y="30px" style="font-size:20;"> + <xsl:value-of select="header/title"/> + </text> + <text x="0px" y="50px" style="font-size:12;"> + <xsl:apply-templates/> + </text> </xsl:template> - - </xsl:stylesheet>
