I am trying to style some results returned from the search webservice in 2010 with this stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<span>Matched root node</span>
<div id="pSearchWrapper">
<span>div pSearchWrapper</span>
<xsl:call-template name="searchResults" />
</div>
</xsl:template>
<xsl:template name="searchResults">
<span>search Results Template</span>
<xsl:for-each select="ResponsePacket/Response/Range/Results/Document" >
<div class="individualResult">
<xsl:call-template name="resultCard" />
</div>
</xsl:for-each>
</xsl:template>
<xsl:template name="resultCard">
<xsl:variable name="pictureUrl" select="Properties/Property[starts-with(Name,'PICTUREURL')]/Value" />
<div class="peoplePic" >
<img>
<xsl:attribute name="src">
<xsl:value-of select="$pictureUrl" />
</xsl:attribute>
</img>
</div>
</xsl:template>
Here is a snippet of the xml I am trying to style:
<ResponsePacket xmlns="urn:Microsoft.Search.Response">
<Response>
<Range>
<StartAt>1</StartAt>
<Count>9</Count>
<TotalAvailable>9</TotalAvailable>
<Results>
<Document xmlns="urn:Microsoft.Search.Response.Document">
<Action>
<LinkUrl fileExt="aspx">http://mysites.domain.com/Person.aspx?accountname=blahblah</LinkUrl>
</Action>
<Properties xmlns="urn:Microsoft.Search.Response.Document.Document">
<Property>
<Name>TITLE</Name>
<Type>String</Type>
<Value>User</Value>
</Property>
<Property>
<Name>PATH</Name>
<Type>String</Type>
<Value>http://mysites.domain.com/Person.aspx?accountname=blahblahR</Value>
</Property>
<Property>
<Name>WRITE</Name>
<Type>DateTime</Type>
<Value>2013-05-07T06:59:07</Value>
</Property>
<Property>
<Name>RANK</Name>
<Type>Int64</Type>
<Value>0</Value>
</Property>
<Property>
<Name>SIZE</Name>
<Type>Int64</Type>
<Value>0</Value>
</Property>
<Property>
<Name>PICTUREURL</Name>
<Type>String</Type>
<Value>http://mysites.domain.com/User Photos/Profile Pictures/blahblah.jpg</Value>
</Property>
<Property>
<Name>PREFERREDNAME</Name>
<Type>String</Type>
<Value>User</Value>
</Property>
<Property>
<Name>WORKPHONE</Name>
<Type>String</Type>
<Value>69342</Value>
</Property>
<Property>
<Name>WORKEMAIL</Name>
<Type>String</Type>
<Value>[email protected]</Value>
</Property>
</Properties>
</Document>
</Results>
</Range>
<Status>SUCCESS</Status>
</Response>
The stylesheet renders up until the for-each loop. I tried this with an apply-templates call and it failed at basically the same point. This leads me to believe that there is something wrong in the path specified in the select attribute. Any help would be greatly appreciated.
BTW: I am transfoming the xml through a javascript call.