Revision: 40 Author: matt Date: 2006-08-05 01:04:33 +0000 (Sat, 05 Aug 2006)
Log Message: ----------- No longer needed Removed Paths: ------------- trunk/demo/gallery/stylesheets/mergeimageinfo.xsl Deleted: trunk/demo/gallery/stylesheets/mergeimageinfo.xsl =================================================================== --- trunk/demo/gallery/stylesheets/mergeimageinfo.xsl 2006-08-04 21:35:16 UTC (rev 39) +++ trunk/demo/gallery/stylesheets/mergeimageinfo.xsl 2006-08-05 01:04:33 UTC (rev 40) @@ -1,122 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> - -<!-- -Copyright (c) 2003 Nik Clayton -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -$Id: mergeimageinfo.xsl,v 1.3 2003/10/19 20:11:34 nik Exp $ ---> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version="1.0"> - - <xsl:variable name="cachedir" select="//config/perl-vars/[EMAIL PROTECTED]'GalleryCache']"/> - - <!-- XXX Assumes that the only thing that might need URI escaping is - the full path to the file (which might contain things like spaces). - Will fail to do the right thing if the cache root or the filename - contains spaces. --> - <xsl:template match="image"> - <xsl:variable name="imageinfo"> - <xsl:text>file://</xsl:text> - <xsl:value-of select="$cachedir"/> - <xsl:call-template name="url-encode"> - <xsl:with-param name="str" select="dirpath"/> - </xsl:call-template> - <xsl:text>/</xsl:text> - <xsl:value-of select="filename"/> - <xsl:text>/imageinfo.rdf</xsl:text> - </xsl:variable> - - <image> - <xsl:copy-of select="*|@*|node()"/> - <xsl:copy-of select="document($imageinfo)"/> - </image> - </xsl:template> - - <xsl:template match="*|@*"> - <xsl:copy> - <xsl:apply-templates select="*|@*|node()"/> - </xsl:copy> - </xsl:template> - - <!-- Following taken from http://skew.org/xml/stylesheets/url-encode/ --> - - <!-- ISO-8859-1 based URL-encoding demo - Written by Mike J. Brown, [EMAIL PROTECTED] - Updated 2002-05-20. - - No license; use freely, but credit me if reproducing in print. - - Also see http://skew.org/xml/misc/URI-i18n/ for a discussion of - non-ASCII characters in URIs. - --> - - <!-- Characters we'll support. - We could add control chars 0-31 and 127-159, but we won't. --> - <xsl:variable name="ascii"> !"#$%&'()*+,-./0123456789:;<=>[EMAIL PROTECTED]|}~</xsl:variable> - <xsl:variable name="latin1"> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:variable> - - <!-- Characters that usually don't need to be escaped --> - <xsl:variable name="safe">!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable> - - <xsl:variable name="hex" >0123456789ABCDEF</xsl:variable> - - <xsl:template name="url-encode"> - <xsl:param name="str"/> - <xsl:if test="$str"> - <xsl:variable name="first-char" select="substring($str,1,1)"/> - <xsl:choose> - <xsl:when test="contains($safe,$first-char)"> - <xsl:value-of select="$first-char"/> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="codepoint"> - <xsl:choose> - <xsl:when test="contains($ascii,$first-char)"> - <xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/> - </xsl:when> - <xsl:when test="contains($latin1,$first-char)"> - <xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/> - </xsl:when> - <xsl:otherwise> - <xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message> - <xsl:text>63</xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/> - <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/> - <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/> - </xsl:otherwise> - </xsl:choose> - <xsl:if test="string-length($str) > 1"> - <xsl:call-template name="url-encode"> - <xsl:with-param name="str" select="substring($str,2)"/> - </xsl:call-template> - </xsl:if> - </xsl:if> - </xsl:template> -</xsl:stylesheet>