tags:

views:

224

answers:

1

one of my elements from xml is an image and

when i do <xsl:value-of select="MyImage" /> it outputs this as the data

<img alt="" border=0 src="/PublishingImage/myPic.jpg" style="border:0px solid">

using xslt can i extract just the src bit so that i have /PublishingImage/myPic.jpg without the quotes.

+4  A: 
<xsl:value-of select="img/@src" />

for a string inside an xml node try this

<xsl:value-of select="substring-before(substring-after(MyImage, 'src=&quot;'), '&quot;')" />

Josh

Josh
When I do: <xsl:value-of select="MyImage" /> it outputs the above, so how do I do it from there?
raklos
can you supply the xml for me to see. is the above data xml or a string in a xml node?
Josh
string in an xml node
raklos
see updated answer for a string inside an xml node.
Josh
i think the quote marks are causing it to break
raklos
try now - replaced with "
Josh