I have two pieces of data I need to merge. One field is an XML blob that holds URL's. The second field holds the label for those URL's. I need to display this in a web form, but cannot display a huge URL.
Field 1
<string>www.google.com</string>
<string>www.yahoo.com</string>
Field 2
Google,Yahoo
The result I need is to be able to generate an html link with the label in Field 2.
So the result I want is a string that looks like this
<a href="http://www.google.com">Google</a><br><a href="http://www.yahoo.com">Yahoo</a>
and so forth...
The example I have is something like this:
select  replace(cast(cast(replace(AnswerValue,  'xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"','') as xml).query('
                                for $string in //ArrayOfstring/string
                                return <a href="{data($string)}" target="_blank">TEST</a>       ') as nvarchar(max)), '</a>', '</a><br>') as AttachedDocuments
How can I achieve this? Is it possible?
 
     
    