[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Java to xslt conversion

Subject: Java to xslt conversion
From: sudheshna iyer <sudheshnaiyer@xxxxxxxxx>
Date: Wed, 29 Sep 2010 02:42:38 -0700 (PDT)
 Java to xslt conversion
I have below java code. I need to convert to xslt. How do i achieve this?
Requirement: 
If (first name + last name) exceeds 50 char, then use (first char of first name + complete last name) and create ErrorMessage indicating that name got truncated.


String strFirstName = "";
String strLastName = "";
StringBuffer ErrorMessage = new StringBuffer("");

StringBuffer name = new StringBuffer(strFirstName);
name.append(" " + strLastName);

if(name.length() > NAME_LEN){

//Build the name
name.delete(0, name.length());
name.append(strFirstName.substring(0,1) + " " + strLastName.substring(0));

//Name = name.substring(0,NAME_LEN);
if(name.length() > NAME_LEN)
    Name = name.substring(0,NAME_LEN);   
else 
    Name = name.substring(0,name.length());

ErrorMessage = ErrorMessage.append("Name= " + strFirstName + " " + strLastName + ",");
} else{
Name = name.toString();
}

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.