Click here to Skip to main content
12,406,098 members (76,775 online)

Web Development

 
GeneralRe: SMTP Programming Pin
Richard MacCutchan11-Dec-12 10:58
mvpRichard MacCutchan11-Dec-12 10:58 
GeneralRe: SMTP Programming Pin
DisIsHoody11-Dec-12 11:20
memberDisIsHoody11-Dec-12 11:20 
QuestionXSLT Transforms - how to get just some of in a for-each Pin
QuickBooksDev8-Dec-12 2:26
memberQuickBooksDev8-Dec-12 2:26 
AnswerRe: XSLT Transforms - how to get just some of in a for-each Pin
Chris Grove13-Dec-12 19:46
memberChris Grove13-Dec-12 19:46 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
QuickBooksDev17-Dec-12 0:42
memberQuickBooksDev17-Dec-12 0:42 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
Chris Grove17-Dec-12 3:43
memberChris Grove17-Dec-12 3:43 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
QuickBooksDev17-Dec-12 4:55
memberQuickBooksDev17-Dec-12 4:55 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
Chris Grove17-Dec-12 5:43
memberChris Grove17-Dec-12 5:43 
Hi,
not sure if this is any help, I have used this to produce a student timetable grid. It does not do anything fancy at all, but it does use params and nested templates. It's quite old now and i'm sure it could be improved no end but it works well and might be of interest.

Chris

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>
	<xsl:template match="/">
    
	<!-- root template -->
	<xsl:if test="pupil/details[count(.) != 0]">
      <h1>Week A</h1>
      <table class="ec-gridview" width="100%">
        <xsl:apply-templates select="pupil/details [@weekCode='A'][1]" mode="weekheader"/>
        <xsl:apply-templates select="pupil/details [@weekCode='A'][1]" mode="weekdata">
          <xsl:with-param name="week">A</xsl:with-param>
        </xsl:apply-templates>
      </table>
      <xsl:apply-templates select="pupil/details [@weekCode='A'][1]" mode="ott">
        <xsl:with-param name="week">A</xsl:with-param>
      </xsl:apply-templates>
      
 
      <h1>Week B</h1>
      <table class="ec-gridview" width="100%">
        <xsl:apply-templates select="pupil/details [@weekCode='B'][1]" mode="weekheader"/>
        <xsl:apply-templates select="pupil/details [@weekCode='B'][1]" mode="weekdata">
          <xsl:with-param name="week">B</xsl:with-param>
        </xsl:apply-templates>
      </table>
      <xsl:apply-templates select="pupil/details [@weekCode='B'][1]" mode="ott">
        <xsl:with-param name="week">B</xsl:with-param>
      </xsl:apply-templates>
    </xsl:if>
  </xsl:template>
  
  <!-- week data template -->
  <xsl:template match="details" mode="weekheader">
    <tr class="ec-gridrow-header">
      <th class="ec-gridheader" scope="col" style="width:5%;text-align:center"></th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Mon</th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Tue</th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Wed</th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Thu</th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Fri</th>
      <th class="ec-gridheader" scope="col" style="width:16%;text-align:center">Sat</th>
    </tr>
  </xsl:template>
  
  <!-- week data template -->
  <xsl:template match="details" mode="weekdata">
    <xsl:param name="week"/>
        <!-- add the period data-->
        <tr class="ec-odd-line">
          <td class="ms-vb" style="vertical-align:text-top;text-align:center">
            <span class="ms-rteCustom-ArticleHeadLine">1</span>
          </td>
          <xsl:apply-templates select="//details[@lessonNumber='1' and @weekCode=$week]" mode="p1-6"/>
        </tr>
        <tr class="ec-even-line">
          <td class="ms-vb" style="vertical-align:text-top;text-align:center">
            <span class="ms-rteCustom-ArticleHeadLine">2</span>
          </td>
          <xsl:apply-templates select="//details[@lessonNumber='2' and @weekCode=$week]" mode="p1-6"/>
        </tr>
		<!-- Some code removed for brevity -->
	</xsl:template>
 
  <xsl:template match="details" mode="ott">
    <xsl:param name="week"/>
    <xsl:if test="count(//details [@lessonNumber > 299 and @weekCode=$week]) != 0">
      <h1 class="ms-rteCustom-ArticleHeadLine">Lessons not on the timetable</h1>
      <xsl:for-each select="//details [@lessonNumber > 299 and @weekCode=$week]">
        <a>
          <xsl:attribute name="href">
            ../Information/Set/SetLists.aspx?IsetCode=<xsl:value-of select="@setCode"/>
          </xsl:attribute>
          <xsl:value-of select="@setCode"/>
        </a> (<xsl:value-of select="@subjectName"/>) <xsl:value-of select="@description"/>
 
      </xsl:for-each>
    </xsl:if>
  </xsl:template>
  
  
  
	<!--period data template-->
	<xsl:template match="details" mode="p1-6">
		<xsl:for-each select=".">
			<td style="vertical-align:text-top;text-align:center;min-height:60px;">
				<xsl:attribute name="class">
					<xsl:choose>
						<xsl:when test="@currentLesson = 'Y'">ms-vb-cp</xsl:when>
						<xsl:when test="@setCode = 'BLANK'">
							<xsl:choose>
								<xsl:when test ="@dayIndex = '1' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '2' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '3' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '4' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '5' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '6' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '8' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '9' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '10' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '11' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '12' and @lessonNumber = '6'">ms-vb-empty</xsl:when>
								<xsl:when test ="@dayIndex = '13' and (@lessonNumber = '5' or @lessonNumber = '6')">ms-vb-empty</xsl:when>
								<xsl:otherwise>ms-vb</xsl:otherwise>
							</xsl:choose>
						</xsl:when>
						<xsl:otherwise>ms-vb</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
				<xsl:choose>
					<xsl:when test="@setCode != 'BLANK'">
						<xsl:value-of select="@subjectName"/>
						
 
						<a>
							<xsl:attribute name="href">
								../Information/Set/SetLists.aspx?IsetCode=<xsl:value-of select="@setCode"/>
							</xsl:attribute>
							<xsl:value-of select="@setCode"/>
						</a>
 
						
 
						<a>
							<xsl:attribute name="href">
								../Information/Room/RoomDetails.aspx?IroomCode=<xsl:value-of select="@room"/>
							</xsl:attribute>
							Room <xsl:value-of select="@room"/>
						</a>
						
 
						<xsl:for-each select="teacher">
							<xsl:value-of select="@teacher"/>
							
 
						</xsl:for-each>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text xml:space="preserve"> </xsl:text>
						
 
						<xsl:text xml:space="preserve"> </xsl:text>
						
 
						<xsl:text xml:space="preserve"> </xsl:text>
						
 
						<xsl:text xml:space="preserve"> </xsl:text>
						
 
					</xsl:otherwise>
				</xsl:choose>
			</td>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

