Return-Path: Delivered-To: apmail-jakarta-taglibs-dev-archive@jakarta.apache.org Received: (qmail 2534 invoked by uid 500); 12 Jul 2001 18:18:21 -0000 Mailing-List: contact taglibs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: taglibs-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list taglibs-dev@jakarta.apache.org Received: (qmail 99497 invoked from network); 12 Jul 2001 18:11:42 -0000 Received: from smtp014.mail.yahoo.com (216.136.173.58) by h31.sny.collab.net with SMTP; 12 Jul 2001 18:11:42 -0000 Received: from host62-6-113-32.host.btclick.com (HELO lndevjs) (62.6.113.32) by smtp.mail.vip.sc5.yahoo.com with SMTP; 12 Jul 2001 18:11:43 -0000 X-Apparently-From: Message-ID: <03d001c10afd$f0a4cb60$9865fea9@spiritsoft.com> From: "James Strachan" To: References: Subject: Re: String taglib proposal Date: Thu, 12 Jul 2001 19:10:29 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi Bay Those look great so far. This library looks a good place for other text based escape tags too - like escaping HTML, XML, URLs and so on. James ----- Original Message ----- From: To: Sent: Thursday, July 12, 2001 5:14 PM Subject: Re: String taglib proposal > > Great to get a positive response :) > > I agree that the syntax is nicer. I will make a move > towards that. > After a quick peek at scrape and regexp, I don't think I impinge too > heavily on them. Maybe one or two functions that would be better served > in their libraries. > > Following James' advice I will list the tags I currently have implemented. > The only difference being that I will get rid of the action attribute and > create a more explicit tld. > > Here goes: > > xx > - Turns body into uppercase > > XX > - Lowercases all letters in the body > > XX > - Removes whitespace from the start and end of the body > > XX > - Get a substring from the body. > > XX > - Titlecase the first character of the body. > > XX > - Replace a part of the body with another string. > > XX > - Repeat the body - 5 times. > > XX > - Center the body in a string of width 20, using spaces as a delimiter > > XX > - Remove the last newline, and everything after it from the body > > XX > - Get everything after the last newline in the body > > XX > - Remove the first newline, and everything before it in the body > > XX > - Get everything before the first newline in the body > > XX > - Remove the last character from the body. Will remove a \r if it's > before a \n. Not sure if this is needed in Java however. > > XX > - Remove last character if it's a newline. > > XX > - Count the occurences of any letters in the set. > So Abracadabra would return 7. Case sensitive. > > XX > - Delete any occurences of letters passed in the set. > So Abracadabra => Ardr. Case sensitive. > > XX > - Remove any multiple instances of characters in the passed in set. > So Abracadabra is unchanged. However, abbr would become abr. > Case sensitive. > > XX > - Java escape the string. So tabs goto \t etc. > > XX > - Right pad to a width of 20 with spaces. > > XX > - Left pad to a width of 20 with spaces. > > XX > - Reverse the body. > > XX > - Strip the body of spaces on both sides. Equivalent to trim, > but delimiter is settable. > > XX > - Swap the case of all characters in the body. > > XX > - Translate any instances of characters in 'replace' with the > corresponding character in 'with'. > > XX > - Strip spaces from the end of the body. > > XX > - Strip spaces from the start of the body. > > XX > - Return the soundex. > > XX > - Return the metaphone. > > XX > - Quote any regexp characters. So: ? -> \? > > XX > - Titlecase any characters in the body that are preceded by > a whitespace or the start of the body. > > XX > - Word-wrap the body to a width of 80. Using a delimiter of \n and > using a - to split words if need be. > > XX > - Get the string that is nested in between 'pre' and 'post'. > ie) In a body of: Someprethingpost. The above tag would > evaluate to 'thing'. > > XX > - How many times is the substring 'he' mentioned in the body. > > XX > - If the body is the string null, then print n/a. > > XX > - Remove any <..> tags from the body. > > XX > - Replace the first 5 instances of hen with hou. > > // XX > - todo. just not around to coding. > // XX > - todo. unsure how to pass in an iterator, list, etc. Not sure if it > really fits in a taglib. > > > As for uploading the code, I can stick a jar on my website whenever people > think is best. Currently I think I should probably move from using action > before putting anything up. > > Thanks, > > Bay > > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com