0

what would be the XSL function to replace the string. For example i have a string 'Dallas County' and i want to replace 'County' with '' (i.e. empty string)

Note that im using XSL 1.0

LP13
  • 25,900
  • 45
  • 172
  • 339
  • There isn't such a function in XSLT 1.0, you would have to use a recursive template. See http://stackoverflow.com/questions/7520762/xslt-1-0-string-replace-function/7523245#7523245 as an example. – Tim C Jul 21 '14 at 22:18
  • You may also refer http://stackoverflow.com/questions/3067113/xslt-string-replace which has multiple implementation examples – Navin Rawat Jul 22 '14 at 06:47

1 Answers1

0

In this particular case, if you know that the string ends with the unwanted sequence of characters, you could use substring, or substring-before, to chop off the unwanted suffix. See http://www.w3.org/TR/xpath/#section-String-Functions

keshlam
  • 7,821
  • 1
  • 17
  • 33