QuestionPop Up JQuery Quick Link Pin
Janiel Major5-Dec-12 22:02
memberJaniel Major5-Dec-12 22:02 
AnswerRe: Pop Up JQuery Quick Link Pin
vbmike7-Dec-12 4:09
membervbmike7-Dec-12 4:09 
AnswerRe: Pop Up JQuery Quick Link Pin
ryanb3112-Dec-12 4:41
memberryanb3112-Dec-12 4:41 
Question[HELP] Whois can using PHP to generate this one? Pin
jimmy.suharry4-Dec-12 21:37
memberjimmy.suharry4-Dec-12 21:37 
AnswerRe: [HELP] Whois can using PHP to generate this one? Pin
S.M. Zamshed Farhan12-Jan-13 5:54
memberS.M. Zamshed Farhan12-Jan-13 5:54 
QuestionTool for big WEB project with huge loads Pin
Junoli2-Dec-12 9:37
memberJunoli2-Dec-12 9:37 
AnswerRe: Tool for big WEB project with huge loads Pin
Richard A. Abbott2-Dec-12 10:47
memberRichard A. Abbott2-Dec-12 10:47 
Questionselect an item in gridview Pin
ptvce2-Dec-12 1:50
memberptvce2-Dec-12 1:50 
AnswerRe: select an item in gridview Pin
Richard MacCutchan2-Dec-12 3:00
mvpRichard MacCutchan2-Dec-12 3:00 
Questioni php question Pin
gamaan1-Dec-12 4:00
membergamaan1-Dec-12 4:00 
AnswerRe: i php question Pin
gamaan1-Dec-12 4:03
membergamaan1-Dec-12 4:03 
AnswerRe: i php question Pin
S.M. Zamshed Farhan12-Jan-13 6:03
memberS.M. Zamshed Farhan12-Jan-13 6:03 
QuestionHTML Pin
DivyamS30-Nov-12 19:35
memberDivyamS30-Nov-12 19:35 
AnswerRe: HTML Pin
S.M. Zamshed Farhan15-Jan-13 4:21
memberS.M. Zamshed Farhan15-Jan-13 4:21 
Questionthe protocol 'net.pipe' is not supported-WCF Pin
mallikharjuna22128-Nov-12 0:50
membermallikharjuna22128-Nov-12 0:50 
AnswerRe: the protocol 'net.pipe' is not supported-WCF Pin
Richard A. Abbott28-Nov-12 1:38
memberRichard A. Abbott28-Nov-12 1:38 
GeneralRe: the protocol 'net.pipe' is not supported-WCF Pin
mallikharjuna22128-Nov-12 2:34
membermallikharjuna22128-Nov-12 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160726.1 | Last Updated 28 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid