This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:str="http://exslt.org/strings" | |
| exclude-element-prefixes="str"> | |
| <!-- | |
| Name: Twita@talinkahashifyer (`linkahashify`) | |
| Description: An XSLT port of Dustin Diaz's Twita@talinkahashifyer JavaScript function to format a tweet a la Twitter.com | |
| Version: 0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" xmlns:math="http://exslt.org/math" extension-element-prefixes="date math"> | |
| <xsl:template name="time-ago"> | |
| <xsl:param name="date-and-time"/> | |
| <xsl:variable name="now" select="concat($today, 'T', $current-time, ':00')" /> | |
| <xsl:variable name="minutes" select="date:seconds(date:difference($date-and-time, $now)) div 60" /> | |
| <xsl:variable name="delta-minutes" select="math:abs($minutes)" /> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" xmlns:math="http://exslt.org/math" extension-element-prefixes="date math"> | |
| <!-- | |
| Name: Time Ago | |
| Version: 1.3 | |
| Author: Nick Dunn <[email protected]> | |
| URL: http://symphony-cms.com/downloads/xslt/file/20484/ | |
| Parameters: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <!-- | |
| Suffix | |
| =============================================================================== | |
| Puts a suffix after a number: | |
| 1 becomes 1st | |
| 5 becomes 5th | |
| 302 becomes 302nd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <!-- | |
| Example Call | |
| <xsl:call-template name="substring-count"> | |
| <xsl:with-param name="haystack" select="'the quick brown fox jumps over the lazy dog'" /> | |
| <xsl:with-param name="needle" select="'the'" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:string="http://symphony-cms.com/functions" | |
| xmlns:_string="http://symphony-cms.com/functions" | |
| xmlns:func="http://exslt.org/functions" | |
| extension-element-prefixes="func"> | |
| <!-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <!-- | |
| Example call | |
| <xsl:call-template name="string-replace"> | |
| <xsl:with-param name="haystack" select="item" /> | |
| <xsl:with-param name="search" select="'ab'" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:template name="smart-resize-image"> | |
| <xsl:param name="xml" /> <!-- Incoming XML node --> | |
| <xsl:param name="max-w" select="300"/> <!-- Max Width (default = 300) --> | |
| <xsl:param name="max-h" select="400"/> <!-- Max Height (default = 400) --> | |
| <xsl:param name="alt" select="'image'"/> <!-- Alt value (optional, default = 'image') --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <!-- | |
| Zero Digit | |
| ======================================================================= | |
| Version: 0.1 | |
| Author: Giel Berkers | |
| Website: www.gielberkers.com | |
| E-mail: [email protected] | |
| Description: Adds leading zero's to the digit n times. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:exsl="http://exslt.org/common" | |
| extension-element-prefixes="exsl"> | |
| <!-- | |
| A complete XML to JSON transformation utility adapted from |