⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toview_e.xsl

📁 implementation of survey
💻 XSL
字号:
<?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" version="4.0" encoding="iso-8859-1" indent="yes"/>

	<xsl:template match="/">
	<div style="text-align:center;">			
				<xsl:apply-templates select="survey" />
	</div>				
	</xsl:template>

	
	<xsl:template match="survey">
		<xsl:apply-templates select="surveyInfo" />
		<xsl:apply-templates select="sectionsBody" />
	</xsl:template>
	
	<xsl:template match="surveyInfo">
		<xsl:apply-templates select="surveyName_E" />
		<xsl:variable name="descrip" select="surveyDescrip" />
		<xsl:if test="not(string-length($descrip)=0)">
			<xsl:apply-templates select="surveyDescrip" />
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="surveyName_E">	
		<h1 id="surveyID" style="color:#FF6666; text-align:center; font-variant:small-caps; font-family:Georgia, 'Times New Roman', Times, serif;"><xsl:value-of select="." /></h1>
	</xsl:template>

	<xsl:template match="surveyDescrip">	
		<p id="surveyID" style="color:#999999; text-align:left; margin-left:20px; font-family:Georgia, 'Times New Roman', Times, serif;">survey description: <xsl:value-of select="." /></p>
	</xsl:template>	
	
	<xsl:template match="sectionsBody">
	<div style="border:1px solid #97C49C; margin-top:30; text-align:center; background-color:#E9FCE2; width:950px;">		
		<div name="sectionBody" style="margin-top:20;  width:900px; text-align:center;">
	
			<xsl:apply-templates select="sectionItem">
				<xsl:sort select="@id" data-type="number" order="ascending" />
			</xsl:apply-templates>
	
		</div>
	</div>
		<p style="text-align:center;">
	    <input class="btn" id="makingReport" align="middle" type="button" style="margin-right:15" value="Analyze" onclick="generatingReport()"/>
		<input class="btn" id="viewingReport" align="middle" type="button" style="margin-right:15" value="Report" onclick="viewResult()"/>
		<input class="btn" id="transferLanguage" align="middle" type="button" style="margin-right:15" value="French" onclick="languageTransfer()"/>
		<input class="btn" align="middle" id="saveFilledout" type="button" style="margin-right:15;display:none;" value=" asd " onclick="timeout_save(collectInfo())"/>						
		<input class="btn" align="middle" type="button" style="margin-right:15" value=" Save " onclick="save(collectInfo())"/>
      <input class="btn" align="middle" id="submitReport" type="button" style="margin-right:15" value="Submit" onclick="recordSurvey(collectInfo())"/>
		<input class="btn" align="middle" type="button"  value="  Exit  " onclick="window.close()"/>
		</p>
	</xsl:template>
	
	<xsl:template match="sectionItem" >
			<h2 style="margin-left:25px; color:#FF6666"><xsl:value-of select="@text" /></h2>
			<br />
			<xsl:apply-templates select="question">
				<xsl:sort select="question/control/order" order="ascending" data-type="number" >
				</xsl:sort>
			</xsl:apply-templates>
			<br />
	</xsl:template>
	
	<xsl:template match="question" >
		<xsl:variable name="voter" select="control/questionType" />
		<xsl:variable name="topic" select="@id" />
		<div style="text-align:center; border-bottom: 1px solid #0F9745; padding-bottom:50px; padding-left:20px; padding-right:20px;">
			<h3 style="color:#0066FF; text-align:left">
						<font color="brown">Q<xsl:value-of select="position()"/>-</font> 
						<xsl:apply-templates select="questionTitle" />
						<xsl:if test="control/must = -1"> <font color="#00CC00">*</font></xsl:if>
			</h3>
						<xsl:if test="contains($voter, 'List of check boxes')" >
								<div style="margin-bottom:20px">
										<xsl:for-each select="answers/answer/answer_E" >
												<div style="width:665px; text-align:left">
													<input align="left" type="checkbox" name="{@id}" id="{./@id}" style="margin-left:20" />
													<xsl:value-of select="." />
												</div>			
										</xsl:for-each>
								</div>
						</xsl:if>

						<xsl:if test="contains($voter, 'List of text boxes')" >
									<div style="margin-bottom:10px">
											<xsl:for-each select="answers/answer/answer_E" >
													<div align="left" style="width:663px;" >
															<label style="margin-left:20"><xsl:value-of select="." /></label>
															<div style="margin-bottom:5">
																<Textarea name="textlist" id ="{./@id}" size="98" rows="1" cols="75" align="left" wrap="hard"  style="margin-left:20; margin-bottom:40; margin-right:20; overflow:auto " onkeydown="limitText(this)" />
															</div>
													</div>
							
											</xsl:for-each>
									</div>
						</xsl:if>
												
						
						<xsl:if test="contains($voter, 'grid')" >
							<div style="margin-bottom:20px">
										<xsl:apply-templates select="answers" />
							</div>
						</xsl:if>	
														
						
						<xsl:if test="contains($voter,'Textarea')" >
								<div  style="margin-bottom:20px">
									<Textarea name="textarea" id="{answers/answer/answer_E/@id}" size="120" rows="3" cols="75" wrap="hard" style="overflow:auto" onkeydown="limitText(this)" />
								</div>
						</xsl:if>
						
						<xsl:if test="contains($voter, 'Drop-down list')" >
							<div style="margin-bottom:20px">
									<select name="dropdown" id="{answers/@id}" style="width:625; margin-left:20; margin-right:20; margin-bottom:30; " >									<option style="size:50" value="0">No Select </option>
														<xsl:for-each select="answers/answer/answer_E" >
																<xsl:variable name="choice" select="." />
																<option style="size:50"  value='{$choice}' >
																		<xsl:value-of select="$choice" />
																</option>
														</xsl:for-each>
									</select>
							</div>
						</xsl:if>
						
						
						<xsl:if test="contains($voter, 'radio list') " >
									<div style="margin-bottom:20px"> 
											<xsl:for-each select="answers/answer/answer_E" >
							            
													   <div style="width:665px; text-align:left">
															<input type="radio" name="{$topic}" id="{./@id}" />
															<xsl:value-of select="." />
													   </div>
											</xsl:for-each>
									</div>
						</xsl:if>		
						
								

		</div>
	</xsl:template>
	
	
	
	
	


	
	
	<xsl:template match="answers" >
	<div style="margin-bottom:20px">
			<xsl:variable name="rankSet" select="gridRanks/rank_E/rank" />
			<xsl:variable name="nullSet" select="gridRanks/rank_E/rank[. = '']" />
			<xsl:variable name="num" select="count($rankSet)" />
			<xsl:variable name="nullNum" select="count($nullSet)" />
			<xsl:variable name="inputType" select="gridRanks/@rankType" />
			
			<table align="center" width="800" style="border-style:solid; border-width:thin; text-align:left">
				<tr><td bgcolor="#CCFF33"><xsl:value-of select="$inputType"/></td>
					<xsl:for-each select="gridRanks/rank_E/rank">
						<td><xsl:value-of select="." /></td>
					</xsl:for-each>
				</tr>
					<xsl:for-each select="answer/answer_E">
					<tr>
						<td><xsl:value-of select="."/></td>
						<xsl:if test="$inputType = 'radio'">
								<xsl:call-template name="insertRadioRow">
									<xsl:with-param name="times"><xsl:value-of select="$num - $nullNum" /></xsl:with-param>
									<xsl:with-param name="fixedTimes"><xsl:value-of select="$num - $nullNum+1" /></xsl:with-param>
									<xsl:with-param name="answerId"><xsl:value-of select="@id" /></xsl:with-param>
								</xsl:call-template>
						</xsl:if>
								
						<xsl:if test="$inputType = 'check'">
								<xsl:call-template name="insertCheckRow">
									<xsl:with-param name="times"><xsl:value-of select="$num - $nullNum" /></xsl:with-param>
									<xsl:with-param name="fixedTimes"><xsl:value-of select="$num - $nullNum+1" /></xsl:with-param>
									<xsl:with-param name="answerId"><xsl:value-of select="@id" /></xsl:with-param>
								</xsl:call-template>
						</xsl:if>
						
						<xsl:if test="$inputType = 'text'">
								<xsl:call-template name="insertTextRow">
									<xsl:with-param name="times"><xsl:value-of select="$num - $nullNum" /></xsl:with-param>
									<xsl:with-param name="fixedTimes"><xsl:value-of select="$num - $nullNum+1" /></xsl:with-param>
									<xsl:with-param name="answerId"><xsl:value-of select="@id" /></xsl:with-param>
								</xsl:call-template>
						</xsl:if>								
								
								

					</tr>
				</xsl:for-each>
			</table>
			</div>
	</xsl:template>
	
	<xsl:template name="insertRadioRow">
			<xsl:param name="times"/>
			<xsl:param name="fixedTimes"/>
			<xsl:param name="answerId" />
			<xsl:if test="$times>0">
					<xsl:variable name="rankSN" select="$fixedTimes - $times" />
					<td>
						<input type="radio" name="{$answerId}{position()}" id="{$answerId}rank{$rankSN}"/>
					</td>
					<xsl:call-template name="insertRadioRow">
							<xsl:with-param name="times" select="$times - 1"/>
							<xsl:with-param name="fixedTimes" select="$fixedTimes"/>
							<xsl:with-param name="answerId" select="$answerId"/>
					</xsl:call-template>
			</xsl:if>
	</xsl:template>
	
	<xsl:template name="insertCheckRow">
			<xsl:param name="times"/>
			<xsl:param name="fixedTimes"/>
			<xsl:param name="answerId" />
			<xsl:if test="$times>0">
					<xsl:variable name="rankSN" select="$fixedTimes - $times" />
					<td><input type="checkbox" name="{position()}" id="{$answerId}rank{$rankSN}"/></td>
					<xsl:call-template name="insertCheckRow">
						<xsl:with-param name="times" select="$times - 1"/>
						<xsl:with-param name="fixedTimes" select="$fixedTimes"/>
						<xsl:with-param name="answerId" select="$answerId"/>
					</xsl:call-template>
			</xsl:if>
	</xsl:template>

	<xsl:template name="insertTextRow">
			<xsl:param name="times"/>
			<xsl:param name="fixedTimes"/>
			<xsl:param name="answerId" />
			<xsl:if test="$times>0">
					<xsl:variable name="rankSN" select="$fixedTimes - $times" />
					<td><input type="text" width="1" size="1" maxlength="12" name="{position()}" id="{$answerId}rank{$rankSN}"/>
					<!--name:<xsl:value-of select="(position())"/>-id:<xsl:value-of select="$times" />-->
					</td>
					<xsl:call-template name="insertTextRow">
							<xsl:with-param name="times" select="$times - 1"/>
							<xsl:with-param name="fixedTimes" select="$fixedTimes"/>
						<xsl:with-param name="answerId" select="$answerId"/>
					</xsl:call-template>
			</xsl:if>
	</xsl:template>	
	
	
	
	
	
	
	
	<xsl:template match="gridRanks" >
		<xsl:apply-templates select="rank" />
	</xsl:template>
	<xsl:template match="rank" >
				  <td><xsl:value-of select="." /></td>
	</xsl:template>
	
	
	
	
	
	
	<xsl:template match="answer" >
			<xsl:apply-templates select="answer_E" />
	</xsl:template>
	<xsl:template name="answer_E" match="answer_E" >
		<td><xsl:value-of select="." /></td>
	</xsl:template>
	

	
	
	
	
	<xsl:template match="questionTitle">
			<xsl:apply-templates select="question_E" />
	</xsl:template>
	<xsl:template match="question_E">
			<xsl:value-of select="." />
	</xsl:template>


	
	
	
	
	
</xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -