I am new to xsl, so what I want to do..is just to return a character by index.
In java i Know that if I have got a String like "Java"
if I do "Java".subString(0,1) that will give me J, and if I do "Java".subString(1,2), that will give me a, but for xsl it doesn't work like that. perhaps is there any other method that I can use besides substring....thanks for your help guys
XPath does have a substring function, and you can use it in XSLT. However it's a function, not a method, and its first parameter is the string which you want to get part of.
Did you not find any documentation at all about this function? In general it's faster to google for documented information like this rather than waiting for somebody on a forum to tell you it, or to get a book about the subject. Or was that not your question? You didn't really tell us anything specific about what you didn't understand.
yes I googled it, bt it doesn't work the way I expected it to...found sumthing like subString("Java",1,1); which return J, but what if you want a, is the sumthing like ("Java",1,2); sumthing that will just return a...and so on
Yes, it takes the substring index and the length of the substring, instead of the start and end index like the Java String method does. As Paul suggests, googling for something like "xslt substring function" will get you the documentation.
What's that smell? I think this tiny ad may have stepped in something.
Free, earth friendly heat - from the CodeRanch trailboss