<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output
		omit-xml-declaration="yes"
		method="xml"
		version="1.0"
		encoding="CP-1252"
		indent="yes"
		doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
		doctype-public="-//W3C//DTD XHTML 1.1//EN"
		/>
	<xsl:strip-space elements="*"/>
	<xsl:template match="/">
		<html xml:lang="it">
			<xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute>
			<xsl:variable name="b" select="/shEdit/query/parametro[nome='b']/valore"/>
			<xsl:variable name="idcat" select="/shEdit/idCategoria"/>
			<xsl:variable name="url" select="concat($XMLPath,'/getalberocat.php?id=',$idcat)"/>
			<xsl:variable name="albero" select="document($url)"/>
			<xsl:call-template name="commento">
				<xsl:with-param name="str" select="$url"/>
			</xsl:call-template>
			<xsl:call-template name="head">
				<xsl:with-param name="idcat" select="$idcat"/>
				<xsl:with-param name="last" select="/shEdit/titolo/testo"/>
			</xsl:call-template>
			<body>
				<div class="container">
					<xsl:call-template name="header">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="livelloI" select="$albero/albero/categoria[2]/cat_id"/>
						<xsl:with-param name="livelloII">
							<xsl:if test="$albero/albero/categoria[3]/cat_id">
								<xsl:value-of select="$albero/albero/categoria[3]/cat_id"/>
							</xsl:if>
							<xsl:if test="not($albero/albero/categoria[3]/cat_id)">
								<xsl:value-of select="1"/>
							</xsl:if>
						</xsl:with-param>
						<xsl:with-param name="livelloIII" select="1"/>
					</xsl:call-template>
					<xsl:call-template name="path">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="idcat" select="$idcat"/>
						<xsl:with-param name="last" select="/shEdit/titolo/testo"/>
					</xsl:call-template>
					<xsl:call-template name="leftbar">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="livelloI" select="$albero/albero/categoria[2]/cat_id"/>
						<xsl:with-param name="livelloII" select="$albero/albero/categoria[3]/cat_id"/>
						<xsl:with-param name="livelloIII" select="1"/>
					</xsl:call-template>
					<div class="ext-center t-space">
						<span id="content" />
						<span class="rosso f-size-tit">
							<xsl:apply-templates select="/shEdit/titolo/testo"/>
						</span>
						<div class="ext-center t-space">
							<xsl:apply-templates select="/shEdit/corpo/testo"/>
						</div>
						<xsl:call-template name="righevuote">
							<xsl:with-param name="n" select="3 - (string-length(/shEdit/risultati/risultato) div 40)"/>
						</xsl:call-template>
					</div>
					<xsl:call-template name="footer">
						<xsl:with-param name="b" select="$b"/>
						<xsl:with-param name="query" select="/shEdit/query"/>
					</xsl:call-template>
				</div>
			</body>
		</html>
	</xsl:template>
	<xsl:template name="righevuote">
		<xsl:param name="n"/>
		<xsl:if test="$n > 0">
			<div class="ext-center">
				<br/><br/><br/><br/>
			</div>
			<xsl:call-template name="righevuote">
				<xsl:with-param name="n" select="$n - 1"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<xsl:template match="img | br | span | ul | li | ol | b | i | u | acronym">
		<xsl:copy-of select="."/>
	</xsl:template>
	<xsl:template match="a">
		<xsl:if test="@class='linkurl'">
			<xsl:if test="not(starts-with(@href,'mailto'))">
				<a class="title4" href="{@href}">
					<xsl:if test="starts-with(@href,'http') and not(starts-with(@href,'http://www.bibliotechesarde.it'))">
						<xsl:attribute name="rel">
							<xsl:value-of select="'blank'"/>
						</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
			<xsl:if test="starts-with(@href,'mailto')">
				<a class="{@class}" href="{@href}">
					<img class="icone" src="{$ImgPath}/mail.gif" alt="Indirizzo email"/>
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
		</xsl:if>
		<xsl:if test="not(@class='linkurl')">
			<xsl:copy-of select="."/>
		</xsl:if>
	</xsl:template>
	<!-- include -->
	<xsl:include href="/xsl/xsl_104.xsl"/>
	<!-- head -->
	<xsl:include href="/xsl/xsl_102.xsl"/>
	<!-- header -->
	<xsl:include href="/xsl/xsl_101.xsl"/>
	<!-- funzioni -->
	<xsl:include href="/xsl/xsl_103.xsl"/>
	<!-- footer -->
	<xsl:include href="/xsl/xsl_105.xsl"/>
	<!-- path -->
	<xsl:include href="/xsl/xsl_107.xsl"/>
	<!-- paginazione -->
	<xsl:include href="/xsl/xsl_109.xsl"/>
	<!-- leftbar -->
	<xsl:include href="/xsl/xsl_135.xsl"/>
</xsl:stylesheet>

