html.xslt

Arkusz XSLT konwertujący XML z opisem miejscowości do formatu HTML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output standalone="yes" method="xml" version="1.0" encoding="iso-8859-2" indent="yes"/>

<xsl:template match="/miejscowosc">
	<html><head>
		<title>OSR :: miasta</title>
		<basefont face="verdana,arial"/>
	</head>
	<xsl:comment>(C)2002 Piotr Gapiński</xsl:comment>
	<body>
		<xsl:apply-templates select="nazwa"/><br/>
		<xsl:apply-templates select="lokalizacja"/><br/>
		<br/>
		<xsl:apply-templates select="informacje"/><br/>
	</body>
	</html>
</xsl:template>

<xsl:template match="nazwa">
	<font size="2">
	<u><b><xsl:value-of select="aktualna"/></b> :: <xsl:value-of select="historyczna"/></u>
	</font>
</xsl:template>

<xsl:template match="lokalizacja">
	<font size="2">
	<xsl:value-of select="opis"/>
	</font>
</xsl:template>

<xsl:template match="informacje">
	<font size="2">
	<xsl:value-of select="opis"/>
	<br/>
	<xsl:apply-templates select="ciekawostki"/>
	<xsl:apply-templates select="parametry"/>
	<br/>
	<xsl:apply-templates select="autor"/><br/>
	</font>
</xsl:template>

<xsl:template match="ciekawostki">
	<ul>
		<b><xsl:text>ciekawostki:</xsl:text></b>
		<xsl:for-each select="ciekawostka">
		<li><xsl:value-of select="."/></li>
		</xsl:for-each>
	</ul>
</xsl:template>

<xsl:template match="parametry">
	<ul>
		<b><xsl:text>tutaj:</xsl:text></b>
		<xsl:for-each select="parametr">
		<li><xsl:value-of select="."/></li>
		</xsl:for-each>
	</ul>
</xsl:template>

<xsl:template match="autor">
	<xsl:comment><xsl:text>autor:</xsl:text></xsl:comment>
	<xsl:value-of select="osoba"/> :: <xsl:value-of select="data"/>
</xsl:template>

</xsl:stylesheet>
autorzy/narg/zdarzenia/20060304/html.xslt.txt · ostatnio zmienione: 2006/03/14 08:33 przez Piotr Gapiński
 
 
©2005-2010 by Pijoter · powered by DokuWiki · hosting by Yupo.pl