|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
StyleSheet Help
All,
I am 100% brand new to xml. I've got this stylesheet below that lists user profiles one per row so I have one column vertically down the page. I would like to be able to list the profiles, say, 4 per row. Anyone know what needs to be done to manipulate the stylesheet below to accomplish this? Thanks! <xsl:stylesheet xmlns:soap="(URL)" xmlns:ddw1="(URL)/webservices/OfficeServer/QueryService" xmlns:xs="(URL)" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="(URL)" xmlns:asp="(URL)" xmlns:__designer="(URL)" xmlns:xsl="(URL )" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"> <xsl utput method="html" indent="no"/><xsl:decimal-format NaN=""/> <xsl aram name="dvt_apos">'</xsl aram><xsl:variable name="dvt_1_automode">0</xsl:variable> <xsl:template match="/"> <xsl:call-template name="dvt_1"/> </xsl:template> <xsl:template name="dvt_1"> <xsl:variable name="dvt_StyleName">Table</xsl:variable> <xsl:variable name="Rows" select="/soap:Envelope/soap:Body/ddw1:QueryExResponse/ddw1:QueryExResult/diffgr:diffgram/Results/RelevantResults"/> <xsl:variable name="dvt_RowCount" select="count($Rows)" /> <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" /> <xsl:call-template name="dvt_1.body"> <xsl:with-param name="Rows" select="$Rows"/> </xsl:call-template> </xsl:template> <xsl:template name="dvt_1.body"> <xsl aram name="Rows"/><xsl:for-each select="$Rows"> <xsl:call-template name="dvt_1.rowview" /> </xsl:for-each> </xsl:template> <xsl:template name="dvt_1.rowview"> <xsl:variable name="fullname" select="PREFERREDNAME" /> <xsl:variable name="url" select="PATH"/> <xsl:variable name="email" select="WORKEMAIL"/> <xsl:variable name="pictureurl" select="PICTUREURL"/> <xsl:variable name="phone" select="WORKPHONE" /> <xsl:variable name="prefix">IMNRC('</xsl:variable> <xsl:variable name="suffix">')</xsl:variable> <table class="psrch-result" CELLPADDING="0" CELLSPACING="0" BORDER="0" width="100%"> <tr> <td class="psrch-imgcell" width="0%"> <table class="psrch-profimg" CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="77px" HEIGHT="77px"> <tr> <td align="middle" valign="middle"> <a href="{$url}" title="{$url}"> <xsl:choose> <xsl:when test="$pictureurl[. != '']"> <img src="{$pictureurl}" alt="{$fullname}" border="0" /> </xsl:when> <xsl therwise><img src="/_layouts/images/no_pic.gif" alt="{$fullname}" border="0" /> </xsl therwise></xsl:choose> </a> </td> </tr> </table> </td> <td valign="top" class="psrch-propcell" width="100%"> <span class="psrch-Title"> <img border="0" valign="middle" height="12" width="12" src="/_layouts/images/imnhdr.gif" onload ="IMNRC('{$email}')" id="{generate-id()}" ShowOfflinePawn="1"/> <a href="{$url}" > <xsl:value-of select="$fullname"/> </a> </span> <br/> <div class="psrch-Description"> <span class="psrch-Metadata"> <a href="mailto:{$email}" > <xsl:value-of select="$email"/> </a> </span> </div> <div class="psrch-Description"> <span class="psrch-Metadata"> <xsl:value-of select="$phone"/> </span> </div> </td> </tr> </table> </xsl:template> </xsl:stylesheet> |
|
#2
|
|||
|
|||
|
In your for-each, limit it to only the first in each column add condition: [position() mod 4 = 1]
Then in the template you call, get the other 3 cells in the row, by using "following-sibling::*[position() < 4]" I'm not sure if it'll work properly with your use of the variable. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > StyleSheet Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|