Created
November 12, 2008 04:12
-
-
Save ku/24083 to your computer and use it in GitHub Desktop.
xpath replace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = document.forms[0]["data[imageSource]"]; | |
var exp = i.value; | |
function f (exp) { | |
var [x,s,r] = exp.split(/\s*,\s*/); | |
return 'concat( substring-before('+x+',"'+s+'"), "'+r+'", substring-after('+x+',"'+s+'"))'; | |
} ; | |
i.value = f(exp); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment