替换或附加到链接
我正在开发一个旧的 Sitecore 4 解决方案,我需要稍微操纵一个字段的输出。我有一个普通字段(消息),我通过
或
.
两者都可以正常工作。
我现在必须在“消息”字段中搜索链接,然后我需要将日期附加到链接的末尾,如下所示“这是我的链接
我如何在 XSLT 1.0 中完成上述任务?
I am working on an old Sitecore 4 solution where i need to manipulate the output of a field slightly. I have a normal field (Message) that i am outputting via <sc:html field="message"/>
or <xsl:value-of select="sc:fld('Message',.)"/>
.
Either works just fine.
I now have to search in the "Message" field for links, and then i need to append the date to the end of the link like so "<a href="http://www.thisismydomain.com?utm_campaign=01-01-2011">this is my link</a>
How could i accomplish the above in XSLT 1.0?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的理解是你想要查找并将网址转换为链接。
我认为这些是您的选择:
1. Xpath 2.0支持使用正则表达式的匹配和替换等功能。请参阅http://www.w3schools.com/xpath/xpath_functions.asp#string 或 http://www.w3.org/TR/xpath-functions/#func-replace。我不确定 sitecore 是否支持 Xpath 2.0。根据我的记忆,我认为它不支持 Xpath 2.0。如果确实如此,那么您很幸运,您可以
事情的目的是什么:
My understanding is that you want to do a find and convert urls to links.
I see these as your Options:
1. Xpath 2.0 supports functions like matches and replace which use regular expressions. See http://www.w3schools.com/xpath/xpath_functions.asp#string or http://www.w3.org/TR/xpath-functions/#func-replace. I'm not sure if sitecore supports Xpath 2.0. From memory i dont think it supports Xpath 2.0. If it does you are in luck and you can do something similar like this
Things to what out for: