šablona/stránka.xsl
changeset 46 c4ad66b1202e
parent 45 f52b3bb8cfcc
child 49 0be359e4c06f
equal deleted inserted replaced
45:f52b3bb8cfcc 46:c4ad66b1202e
   212     	-->
   212     	-->
   213     	<xsl:message>Stahuji vycpávkový text z http://lipsum.lipsum.com/</xsl:message>
   213     	<xsl:message>Stahuji vycpávkový text z http://lipsum.lipsum.com/</xsl:message>
   214     	<xsl:variable name="prostýText" select="document(concat('http://lipsum.lipsum.com/feed/xml?amount=', @odstavců, '&amp;what=paragraphs'))/feed/lipsum"/>
   214     	<xsl:variable name="prostýText" select="document(concat('http://lipsum.lipsum.com/feed/xml?amount=', @odstavců, '&amp;what=paragraphs'))/feed/lipsum"/>
   215     	<xsl:for-each select="fn:tokenize($prostýText, '\n')">
   215     	<xsl:for-each select="fn:tokenize($prostýText, '\n')">
   216     		<p><xsl:value-of select="."/></p>
   216     		<p><xsl:value-of select="."/></p>
   217     	</xsl:for-each>    	
   217     	</xsl:for-each>
   218     </xsl:template>
   218     </xsl:template>
   219     
   219     
       
   220     <!--
       
   221     	Makro pro jednoduché tabulky
       
   222     -->
       
   223     <xsl:template match="m:tabulka">
       
   224     	<table>
       
   225     		<xsl:variable name="data" select="replace(replace(text(), '^\s+', ''),'\s+$','')"/>
       
   226     		<xsl:variable name="hlavička" select="substring-before($data, '&#10;')"/>
       
   227     		<xsl:variable name="tělo" select="substring-after($data, '&#10;')"/>
       
   228     		<thead>
       
   229     			<tr>
       
   230     				<xsl:for-each select="tokenize($hlavička, ';')">
       
   231 						<td><xsl:value-of select="normalize-space(.)"/></td>
       
   232 					</xsl:for-each>
       
   233     			</tr>
       
   234     		</thead>
       
   235     		<tbody>
       
   236 				<xsl:for-each select="tokenize($tělo, '\n')">
       
   237 					<xsl:if test="normalize-space(.)">
       
   238 						<tr>
       
   239 							<xsl:for-each select="tokenize(., ';')">
       
   240 								<td><xsl:value-of select="normalize-space(.)"/></td>
       
   241 							</xsl:for-each>
       
   242 						</tr>
       
   243 					</xsl:if>
       
   244 				</xsl:for-each>
       
   245     		</tbody>
       
   246     	</table>    
       
   247     </xsl:template>
   220 
   248 
   221 </xsl:stylesheet>
   249 </xsl:stylesheet>