Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Need help formatting a picture using data view and xslt

  Asked By: Bridget Wagner         Date: Apr 30, 2006      Category: Sharepoint      Views: 365
 

I used the GetListItems web service from SharePoint to create a data
source in Front Page. One of the fields is formatted as a picture and
is called ows_photo. The format of the data in that field appears to
be url, description.. How do I parse the content and then display it
as a picture?

The original code when inserted into a dataview:
<td class="ms-vb" height="42"><xsl:value-of
select="@ows_Photo"/></td>
and appears like this:
http://thechannel/_layouts/images/no_pic.gif,
http://thechannel/_layouts/lzcustom/images/employeephotos/SACON.jpg

I parsed it like this:
<td class="ms-vb" height="42"><a><xsl:variable name="linktext"
select="@ows_Photo"/><xsl:attribute name="href"><xsl:value-of
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="substring-
after($linktext,', ')"/></xsl:attribute><xsl:value-of
select="substring-before($linktext,', ')"/></a></td>
and it appears like this:
http://thechannel/_layouts/images/no_pic.gif

When I try to format it as a picture, I get an error message:
FrontPage cannot reender the XSLT in this data view.
Failed setting processor stylesheet:0x80004005: A reference to
variable or parameter 'linktext' cannot be resolved. The variable or
parameter may not be defined, or it may not be in scope.


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:                  

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Need help formatting a picture using data view and xslt Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].