I am trying to extract text from XML similar to the following:
<p>This is a paragraph <a href='http://link.com'>with an embedded link</a> with more text afterwards</p>
I would like the extracted text to maintain the URL within the the paragraph, like this:
This is a paragraph with an embedded link (http://link.com) with more text afterwards
It is fairly straight forward to extract the text:
<xsl:value-of select="p"/> and the URL: <xsl:value-of select="p/a/@href"/>, but I am struggling to think of a way to embed the URL within the extracted text using XSLT.
Any ideas on how this can be done?
If there is no easy way to do this I may end up either doing some pre-processing of the text to embed the URL and just use XSLT to extract all the text from there.