Question

I am using SOAP Service connection to connect to a list in another sharepoint in the collection. (Sharepoint 2010)

All of the data comes over fine, except one field which is an image. The URLs all seem to have a , at the end.

<xsl:value-of select="@ows_Icon" disable-output-escaping="yes"/> 
or
<img border="0" src="{@ows_Icon}" />

Both return a URL like the following:

'https://www.site.com/directory/ico_people.jpg,'

Any idea how to remove the , so that I can show the image in the subsite?

Was it helpful?

Solution

This should do it:

<img border="0" src="{substring-before(@ows_Icon, ',')}" />

The comma is there because image fields have 2 fields associated with it, a URL and a description.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top