XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 27th, 2009, 09:28 AM
zach8202 zach8202 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2009
Posts: 1 zach8202 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 9 sec
Reputation Power: 0
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">
<xslutput method="html" indent="no"/>
<xsl:decimal-format NaN=""/>
<xslaram name="dvt_apos">'</xslaram>
<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">
<xslaram 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>
<xsltherwise>
<img src="/_layouts/images/no_pic.gif" alt="{$fullname}" border="0"
/>
</xsltherwise>
</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>

Reply With Quote
  #2  
Old May 27th, 2009, 01:56 PM
jkmyoung jkmyoung is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 576 jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 3 h 58 m 24 sec
Reputation Power: 55
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > StyleSheet Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT