XSL Picture in table - image

I do read the relevant posts, but my code is still not working. I just want to add a avatar (png) to the players in my table.
My HTML:
<root version="2.0">
<game>
<players>
<nickname>thebeast</nickname>
<avatar><img src="/img/thebeast.png" height="30" width="30"></img></avatar>
<sum>220</sum>
</players>
<players>
<nickname>snowman</nickname>
<avatar><img src="/img/snowman.png" height="30" width="30"></img</avatar>
<sum>360</sum>
</players>
</game>
</root>
My table in xsl:
<table align = "center" border="transparent">
<tr><th>Nr.</th><th>Nickname</th><th>Collected <br/>Points</th></tr>
<xsl:for-each select = "//players">
<xsl:sort select = "sum" data-type="number" order="descending"/>
<tr>
<td><xsl:number value = "position()" format = "1."/></td>
<td><xsl:value-of select = "nickname"/></td>
<td><xsl:value-of select = "sum"/></td>
<td>
<img>
<xsl:attribute name="src">
<xsl:value-of select="/img" />
</xsl:attribute>
</img>
</td>
</tr>
</xsl:for-each>
</table>

Instead of:
<img>
<xsl:attribute name="src">
<xsl:value-of select="/img" />
</xsl:attribute>
</img>
try:
<img>
<xsl:attribute name="src">
<xsl:value-of select="avatar/img/#src" />
</xsl:attribute>
</img>
or, in short:
<img src="{avatar/img/#src}"></img>
Or, if you want to preserve the dimensions:
<xsl:copy-of select="avatar/img"/>

Related

Internal Onebox show more than 3 content

I am trying to show content more than 3 for internal provider for onebox on GSA 7.4 version. By default it shows up 3 only. There is a setting "Maximum number of OneBox results per search" is a not working. Is there any other way or may be by editing xml or xslt to show more than 3 content?
Any suggestion would be greatly appreciated!!
Thanks in Advance!!
Enclsoed please find my code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="projects">
<xsl:variable name="URLReplace">
<xsl:value-of select="replace(title/urlLink,'search','GSASearchResults.aspx')"/>
</xsl:variable>
<table border="0" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td valign="top" width="99%">
<xsl:for-each select="MODULE_RESULT">
<font size="-1">
<a>
<xsl:attribute name="href">
<xsl:value-of select="U"/>
</xsl:attribute>
<xsl:value-of select="Title"/>
</a>
</font>
<br/>
</xsl:for-each>
</td>
</tr>
<tr>
<td colspan="2">
<nobr>
<a>
<xsl:attribute name="href">
<!--<xsl:value-of select="title/urlLink"/>-->
<xsl:value-of select="$URLReplace"/>
<!--<xsl:value-of select="concat('GSASearchResults.aspx',substring-after(//title/urlLink,'search'))"></xsl:value-of>-->
</xsl:attribute>
<b>
<!--<xsl:value-of select="title/urlText"/>-->
<xsl:value-of select="/GSP/PARAM[#name='q']/#original_value"/>
Click for More.. <!--<xsl:value-of select="$qurl"/>-->
</b>
</a>
</nobr>
</td>
</tr>
</tbody>
</table>
</xsl:template>
</xsl:stylesheet>

XSLT dynamic sort using variables

I am trying to do dynamic sort based on values passed from the dropdown list. I am setting them as variables and using them in sort.
I am using XSLT version 1.0.
Below is the code:
test.php file -
<?php
mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('testxslt');
$xml = new SimpleXMLElement( "<?xml version='1.0' ?>\n".
"<?xml-stylesheet type='text/xsl' href='xml_stylesort.xsl' ?>\n".
"<items></items>");
$_POST['sort_by']='price_desc';
//for sorting
if(isset($_POST['sort_by']) && !empty($_POST['sort_by'])){
$arr = explode('_', $_POST['sort_by']);
if($arr[1] == "asc") $sortorder = 'ascending';
if($arr[1] == "desc") $sortorder = 'descending';
// xml_appendNode($objXmlDom, $objDocNode, "sortby",$arr[0]);
$xml->addChild( "sortby",$arr[0]);
$xml->addChild( "sortorder",$sortorder);
// xml_appendTextNode($objXmlDom, $objDocNode, "sortorder", $sortorder);
if($arr[0] == "price") $type = 'number';
else $type = 'text';
$xml->addChild( "sorttype", $type);
// xml_appendTextNode($objXmlDom, $objDocNode, "sorttype", $type);
}
$sql = mysql_query("select * from items") or die(mysql_error());
while($row=mysql_fetch_object($sql))
{
$item = $xml->addChild('item');
$item->addAttribute('id', $row->id);
$item->addChild('name', $row->name);
$item->addChild('qty', $row->qty);
$item->addChild('price', $row->price);
}
Header('Content-type: text/xml');
print($xml->asXML());
?>
xslt file:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="sortby">
<xsl:choose>
<xsl:when test="sortby != ''">
<xsl:value-of select="items/sortby" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'price'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="sorttype">
<xsl:choose>
<xsl:when test="sorttype != ''">
<xsl:value-of select="items/sorttype" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'text'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="sortorder">
<xsl:choose>
<xsl:when test="sortorder != ''">
<xsl:value-of select="items/sortorder" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'ascending'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="/">
<html>
<body>
<h2>Item List</h2>
<div style="margin:20px;">
<label>Sort by: | <xsl:value-of select="items/sortby" /> | <xsl:value-of select="items/sorttype" /> | <xsl:value-of select="items/sortorder" /> </label>
<form id="sortform" method="post">
<select name="sort_by" onchange="javascript:document.getElementById('sortform').submit();">
<option> Select </option>
<option value="price_asc">Price ASC</option>
<option value="price_desc">Price DESC</option>
<option value="name_asc">Name ASC</option>
<option value="name_desc">Name DESC</option>
</select>
</form>
</div>
<table border="1">
<tr bgcolor="#9acd32">
<th>Item</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
</tr>
<xsl:for-each select="items/item">
<xsl:sort data-type="{$sorttype}" select="*[name()=$sortby]" order="{$sortorder}" />
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="qty"/></td>
<td><xsl:value-of select="qty * price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I think the problem you are having is with the setting of your three variables at the start of your XSLT
<xsl:variable name="sortby">
<xsl:choose>
<xsl:when test="sortby != ''">
<xsl:value-of select="items/sortby" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'price'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
The condition for the xsl:when is not correct. It is looking for a sortby element under the document node, which doesn't exist, as the root element is actually items.
It should be the following:
<xsl:when test="items/sortby != ''">
Similarly for the other two variables.
As an aside, it looks like you are writing XML with an xsl:stylesheet processing instruction to do the transformation on the client. If you are PHP you should perhaps doing the transformation of the XML on the server, then just writing out the HTML result. That way you could get PHP to pass in the sort values as parameters, rather than appending them to the XML.
It's not possible to reproduce the problem using your code. The one thing that I see is that you are trying to sort by:
select="#*[name()=$sortby]"
but your product nodes have no attributes. Perhaps you mean to sort by:
select="*[name()=$sortby]"
?

Google Search Appliance XSLT header modification

I want to modify the XSLT in order to change home page header of the Google Search Appliance. I am unable to see my changes. I have done the following
included proxyreload=1 query parameter
Changed the home_page_header template to include my Hello world section.
<xsl:template name="home_page_header">
<input type="hidden" name="security_token" id="token">
<xsl:attribute name="value">
<xsl:value-of select="/GSP/SECURITY_TOKEN"/>
</xsl:attribute>
</input>
<table border="0" cellpadding="0" cellspacing="0">
<xsl:if test="$show_logo != '0'">
<tr>
<td rowspan="3" valign="top">
<xsl:call-template name="logo"/>
<xsl:call-template name="nbsp3"/>
</td>
</tr>
</xsl:if>
<xsl:if test="$show_top_search_box != '0'">
<tr>
<td valign="middle">
<xsl:call-template name="search_box">
<xsl:with-param name="type" select="'home'"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
</table>
<table>
<tr>
<td>Hello World</td>
</tr>
</table>
</xsl:template>
Any thoughts ?

XSL sort by title

I don't see the solution and hope someone can help me. I want to sort the result by title. But I don't know where and how to put the sort into the XSL file.
Can somebody help me?
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="TotalResults" />
<xsl:template match="NumberOfResults" />
<xsl:template name="DisplayString">
<xsl:param name="str" />
<xsl:if test='string-length($str) > 0'>
<xsl:value-of select="$str" />
</xsl:if>
</xsl:template>
<xsl:template name="HitHighlighting">
<xsl:param name="hh" />
<xsl:apply-templates select="$hh"/>
</xsl:template>
<xsl:template name="ResultPreviewToolTip">
<xsl:param name="contentclass" />
<xsl:param name="picturethumbnailurl" />
<xsl:param name="url" />
<xsl:param name="title" />
<xsl:param name="hithighlightedsummary" />
<xsl:param name="description" />
<xsl:param name="version" />
<xsl:choose>
<xsl:when test="$contentclass[. = 'STS_ListItem_PictureLibrary'] and $picturethumbnailurl[. != '']">
<div>
<a href="{$url}" title="{$title}">
<img src="{$picturethumbnailurl}" alt="" />
</a>
</div>
</xsl:when>
<xsl:when test="contains( $url, 'jpg' ) or contains( $url, 'jpeg' ) or contains( $url, 'gif' ) or contains( $url, 'JPG' ) or contains( $url, 'JPEG' ) or contains( $url, 'GIF' )">
<div>
<img src="/_layouts/AssetUploader.aspx?Size=Medium&ImageUrl={$url}" alt="" />
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:choose>
<xsl:when test="$hithighlightedsummary[. != '']">
<b>Preview:</b>
<br/>
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="$hithighlightedsummary" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$description[. != '']">
<b>Preview:</b>
<br/>
<xsl:value-of select="$description"/>
</xsl:when>
<xsl:otherwise>
No preview available
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="DisplayString">
<xsl:with-param name="str" select="$version" />
<xsl:with-param name="text" select="'Version: '" />
<xsl:with-param name="stringcolor" select="'#808080'" />
</xsl:call-template>
</div >
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Result">
<xsl:variable name="tdClass">
<xsl:if test="(position() mod 2 = 0)">
<xsl:value-of select="'even'" />
</xsl:if>
<xsl:if test="(position() mod 2 = 1)">
<xsl:value-of select="'odd'" />
</xsl:if>
</xsl:variable>
<tr>
<td class="{$tdClass}">
<a href="#" class="tooltip">
<img>
<xsl:attribute name="src">
<xsl:value-of select="imageurl"/>
</xsl:attribute>
</img>
<span>
<xsl:call-template name="ResultPreviewToolTip">
<xsl:with-param name="contentclass" select="contentclass" />
<xsl:with-param name="description" select="description" />
<xsl:with-param name="hithighlightedsummary" select="hithighlightedsummary" />
<xsl:with-param name="picturethumbnailurl" select="picturethumbnailurl" />
<xsl:with-param name="title" select="title" />
<xsl:with-param name="url" select="url" />
<xsl:with-param name="version" select="version" />
</xsl:call-template>
</span>
</a>
</td>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="url" disable-output-escaping="yes" />
</xsl:attribute>
<xsl:value-of select="filename"/>
</a>
</td>
<td class="{$tdClass}">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url" disable-output-escaping="yes" />
</xsl:attribute>
<xsl:choose>
<xsl:when test="doctitle != ''">
<xsl:value-of select="doctitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</a>
</td>
<td class="{$tdClass}">
<xsl:choose>
<xsl:when test="docauthor != ''">
<xsl:value-of select="docauthor"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="author"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="{$tdClass}">
<xsl:value-of select="revisiondate" />
</td>
<td class="{$tdClass}">
<xsl:value-of select="doclanguage"/>
</td>
<td class="{$tdClass}">
<a>
<xsl:attribute name="href">
<xsl:value-of select="sitename" disable-output-escaping="yes" />
</xsl:attribute>
<img src="/_layouts/images/breadcrumbbutton.png" style="border-style: none" />
</a>
<xsl:call-template name="ShowVersionHistory" />
</td>
</tr>
</xsl:template>
<xsl:template name="ShowVersionHistory">
<!-- First, encode Url -->
<xsl:variable name="EncodedUrl">
<xsl:value-of disable-output-escaping="yes" select="ddwrt:UrlEncode(url)" />
</xsl:variable>
<!-- does only work for office docuemnts -->
<xsl:if test="string-length(serverredirectedurl) > 0">
<!-- get web url from office web app link -->
<xsl:variable name="WebUrl">
<xsl:value-of select="substring-before(serverredirectedurl, '_layouts')"/>
</xsl:variable>
<!-- create link -->
<xsl:variable name="FinalLink">
<xsl:value-of select="$WebUrl"/>
<xsl:text>_layouts/Versions.aspx?FileName=</xsl:text>
<xsl:value-of select="$EncodedUrl"/>
</xsl:variable>
<a href="{$FinalLink}" target="_blank" Title="Version History">
<img src="/_layouts/images/versions.gif" style="border-style: none" />
</a>
</xsl:if>
</xsl:template>
<xsl:template match="/">
<table class="searchresult">
<tr>
<th width="18"></th>
<th>Filename</th>
<th>Title</th>
<th>Author</th>
<th>Revision Date</th>
<th>Language</th>
<th>Actions</th>
</tr>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="TotalResults" />
<xsl:template match="NumberOfResults" />
<xsl:template name="DisplayString">
<xsl:param name="str" />
<xsl:if test='string-length($str) > 0'>
<xsl:value-of select="$str" />
</xsl:if>
</xsl:template>
<xsl:template name="HitHighlighting">
<xsl:param name="hh" />
<xsl:apply-templates select="$hh"/>
</xsl:template>
<xsl:template name="ResultPreviewToolTip">
<xsl:param name="contentclass" />
<xsl:param name="picturethumbnailurl" />
<xsl:param name="url" />
<xsl:param name="title" />
<xsl:param name="hithighlightedsummary" />
<xsl:param name="description" />
<xsl:param name="version" />
<xsl:choose>
<xsl:when test="$contentclass[. = 'STS_ListItem_PictureLibrary'] and $picturethumbnailurl[. != '']">
<div>
<a href="{$url}" title="{$title}">
<img src="{$picturethumbnailurl}" alt="" />
</a>
</div>
</xsl:when>
<xsl:when test="contains( $url, 'jpg' ) or contains( $url, 'jpeg' ) or contains( $url, 'gif' ) or contains( $url, 'JPG' ) or contains( $url, 'JPEG' ) or contains( $url, 'GIF' )">
<div>
<img src="/_layouts/AssetUploader.aspx?Size=Medium&ImageUrl={$url}" alt="" />
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:choose>
<xsl:when test="$hithighlightedsummary[. != '']">
<b>Preview:</b>
<br/>
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="$hithighlightedsummary" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$description[. != '']">
<b>Preview:</b>
<br/>
<xsl:value-of select="$description"/>
</xsl:when>
<xsl:otherwise>
No preview available
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="DisplayString">
<xsl:with-param name="str" select="$version" />
<xsl:with-param name="text" select="'Version: '" />
<xsl:with-param name="stringcolor" select="'#808080'" />
</xsl:call-template>
</div >
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Result">
<xsl:variable name="tdClass">
<xsl:if test="(position() mod 2 = 0)">
<xsl:value-of select="'even'" />
</xsl:if>
<xsl:if test="(position() mod 2 = 1)">
<xsl:value-of select="'odd'" />
</xsl:if>
</xsl:variable>
<tr>
<td class="{$tdClass}">
<a href="#" class="tooltip">
<img>
<xsl:attribute name="src">
<xsl:value-of select="imageurl"/>
</xsl:attribute>
</img>
<span>
<xsl:call-template name="ResultPreviewToolTip">
<xsl:with-param name="contentclass" select="contentclass" />
<xsl:with-param name="description" select="description" />
<xsl:with-param name="hithighlightedsummary" select="hithighlightedsummary" />
<xsl:with-param name="picturethumbnailurl" select="picturethumbnailurl" />
<xsl:with-param name="title" select="title" />
<xsl:with-param name="url" select="url" />
<xsl:with-param name="version" select="version" />
</xsl:call-template>
</span>
</a>
</td>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="url" disable-output-escaping="yes" />
</xsl:attribute>
<xsl:value-of select="filename"/>
</a>
</td>
<td class="{$tdClass}">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url" disable-output-escaping="yes" />
</xsl:attribute>
<xsl:choose>
<xsl:when test="doctitle != ''">
<xsl:value-of select="doctitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</a>
</td>
<td class="{$tdClass}">
<xsl:choose>
<xsl:when test="docauthor != ''">
<xsl:value-of select="docauthor"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="author"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="{$tdClass}">
<xsl:value-of select="revisiondate" />
</td>
<td class="{$tdClass}">
<xsl:value-of select="doclanguage"/>
</td>
<td class="{$tdClass}">
<a>
<xsl:attribute name="href">
<xsl:value-of select="sitename" disable-output-escaping="yes" />
</xsl:attribute>
<img src="/_layouts/images/breadcrumbbutton.png" style="border-style: none" />
</a>
<xsl:call-template name="ShowVersionHistory" />
</td>
</tr>
</xsl:template>
<xsl:template name="ShowVersionHistory">
<!-- First, encode Url -->
<xsl:variable name="EncodedUrl">
<xsl:value-of disable-output-escaping="yes" select="ddwrt:UrlEncode(url)" />
</xsl:variable>
<!-- does only work for office docuemnts -->
<xsl:if test="string-length(serverredirectedurl) > 0">
<!-- get web url from office web app link -->
<xsl:variable name="WebUrl">
<xsl:value-of select="substring-before(serverredirectedurl, '_layouts')"/>
</xsl:variable>
<!-- create link -->
<xsl:variable name="FinalLink">
<xsl:value-of select="$WebUrl"/>
<xsl:text>_layouts/Versions.aspx?FileName=</xsl:text>
<xsl:value-of select="$EncodedUrl"/>
</xsl:variable>
<a href="{$FinalLink}" target="_blank" Title="Version History">
<img src="/_layouts/images/versions.gif" style="border-style: none" />
</a>
</xsl:if>
</xsl:template>
<xsl:template match="/">
<table class="searchresult">
<tr>
<th width="18"></th>
<th>Filename</th>
<th>Title</th>
<th>Author</th>
<th>Revision Date</th>
<th>Language</th>
<th>Actions</th>
</tr>
<xsl:apply-templates />
</table>
</xsl:template>
</xsl:stylesheet>
You have to add <xsl:sort> (see: w3schools: xsl:sort Element).
It should be added to your xsl:apply-templates element (or if you would use xsl:for-each, then there).

How do I test if image exists for a field in xslt?

I have a form where a field is an image which is uploaded, which works fine. I now want to check to see if an image exists for that field and if not display a default no image
I have for now
<xsl:if test="fields/field_item_main_image/data/#original = ''"><span class="noimage"></span></xsl:if><xsl:copy-of select="fields/field_item_main_image/data" />
The span for no image simply provides a no image png file to be shown inplace of an image when none exists, but this is not working as the default image is not being shown, even though the field has no image assigned to it.
Looking at the source code the result is
<data></data>
What am I doing wrong?
ADDITIONAL INFO
I'd like to add more info but really not sure what you want me to add to help me... let me know what is needed and I will see if I can get that info for you to help me.
The relevant class style is
.noimage {display:block;width:100px;height:100px;background-image: url(../images/no-image-available.png);}
This is related to SobiPro a Joomla Compontent
Here is the form code
<div>
<xsl:for-each select="entry/fields/*">
<xsl:if test="( name() != 'save_button' ) and ( name() != 'cancel_button' )">
<xsl:variable name="fieldId">
<xsl:value-of select="data/*/#id" />
</xsl:variable>
<div id="{$fieldId}Container">
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="position() mod 2">spFormRowEven</xsl:when>
<xsl:otherwise>spFormRowOdd</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="string-length( fee )">
<div class="spFormPaymentInfo">
<input name="{$fieldId}Payment" id="{$fieldId}Payment" value="" type="checkbox" class="SPPaymentBox" onclick="SP_ActivatePayment( this )"/>
<label for="{$fieldId}Payment">
<xsl:value-of select="fee_msg"></xsl:value-of><br/>
</label>
<div style="margin-left:20px;">
<xsl:value-of select="php:function( 'SobiPro::Txt', 'TP.PAYMENT_ADD' )" />
</div>
</div>
</xsl:if>
<div class="spFormRowLeft">
<label for="{$fieldId}">
<xsl:choose>
<xsl:when test="string-length( description )">
<xsl:variable name="desc">
<xsl:value-of select="description" />
</xsl:variable>
<xsl:variable name="label">
<xsl:value-of select="label" />
</xsl:variable>
<xsl:value-of select="php:function( 'SobiPro::Tooltip', $desc, $label )" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="label"/>
</xsl:otherwise>
</xsl:choose>
</label>
</div>
<div class="spFormRowRight">
<xsl:choose>
<xsl:when test="data/#escaped">
<xsl:value-of select="data" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="data/*" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text><xsl:value-of select="#suffix"/>
</div>
</div>
</xsl:if>
</xsl:for-each>
</div>
As part of the input one of my fields is an image field, it is that field I am wanting to check to see if a user has uploaded an image to that field, if they have then show that image, if not then show a default no image.
Does any of this help?
GW
If the default image for that field does not change, then I would do all of this on the client side.
Take a look at this answer to do that.

Resources