Project

Profile

Help

index-of not working

Added by Anonymous about 19 years ago

Legacy ID: #3248221 Legacy Poster: Curtis (cdfisher07)

Still trying to solve this problem of shaving quotes and junk off of a string like this: "Asian_Cuisine/Yakisoba.htm"); The regex function replace cannot be made to work for double quotes, and the index-of will not return a value either. I use substring($indexLines[4],2,index-of($indexLines[4],";") - 2 ) to try to trim the ends off of these strings and the index-of will not find any character within the string. Any ideas? Thanks, Curtis Fisher


Replies (3)

Please register to reply

RE: index-of not working - Added by Anonymous about 19 years ago

Legacy ID: #3248252 Legacy Poster: Michael Kay (mhkay)

I have every confidence that the replace() function CAN be made to work for double quotes. index-of() searches for a string within a sequence of strings (or for any value within a sequence of values). It doesn't look for a substring of a string. For that, you can use the old XPath 1.0 approach: string-length(substring-before($x, $y)) Michael Kay

RE: index-of not working - Added by Anonymous about 19 years ago

Legacy ID: #3248290 Legacy Poster: Curtis (cdfisher07)

Well, if the replace function can be made to work, I can't seem to do it. Thanks for the explanation. I thought that might be the case with the index-of, it cannot locate a particular character within a string. I'll try something else. XSL makes string manipulation very hard.

RE: index-of not working - Added by Anonymous about 19 years ago

Legacy ID: #3248304 Legacy Poster: Michael Kay (mhkay)

Regular expressions are fiddly to get right, but very powerful. If you'd like to explain what you tried that didn't work, I can try and help you fix it.

    (1-3/3)

    Please register to reply