0

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.

1 Answer 1

4
<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

Sign up to request clarification or add additional context in comments.

3 Comments

When I do: <xsl:value-of select="MyImage" /> it outputs the above, so how do I do it from there?
can you supply the xml for me to see. is the above data xml or a string in a xml node?
try now - replaced with &quot;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.