How can I replace a string with a link in xslt? E.g. if the string contains www or http:// it should make it to a link..
but there is probably no way to change the link text to something else without writing the full html code or use a datatype which allow inserting of links..
Thanks for your feedback :) I expiment with the Tabular Data package in some product specifications.. where I want to include a link to the producent website.
This require more to work, but can I do a test on the string, so it not takes all words, e.g. if I write in the datatype table cell: Here is a link to www.google.com .. so it's only www.google.com which will be a link..?
it's not the most important thing, but it would be nice to have the possibility to include other words... perhaps something like it should start the link where www og http:// starts and then end the link after a space..
Replace text with a link
Hi..
How can I replace a string with a link in xslt?
E.g. if the string contains www or http:// it should make it to a link..
but there is probably no way to change the link text to something else without writing the full html code or use a datatype which allow inserting of links..
Bjarne
Hi Bjarne
Let's say that the text is placed in a variable called $text.Then something like this should do the trick:
I hope that helps :)
/Kim A
Hi Kim
Thanks for your feedback :)
I expiment with the Tabular Data package in some product specifications.. where I want to include a link to the producent website.
With your help it works now: http://sub.ak-security.dk/da/shop/lygter/led-lenser-p7.aspx
Bjarne
Cool, great to hear that Bjarne.
I'm glad I could help :)
/Kim Andersen
Hi Kim
This require more to work, but can I do a test on the string, so it not takes all words, e.g. if I write in the datatype table cell: Here is a link to www.google.com .. so it's only www.google.com which will be a link..?
it's not the most important thing, but it would be nice to have the possibility to include other words... perhaps something like it should start the link where www og http:// starts and then end the link after a space..
Right now I only have a link here: http://sub.ak-security.dk/da/shop/lygter/led-lenser-p7.aspx under the Specifikationer tab to the manufacturer.
Bjarne
is working on a reply...