在变量中插入一些东西
我将所有内容存储在变量中。当我收到此消息时,我需要将路径附加到我想要的令牌。 路径是路径=/;域名=.myorg.com ;
WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; sessiontoken=DstTDbgX0ydK/nAixEvkBQCHrZ5CAar2DGq55U0Mo/6ll1+XEad3/cWyeXdO6hwmBePreLIW5d4CaoxiZHMEwuI5faG1j0UeRNizNJAw8JqEI0HuhpdpY5qSO46Iz+8WffmQoyemD/eQnWMkCeJb MwMHGIebSh7Q9mfC7wqoMqr+28IoeOYM93pPqVVwTiGOXEmiWdcp1S6WTKyw17E06S0GDLA8eZlFFxFksgGtQiqsmp2vevWvz2dpmYYUPZ6TK3+vsNjkV2urGj24DHIrFGgU5J2eJq9qNEdEatsu H71TJ6R0pyVK6h4FpaT1p5KurkdAZlIOl/Rpuzw2rnDNVJgW4PzWkeKIjoDDhlUhZ2cM4nNBoHqMGCz2HkwwbU72QVTzzXgwhOXtjrUlaaoZA==; WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; NonceToken=61AF4E4A72A6749A8525787E0071880F; spinkerAcceptLanguages=en-us%2Cen%3Bq%3D0.5; spinkerStringLocale=zh; spinkerStyleLocale=en
在上面的事情中,我想将路径附加到 WasToken 的任何重复位置,因此在附加路径之后,它必须变成
tLr+BuYEMPTX;路径=/;域名=.myorg.com ; sessiontoken=DstTDbgX0ydK/nAixEvkBQCHrZ5CAar2DGq55U0Mo/6ll1+XEad3/cWyeXdO6hwmBePreLIW5d4CaoxiZHMEwuI5faG1j0UeRNizNJAw8JqEI0HuhpdpY5qSO46Iz+8WffmQoyemD/eQnWMkCeJb MwMHGIebSh7Q9mfC7wqoMqr+28IoeOYM93pPqVVwTiGOXEmiWdcp1S6WTKyw17E06S0GDLA8eZlFFxFksgGtQiqsmp2vevWvz2dpmYYUPZ6TK3+vsNjkV2urGj24DHIrFGgU5J2eJq9qNEdEatsu H71TJ6R0pyVK6h4FpaT1p5KurkdAZlIOl/Rpuzw2rnDNVJgW4PzWkeKIjoDDhlUhZ2cM4nNBoHqMGCz2HkwwbU72QVTzzXgwhOXtjrUlaaoZA==; WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX;路径=/;域名=.myorg.com ; NonceToken=61AF4E4A72A6749A8525787E0071880F; spinkerAcceptLanguages=en-us%2Cen%3Bq%3D0.5; spinkerStringLocale=zh; spinkerStyleLocale=en
如何使用 xsl 执行此操作。
I have the whole thing stored in variable. when I receive this, I need to append the path to token which token I wish.
path is path=/; domain=.myorg.com ;
WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; sessiontoken=DstTDbgX0ydK/nAixEvkBQCHrZ5CAar2DGq55U0Mo/6ll1+XEad3/cWyeXdO6hwmBePreLIW5d4CaoxiZHMEwuI5faG1j0UeRNizNJAw8JqEI0HuhpdpY5qSO46Iz+8WffmQoyemD/eQnWMkCeJbMwMHGIebSh7Q9mfC7wqoMqr+28IoeOYM93pPqVVwTiGOXEmiWdcp1S6WTKyw17E06S0GDlLA8eZlFFxFksgGtQiqsmp2vevWvz2dpmYYUPZ6TK3+vsNjkV2urGj24DHIrFGgU5J2eJq9qNEdEAtsuH71TJ6R0pyVK6h4FpaT1p5KurkdAZlIOl/Rpuzw2rnDNVJgW4PzWkeKIjoDDhlUhZ2cM4nNBoHqMGCz2HkwwbU72QVTzzXgwhOXtjrUlaaoZA==; WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; NonceToken=61AF4E4A72A6749A8525787E0071880F; spikerAcceptLanguages=en-us%2Cen%3Bq%3D0.5; spikerStringLocale=en; spikerStyleLocale=en
In the above thing I want to append path to WasToken wherever it is repeating so after appending path it must become
WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; path=/; domain=.myorg.com ; sessiontoken=DstTDbgX0ydK/nAixEvkBQCHrZ5CAar2DGq55U0Mo/6ll1+XEad3/cWyeXdO6hwmBePreLIW5d4CaoxiZHMEwuI5faG1j0UeRNizNJAw8JqEI0HuhpdpY5qSO46Iz+8WffmQoyemD/eQnWMkCeJbMwMHGIebSh7Q9mfC7wqoMqr+28IoeOYM93pPqVVwTiGOXEmiWdcp1S6WTKyw17E06S0GDlLA8eZlFFxFksgGtQiqsmp2vevWvz2dpmYYUPZ6TK3+vsNjkV2urGj24DHIrFGgU5J2eJq9qNEdEAtsuH71TJ6R0pyVK6h4FpaT1p5KurkdAZlIOl/Rpuzw2rnDNVJgW4PzWkeKIjoDDhlUhZ2cM4nNBoHqMGCz2HkwwbU72QVTzzXgwhOXtjrUlaaoZA==; WasToken=AAECAzREQjgyNTY3NERCODI2Q0Zjbj1zYmswMi9vdT1iaG5zbS9vdT1pc2hzZy9vdT1kaXZhZG1pbi9vPWRvaANcWzW6mcn5IzHXtLr+BuYEMPTX; path=/; domain=.myorg.com ; NonceToken=61AF4E4A72A6749A8525787E0071880F; spikerAcceptLanguages=en-us%2Cen%3Bq%3D0.5; spikerStringLocale=en; spikerStyleLocale=en
How to do this using xsl.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XSLT 不太擅长递归和字符串操作,而这两者都需要,但这是可能的。这是我的解决方案(如果您可以确定某些字符串模式(例如,如果“WasToken”始终位于字符串的开头),则可能有比必要的更多的条件):
XSLT is not very good at recursion and string manipulation, and this requires both, but it is possible. Here is my solution (which may have more conditions than necessary if you can be assured of certain string patterns (e.g. if "WasToken" is always at the beginning of the string)):