0

I am using the following code to display image using XSLT in Sharepoint. It is working fine.

<xsl:value-of select="@Image">

But this approach doesn't allow me to define width and height of image so I tried to use it like this but it didn't work.

<img src="{@Image}" width="100" height="100">

How to make it work?

1
  • If you do a <xsl:value-of select="@Image" /> what is output? Nov 20, 2013 at 20:38

2 Answers 2

1

It depends how the @Image is defined, it will sometimes come through with a description separated by a comma.

If this is the case then you could try substring-before:

<img src="{substring-before(@Image,',')}" width="100" height="100">
0

Looks like some folks on Stack Overflow asked a similar question https://stackoverflow.com/questions/45904/how-do-you-add-an-image-in-xslt

Few choices over there to try. Good luck.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.