These aren't images, they are only text. You need to put them in an img tag in order to have them parsed by HTML as an image.
You don't need to use the preg replace at all here. CDATA blocks are an XML indicator for textual data that will not be parsed by the XML processor. Images are a bit of a pain in xsl, so I'll break this down as smaller template matches:
Code:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="weathertest.xsl"?>
<data>
<weather>
<date>Today</date>
<weatherIconUrl>
<![CDATA[
http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png
]]>
</weatherIconUrl>
</weather>
<weather>
<date>Tomorrow</date>
<weatherIconUrl>
<![CDATA[
http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png
]]>
</weatherIconUrl>
</weather>
</data>
Data above assumed on the xslt you have.
My weathertest.xsl:
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="data">
<table>
<tr>
<xsl:apply-templates />
</tr>
</table>
</xsl:template>
<xsl:template match="weather">
<td>
<p><xsl:value-of select="./date" /></p>
<p><xsl:apply-templates select="./weatherIconUrl" /></p>
</td>
</xsl:template>
<xsl:template match="weatherIconUrl">
<img>
<xsl:attribute name="src">
<xsl:value-of select="." />
</xsl:attribute>
</img>
</xsl:template>
</xsl:stylesheet>
And all done. I didn't bother with PHP in this case, but its results should be the same.