File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Separating String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Separating String" Watch "Separating String" New topic

Separating String

Tushar Kherde
Ranch Hand

Joined: Apr 28, 2006
Posts: 56
Hi All,

I faceing problem in separating String using XSL
eg. countryShortName i wnt to split this string like
Country Short Name

Please Help

Dave Lenton
Ranch Hand

Joined: Jan 20, 2005
Posts: 1241
It'll be a bit messy, but you can use a combination of the string functions contains(), substring-before() and substring-after() to break a string up... but it could get nasty if the only thing you are using to tokenise the string is to look for upper case letters.

There will be glitches in my transition from being a saloon bar sage to a world statesman. - Tony Banks
vinay kumar
Ranch Hand

Joined: Sep 23, 2006
Posts: 31
here is the code.

(replace greaterthan symbol in if condition with ampersandGTsemicolon )

output of above code: country Short Name

[ October 02, 2006: Message edited by: vinay kumar ]
Tushar Kherde
Ranch Hand

Joined: Apr 28, 2006
Posts: 56
Thanks Vinay and Dave

Its working fine.

I agree. Here's the link:
subject: Separating String
It's not a secret anymore!