<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: lowercase code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 07:36:48 GMT</pubDate>
    <description>DZone Snippets: lowercase code</description>
    <item>
      <title>Using XSLT to convert a value to upper or lowercase</title>
      <link>http://snippets.dzone.com/posts/show/5160</link>
      <description>This code was copied from &lt;a href="http://www.topxml.com/xsl/articles/caseconvert/"&gt;XSLT Case Conversion Solution &lt;/a&gt; [topxml.com]&lt;br /&gt;&lt;br /&gt;Firstly lets place all the letters of the alphabet, lower case and upper case in variables.&lt;br /&gt;&lt;code&gt;&lt;xsl:variable name="lcletters"&gt;abcdefghijklmnopqrstuvwxyz&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="ucletters"&gt;ABCDEFGHIJKLMNOPQRSTUVWXYZ&lt;/xsl:variable&gt;&lt;/code&gt;&lt;br /&gt;To then convert our data to upper case we use the translate method, which replaces all the lower case characters with upper case.&lt;br /&gt;&lt;code&gt;&lt;xsl:value-of select="translate($toconvert,$lcletters,$ucletters)"/&gt;&lt;/code&gt;&lt;br /&gt;Lower Case Transformation&lt;br /&gt;&lt;br /&gt;The lower case transformation is basically the same:&lt;br /&gt;&lt;code&gt;&lt;xsl:value-of select="translate($toconvert,$ucletters,$lcletters)"/&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 21 Feb 2008 20:20:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5160</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Create strings for SEO-friendly URLs</title>
      <link>http://snippets.dzone.com/posts/show/4579</link>
      <description>this method returns string, which is perfect for SEO-friendly URLs. &lt;br /&gt;&lt;br /&gt;features: &lt;br /&gt;- converts every improper character to a hyphen&lt;br /&gt;- returns a lowercase string&lt;br /&gt;&lt;br /&gt;I POSTED AN EVEN BETTER METHOD ON MY BLOG: http://tinyurl.com/2vurbq&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def create_callname (title)&lt;br /&gt;	title.downcase.gsub(/[^a-z0-9]+/i, '-')&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 27 Sep 2007 11:53:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4579</guid>
      <author>labuschin (Martin Labuschin)</author>
    </item>
    <item>
      <title>Convert extensions of files to lowercase using perl</title>
      <link>http://snippets.dzone.com/posts/show/4186</link>
      <description>1. Searches for files having uppercase extensions (can be mixed with numbers and can be multipart eg: TAR.BZ2 ). &lt;br /&gt;   It does not detect files whose extensions contain both upper and lower cases.  This is intentional, as if you have part of extension lowercase, you probably intentionally left the other part upper case. Changing this behaviour is trivial. Replace that complex (?:[A-Z]*[0-9]*\.*) with a . (a dot). &lt;br /&gt;&lt;br /&gt;2. It then converts them to lowercase.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;$files=`ls`;&lt;br /&gt;@files=split(/\n/,$files);&lt;br /&gt;foreach (@files) {&lt;br /&gt;    if(/(.*)\.((?:[A-Z]*[0-9]*\.*)+)$/) {&lt;br /&gt;        $name=$1."."."\L$2\E";&lt;br /&gt;        system("mv $_ $name")&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Looks quite ugly, but this is what I could do with the Perl I know, and more importantly, it works (at least in my case)!</description>
      <pubDate>Thu, 21 Jun 2007 18:16:09 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4186</guid>
      <author>sundaryourfriend (Sundara Raman)</author>
    </item>
  </channel>
</rss>
