<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="/">
	<xsl:apply-templates select="_procuarar_">
		<xsl:with-param name="inicio">1</xsl:with-param>
	</xsl:apply-templates>
</xsl:template>

<xsl:template match="menu">
	<xsl:param name="inicio">0</xsl:param>
	<a class="_X_ACLASS_X_0" href="_X_URL_X_">HOME</a> | <a class="_X_ACLASS_X_{$inicio}" href="_X_URL_X_?id_pasta={@id}"><xsl:value-of select="normalize-space(text())"/></a><xsl:if test="$inicio=0"> | </xsl:if>
</xsl:template>

<xsl:template match="pasta|pag">
  <xsl:param name="inicio">0</xsl:param>
  <xsl:variable name="aux2"><xsl:choose>
		<xsl:when test="@id_pagina">id_pagina=<xsl:value-of select="@id_pagina"/><xsl:if test="@assoc=1">&amp;assoc=<xsl:value-of select="@assoc"/>&amp;id_pasta=<xsl:value-of select="../@id_pasta"/></xsl:if></xsl:when>
		<xsl:otherwise>id_pasta=<xsl:value-of select="@id_pasta"/></xsl:otherwise>
	</xsl:choose></xsl:variable>
	<xsl:apply-templates select=".."/>
	<a class="_X_ACLASS_X_{$inicio}" href="_X_URL_X_?{$aux2}"><xsl:value-of select="normalize-space(text())"/></a><xsl:if test="$inicio=0"> | </xsl:if><!-- usar when para caso de href diferenciado -->
</xsl:template>


</xsl:stylesheet>

