<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:uddi="urn:uddi-org:api_v2"
       xmlns:scripts ="http://architag.com/scripts" 
      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:xlink="http://www.w3.org/1999/xlink"> 
  <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes"
      doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
     />
<!-- XSL programming environment for TWiki.                                      -->
<!-- <?xml ... header contains file menu to allow you to load your file for edit !  -->
<!--  -->
<!-- known problems:-->
<!-- Clipboard access to content will promote one-off environment-->
<!-- 
    This is alpha code of a compact XML manipulation tool. 
    Copyright (c) 2003 Forth Party software
    Please send comments to: JCoe18@excite.com


  <xsl:include href="..\XslWiki\amazon.xsl"/>
  
  <xsl:include href="..\XslWiki\uddi.xsl"/>
  
  <xsl:include href="..\XslWiki\foaf.xsl"/>

<xsl:include href="google.xsl"/>

<xsl:include href="RSSwiki.xsl"/>
-->


<!-- Display width (pixels) -->
<xsl:variable name="display-width" select="'700'"/>

<!-- Background color (#rgb) -->
<xsl:variable name="background-color" select="'#D0F0D0'"/>

<!-- Use table separator (yes/no) -->
<xsl:variable name="use-table-separator" select="'yes'"/>

<!-- Use record separator (yes/no) -->
<xsl:variable name="use-record-separator" select="'no'"/>

<xsl:variable name="fractalKey" select="'TheQuickBrownDogJumptOverALazyFox'"/>
<!--
**
**   Description :  HTML Treeview
**
*   Updates :
** 
-->
	
	<!-- Change the encoding here if you need it, i.e. UTF-8 -->
	<xsl:output method="html" encoding="iso-8859-1" indent="yes"/>
	
	<!-- ************************************ Parameters ************************************ -->
	<!-- deploy-treeview, boolean - true if you want to deploy the tree-view at the first print -->
	<xsl:param name="param-deploy-treeview" select="'false'"/>
	
	<!-- is the client Netscape / Mozilla or Internet Explorer. Thanks to Bill, 90% of sheeps use Internet Explorer so it will the default value-->	
	<xsl:param name="param-is-netscape" select="'false'"/>

	<!-- hozizontale distance in pixels between a folder and its leaves -->
	<xsl:param name="param-shift-width" select="15"/>
	
	<!-- image source directory-->
	<xsl:param name="param-img-directory" select="''"/>

<xsl:param name="q" select="''"/>
	
	<!-- ************************************ Variables ************************************ -->
	<xsl:variable name="var-simple-quote">'</xsl:variable>
	<xsl:variable name="var-slash-quote">\'</xsl:variable>
	
<!--
**
**  Model "treeview"
** 
**  This model transforms an XML treeview into an html treeview
**  
-->
	<xsl:template match="/treeview">
		<!-- -->
		<link rel="stylesheet" href="treeview.css" type="text/css"/>
		<LINK REL="stylesheet" type="text/css" href="EasyTMD.css" />
		<script src="treeview.js" language="javascript" type="text/javascript"></script>
		<script src="file.js" language="javascript" type="text/javascript"></script>
		<xsl:if test="@file">  
		   <map name ="WordMap">
                                                             
                                      <!-- Apply the template folder starting with a depth in the tree of 1 -->
				<xsl:call-template name="encoder">
					<xsl:with-param name="depth" select="$fractalKey"/>
					<xsl:with-param name="lowerLeft" select="3"/>
					<xsl:with-param name="lowerRight" select="10"/>
					<xsl:with-param name="upperLeft" select="3"/>
					<xsl:with-param name="upperRight" select="0.3"/>
					<xsl:with-param name="lowerLeft1" select="0"/>
					<xsl:with-param name="lowerRight1" select="-1.5"/>
					<xsl:with-param name="upperLeft1" select="11.5"/>
					<xsl:with-param name="upperRight1" select="0.3"/>
				</xsl:call-template> 
                          
		  </map>
		</xsl:if>
		  <a class="folder"><xsl:attribute name="onkeydown">KeyDown(this)</xsl:attribute>
			<xsl:attribute name="onclick">toggle2(this, 'none')</xsl:attribute>
					
		  <DIV ID="content" STYLE="display: none;"  width="100%">
                                  <TABLE><TR><TD VALIGN="top"  WIDTH="70%">
					<DIV CLASS="imageselect1" ALIGN="center" STYLE="width: 48px;">
					<DIV CLASS="imageselect2">
					<DIV CLASS="imageselect3" ID="driveselect">

					</DIV>
					</DIV>
					</DIV>
		  </TD><TD> 
					<TABLE CELLPADDING="0" CELLSPACING="0"><TR>
					<TD>
						<DIV CLASS="imageselect1" ALIGN="center" STYLE="width: 300;">
						<DIV CLASS="imageselect2">
						<DIV CLASS="imageselect3" ID="OPENFOLDER" STYLE="height: 14px;">
						</DIV>
						</DIV>
						</DIV>
					</TD><TD></TD><TD>
						<DIV CLASS='bn1'><DIV CLASS='bn2'><IMG SRC="folder_up.gif" WIDTH="15" HEIGHT="13" BORDER="0" ALT="" ID="BTN_FOLDERUP"/></DIV></DIV>
					</TD>
					</TR></TABLE>
					<DIV CLASS="imageselect1" ALIGN="center" STYLE="width: 528px;">
					<DIV CLASS="imageselect2">
					<DIV CLASS="imageselect3" ID="SEL_FILELIST" STYLE="height: 155px; width: 526px; overflow: auto;">
					</DIV>
					</DIV>
					</DIV>
					<TABLE WIDTH="100%">
					<TR><TD VALIGN="top">
						<TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR>
						<TD>
							<INPUT TYPE="hidden" ID="TXT_FILE" STYLE="width: 100%"/> 
						</TD>
						</TR></TABLE>
					</TD><TD ALIGN="right" WIDTH="120">
										

					</TD></TR>
					</TABLE>
		</TD>
                                </TR></TABLE>
		</DIV>
		</a>
                                <textarea cols="70" rows="2" name="rdf">rdf</textarea>
<!--		<form method="get" action="http://www.google.com/search">
<xsl:value-of select="$q"/>
  		    <input type="text" name="q" size="31" maxlength="255" value="The quick brown dog jumped over a lazy fox." /> 
 		    <input type="hidden" name="domains" value="twiki.org" /> 
 		    <input type="hidden" name="sitesearch" value="twiki.org" /> 
		    <input type="submit" name="btnG1" value="Google Search twiki.org" />
		</form>
 Apply the template folder starting with a depth in the tree of 1
				 <xsl:call-template name="encoderText">
					<xsl:with-param name="depth" select="$fractalKey"/>
					<xsl:with-param name="lowerLeft1" select="1.0"/>
					<xsl:with-param name="lowerRight1" select="1.5"/>
					<xsl:with-param name="upperLeft1" select="1.5"/>
					<xsl:with-param name="upperRight1" select="1.5"/>
					<xsl:with-param name="lowerLeft" select="3"/>
					<xsl:with-param name="lowerRight" select="10"/>
					<xsl:with-param name="upperLeft" select=".30"/>
					<xsl:with-param name="upperRight" select=".30"/>
				</xsl:call-template> -->
		
		<table border="0" cellspacing="0" cellpadding="0"  width="100%">
		  	<tr><td width="70%">
			    <xsl:if test="not(@code)"> 
		  		<!-- Apply the template folder starting with a depth in the tree of 1-->
				<xsl:apply-templates select="folder">
					<xsl:with-param name="depth" select="1"/>
				</xsl:apply-templates>
			    </xsl:if>
			    <xsl:if test="@code"> 
				<!-- Apply the template folder starting with a depth in the tree of 1-->
				<xsl:apply-templates select="folder">
					<xsl:with-param name="depth" select="@code"/>
					      <!--  <xsl:attribute name="select">2</xsl:attribute> 
					</xsl:with-param> -->
				</xsl:apply-templates>
			    </xsl:if>
                                                     <TD WIDTH="30%"><textarea cols="10" rows="10" name="rdf1">rdf</textarea></TD>
			</td></tr>

		 </table>
		         <title>Phrase Decode:<xsl:value-of select="contenttype"/></title>

         <a name="PageTop"></a>
   <!--      
          <xsl:call-template name="get-rss"><xsl:with-param name="title" select="."/>
           </xsl:call-template>
        <xsl:call-template name="get-wiki"><xsl:with-param name="title" select="."/>
       </xsl:call-template>
       <xsl:apply-templates/>
      <xsl:call-template name="makeForms"><xsl:with-param name="title" select="."/>
      </xsl:call-template>
      
End of page ,
-->
        <a name="PageBottom"></a>		
	</xsl:template>
	
<!--
**
**  Model "folder"
** 
**  This model transforms a folder element. Prints a plus (+) or minus (-)  image, the folder image and a title
**  
-->
	<xsl:template match="folder">
		<xsl:param name="depth"/>
		<table border="0" cellspacing="0" cellpadding="0">
	  		<tr><xsl:attribute name="onkeydown">KeyDown(this)</xsl:attribute>
	  			<!-- If first level of depth, do not shift of $param-shift-width-->
	  			<xsl:if test="$depth>1">
	  				<td width="{$param-shift-width}"></td>
	  			</xsl:if>
	  			
	  			<td>
	  				<a class="folder">
					         <xsl:attribute name="onkeydown">KeyDown(this)</xsl:attribute>
					<xsl:if test="@wiki">  
   <!--  <xsl:call-template name="get-rss"><xsl:with-param name="title" select="@wiki"/>
           </xsl:call-template>-->
					</xsl:if>
					<xsl:if test="@code">  				
		  				<xsl:attribute name="onclick">toggle2(this, '<xsl:value-of select="@code"/>')
						</xsl:attribute>
					</xsl:if>
					<xsl:if test="not(@code)">
							<xsl:attribute name="onclick">toggle(this)</xsl:attribute>
					</xsl:if>
	  				
					<!-- If the treeview is unfold, the image minus (-) is displayed-->
					<xsl:if test="@expanded">
						<xsl:if test="@expanded='true'">
	  						<img src="{$param-img-directory}minus.gif"/>
	  					</xsl:if>
		  				<!-- plus (+) otherwise-->
						<xsl:if test="@expanded='false'">
							<img src="{$param-img-directory}plus.gif"/>
		  				</xsl:if>
					</xsl:if>
					<xsl:if test="not(@expanded)">
						<xsl:if test="$param-deploy-treeview = 'true'">
							<img src="{$param-img-directory}minus.gif"/>
						</xsl:if>
						
						<xsl:if test="$param-deploy-treeview = 'false' or not(@expanded)">
							<img src="{$param-img-directory}plus.gif"/>
						</xsl:if>
					</xsl:if>
					
	  				<img src="{$param-img-directory}{@img}">
	  					<!-- if the attribut alt is present-->
						<xsl:if test="@alt">
							<!-- if Netscape / Mozilla -->
							<xsl:if test="$param-is-netscape='true'">
								<xsl:attribute name="title"><xsl:value-of select="@alt"/></xsl:attribute>
							</xsl:if>
							<!-- if Internet Explorer -->
							<xsl:if test="$param-is-netscape='false'">
								<xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
							</xsl:if>								
						</xsl:if>
						<xsl:if test="@lang">  				
		  				               <xsl:attribute name="usemap">#WordMap</xsl:attribute>
						</xsl:if>
	  				</img>
	  				<xsl:value-of select="@title"/></a>
					 <Input type ="file">
                                                                                             <xsl:attribute name="onchange">fileBox(this, this.value)
                                                                                             </xsl:attribute>
                                                                                </Input>
					<Input type ="button" value = "retry">
                                                                                             <xsl:attribute name="onchange">fileBox(this, document.elements.almost.value)
                                                                                             </xsl:attribute>
                                                                                </Input>

					<!--  Shall we expand all the leaves of the treeview ? no by default-->
					<div>
						<xsl:if test="@expanded">
							<xsl:if test="@expanded='true'">
		  						<xsl:attribute name="style">display:block;</xsl:attribute>
		  					</xsl:if>
			  				<!-- plus (+) otherwise-->
							<xsl:if test="@expanded='false'">
								<xsl:attribute name="style">display:none;</xsl:attribute>
			  				</xsl:if>
						</xsl:if>
						
						<xsl:if test="not(@expanded)">
							<xsl:if test="$param-deploy-treeview = 'true'">
								<xsl:attribute name="style">display:block;</xsl:attribute>						
							</xsl:if>
													
							<xsl:if test="$param-deploy-treeview = 'false'">
								<xsl:attribute name="style">display:none;</xsl:attribute>
							</xsl:if>
						</xsl:if>						
						
						<!-- Thanks to the magic of reccursive calls, all the descendants of the present folder are gonna be built -->
	  					<xsl:apply-templates select="folder">
							<xsl:with-param name="depth" select="$depth+1"/>
						</xsl:apply-templates>
						
						<!-- print all the leaves of this folder-->
	  					<xsl:apply-templates select="leaf"/>
					</div>
				</td>
	  			<td bgcolor="red">.</td>
	  			<td bgcolor="green">.</td>
	  		</tr>
	  	</table>
	  	
	</xsl:template>
	
<!--
**
**  Model "leaf"
** 
**  This model prints an image plus the name of the element
**  
-->
	<xsl:template match="leaf">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr> <td width="{$param-shift-width}"></td> 
				<td>
					<a class="leaf">
						<!-- The line is very long bu I have no choice, I called the function replace-string to replace the quotes (') by /' -->
						<xsl:attribute name="onclick">selectLeaf('<xsl:call-template name="replace-string"><xsl:with-param name="text" select="@title"/><xsl:with-param name="from" select="$var-simple-quote"/><xsl:with-param name="to" select="$var-slash-quote"/></xsl:call-template>','<xsl:call-template name="replace-string"><xsl:with-param name="text" select="@code"/><xsl:with-param name="from" select="$var-simple-quote"/><xsl:with-param name="to" select="$var-slash-quote"/></xsl:call-template>')</xsl:attribute>						
						<!-- if it is the last leaf, print a different image for the link to the folder-->
						<xsl:choose>
							<xsl:when test="position()=last()">
								<img src="{$param-img-directory}lastlink.gif"/>
							</xsl:when>
							<xsl:otherwise>
								<img src="{$param-img-directory}link.gif"/>
							</xsl:otherwise>
						</xsl:choose>
						
						<img src="{$param-img-directory}{@img}">
							<!-- if the attribut alt is present-->
							<xsl:if test="@alt">
								<!-- if Netscape / Mozilla -->
								<xsl:if test="$param-is-netscape='true'">
									<xsl:attribute name="title"><xsl:value-of select="@alt"/></xsl:attribute>
								</xsl:if>
								<!-- if Internet Explorer -->
								<xsl:if test="$param-is-netscape='false'">
									<xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
								</xsl:if>								
							</xsl:if>
						</img>

						<xsl:value-of select="@title"/>
					</a>
				</td>
			</tr>
   		</table>
	</xsl:template>
<!--
**
**  Model "encoder"
** 
**  This model transforms a area element. 
**  
-->
<!--0.2 0.23 -0.26 0.22 0 0.2 p(2) = 0.07  -->
  <!--    -0.15 0.26 0.28 0.24 0 0.2 p(3) = 0.06 -->
	<xsl:template name="encoder">
		<xsl:param name="depth"/>
		<xsl:param name="lowerLeft"/>
		<xsl:param name="lowerRight"/>
		<xsl:param name="upperLeft"/>
		<xsl:param name="upperRight"/>
		<xsl:param name="lowerLeft1"/>
		<xsl:param name="lowerRight1"/>
		<xsl:param name="upperLeft1"/>
		<xsl:param name="upperRight1"/>
  
		<xsl:if test="string-length($depth)>1">
	  	     <xsl:call-template name="encoder1">
<!--0.2 0.23 -0.26 0.22 0 0.2)"><text> Fern2</text> </g>p(2) = 0.07  -->
  <!--    <g id="f3" transform="matrix(-0.15 0.26 0.28 0.24 0 0.2  -->
			<xsl:with-param name="depth" select="substring($depth,2)"/>
			<xsl:with-param name="lowerLeft" select="$lowerLeft * 0.2 + $lowerRight * -0.26"/>
			<xsl:with-param name="lowerRight" select="$lowerLeft * 0.23 + $lowerRight * 0.22+ 0.2"/>
			<xsl:with-param name="upperLeft" select="$upperLeft * 0.2 + $upperRight * -0.26"/>
			<xsl:with-param name="upperRight" select="$upperLeft * 0.23 + $upperRight * 0.22+ 0.2"/>

			<xsl:with-param name="lowerLeft1" select="$lowerLeft * 0.2 + $lowerRight * -0.26"/>
			<xsl:with-param name="lowerRight1" select="$lowerLeft * 0.23 + $lowerRight * 0.22+ 0.2"/>
			<xsl:with-param name="upperLeft1" select="$upperLeft * 0.2 + $upperRight * -0.26"/>
			<xsl:with-param name="upperRight1" select="$upperLeft * 0.23 + $upperRight * 0.22+ 0.2"/>

		      </xsl:call-template>
		</xsl:if>			
						
	  	
	</xsl:template>
<!--
**
**  Model "encoder1"
** 
**  This model transforms a area element. 
**  ,<xsl:value-of select="format-number($upperLeft1,'###.')"/>,<xsl:value-of select="format-number($upperRight1,'###.')"/>
  onclick="hit(this)" onmouseover="hit(this)"
-->
<!-- -->
	  <!--	<xsl:attribute name="nohref">hit()</xsl:attribute> -->
	<xsl:template name="encoder1">
		<xsl:param name="depth"/>
		<xsl:param name="lowerLeft"/>
		<xsl:param name="lowerRight"/>
		<xsl:param name="upperLeft"/>
		<xsl:param name="upperRight"/>
		<xsl:param name="lowerLeft1"/>
		<xsl:param name="lowerRight1"/>
		<xsl:param name="upperLeft1"/>
		<xsl:param name="upperRight1"/>
		<area shape="poly"  onclick="hit()" onmouseover="hit()"><xsl:attribute name="onkeydown">KeyDown(this)</xsl:attribute>
	  	        <xsl:attribute name="coords"><xsl:value-of select="format-number($lowerRight * 100,'###')"/>,<xsl:value-of select="format-number($lowerLeft * 10,'###.')"/>,<xsl:value-of select="format-number($upperLeft * 100,'###')"/>,<xsl:value-of select="format-number($upperRight * 10,'###.')"/>,<xsl:value-of select="format-number($lowerLeft1 * 100 + 100,'###.')"/>,<xsl:value-of select="format-number($lowerRight1 * 100 + 100,'###.')"/></xsl:attribute>
                                <xsl:attribute name="alt">#1<xsl:value-of select="substring($depth,1,1)"/></xsl:attribute>-->
		</area>
   		<area shape="circle"><xsl:attribute name="href">#<xsl:value-of select="substring($depth,1,1)"/></xsl:attribute><xsl:attribute name="coords"><xsl:value-of select="format-number($lowerRight * 20 + 100,'###')"/>,<xsl:value-of select="format-number(600 - $lowerLeft  * 100 ,'###')"/>,<xsl:value-of select="format-number($lowerRight  + 10,'###')"/>"/></xsl:attribute>
		    <xsl:attribute name="onkeydown">KeyDown(this)</xsl:attribute>
                                </area>
		<!-- Thanks to the magic of reccursive calls, 0.85 -0.042 0.04 0.85 0 1.6 -->
		<xsl:if test="string-length($depth)>1">
	  	     <xsl:call-template name="encoder1">
			<xsl:with-param name="depth" select="substring($depth,2)"/>
			<xsl:with-param name="lowerLeft1" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
			<xsl:with-param name="lowerRight1" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
			<xsl:with-param name="upperLeft1" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
			<xsl:with-param name="upperRight1" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
			<xsl:with-param name="lowerLeft" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
			<xsl:with-param name="lowerRight" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
			<xsl:with-param name="upperLeft" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
			<xsl:with-param name="upperRight" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
			
		      </xsl:call-template>
		</xsl:if>			
						
	  	
	</xsl:template>

<!--
**
**  Model "encoderText"
** 
**  This model transforms a area element. 
**  
-->
<!--0.2 0.23 -0.26 0.22 0 0.2 p(2) = 0.07  -->
  <!--    -0.15 0.26 0.28 0.24 0 0.2 p(3) = 0.06 -->
	<xsl:template name="encoderText">
		<xsl:param name="depth"/>
		<xsl:param name="lowerLeft"/>
		<xsl:param name="lowerRight"/>
		<xsl:param name="upperLeft"/>
		<xsl:param name="upperRight"/>
		
		<xsl:if test="string-length($depth)>1">
	  	     <xsl:call-template name="encoderText1">
<!--0.2 0.23 -0.26 0.22 0 0.2)"><text> Fern2</text> </g>p(2) = 0.07  -->
  <!--    <g id="f3" transform="matrix(-0.15 0.26 0.28 0.24 0 0.2  -->
			<xsl:with-param name="depth" select="substring($depth,1)"/>
			<xsl:with-param name="lowerLeft" select="$lowerLeft * 0.2 + $lowerRight * -0.26"/>
			<xsl:with-param name="lowerRight" select="$lowerLeft * 0.23 + $lowerRight * 0.22+ 0.2"/>
			<xsl:with-param name="upperLeft" select="$upperLeft * 0.2 + $upperRight * -0.26"/>
			<xsl:with-param name="upperRight" select="$upperLeft * 0.23 + $upperRight * 0.22+ 0.2"/>

			<xsl:with-param name="lowerLeft1" select="$lowerLeft * 0.2 + $lowerRight * -0.26"/>
			<xsl:with-param name="lowerRight1" select="$lowerLeft * 0.23 + $lowerRight * 0.22+ 0.2"/>
			<xsl:with-param name="upperLeft1" select="$upperLeft * 0.2 + $upperRight * -0.26"/>
			<xsl:with-param name="upperRight1" select="$upperLeft * 0.23 + $upperRight * 0.22+ 0.2"/>

		      </xsl:call-template>
		</xsl:if>			
						
	  	
	</xsl:template>


  <!--   
**
**  Model "encoderText1"
** 
**  This model transforms a area element. 
**  
-->
	<xsl:template name="encoderText1">
		<xsl:param name="depth"/>
		<xsl:param name="current"/>
		<xsl:param name="lowerLeft"/>
		<xsl:param name="lowerRight"/>
		<xsl:param name="upperLeft"/>
		<xsl:param name="upperRight"/>
		<xsl:param name="lowerLeft1"/>
		<xsl:param name="lowerRight1"/>
		<xsl:param name="upperLeft1"/>
		<xsl:param name="upperRight1"/>
	 <!--	<xsl:value-of select="substring($depth,1,1)"/>
                                <input type="text">
		<xsl:attribute name="name"><xsl:value-of select="substring($depth,1,1)"/></xsl:attribute> -->
	  <!--  position:absolute 	<xsl:attribute name="style">position:absolute;top:<xsl:value-of select="format-number($lowerLeft * 100 + 660,'###.')"/>;left<xsl:value-of select="format-number($lowerRight * 1000+ 100,'###.')"/></xsl:attribute> -->
                   <!--             <xsl:attribute name="value"><xsl:value-of select="format-number($lowerLeft * 100 + 100,'###')"/>,<xsl:value-of select="format-number($lowerRight * 10 ,'###')"/>--><!--  ,<xsl:value-of select="format-number($upperLeft* 100,'###.')"/>,<xsl:value-of select="format-number($upperRight * 100,'###.')"/>,<xsl:value-of select="format-number($lowerLeft1 * 100 + 10,'###.')"/>,<xsl:value-of select="format-number($lowerRight1 * 100 + 100 ,'###.')"/>,<xsl:value-of select="format-number($upperLeft1 * 100,'###.')"/>,<xsl:value-of select="format-number($upperRight1 * 100,'###.')"/></xsl:attribute> -->
		<!-- <xsl:attribute name="top"><xsl:value-of select="format-number($lowerLeft * 100 + 100,'###.')"/></xsl:attribute>
                                <xsl:attribute name="left"><xsl:value-of select="format-number($lowerRight * 100+ 100,'###.')"/></xsl:attribute> 
                
     
                                </input> -->
		<!-- Thanks to the magic of reccursive calls, 0.85 -0.042 0.04 0.85 0 1.6 -->
		<xsl:if test="string-length($depth)>string-length($current)">
		<xsl:choose>
			<xsl:when test="contains(translate(substring($depth,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),substring($depth,1,1))">
		<!--		    <form method="get" action="MySentenceView.xml">
  		    			<input type="text" name="q" size="31" maxlength="255" >
					    <xsl:attribute name="value">
						<xsl:value-of select="concat($current,substring($current,0))"/>
					    </xsl:attribute>
					</input> 
 		    <input type="hidden" name="domains" value="twiki.org" /> 
 		    <input type="hidden" name="sitesearch" value="twiki.org" /> 
		    <input type="submit" name="btnG1" value="Google Search twiki.org" />
				</form> -->
				<!--  <xsl:call-template name="encoderText1">
					<xsl:with-param name="depth" select="substring($depth,2)"/>
					<xsl:with-param name="current" select="substring($depth,1,1)"/>
					<xsl:with-param name="lowerLeft1" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
					<xsl:with-param name="lowerRight1" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
					<xsl:with-param name="upperLeft1" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
					<xsl:with-param name="upperRight1" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
					<xsl:with-param name="lowerLeft" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
					<xsl:with-param name="lowerRight" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
					<xsl:with-param name="upperLeft" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
					<xsl:with-param name="upperRight" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
		   	 </xsl:call-template> -->
			</xsl:when>
			<xsl:otherwise>
			
			     
			</xsl:otherwise>
		</xsl:choose>
		 <xsl:call-template name="encoderText1">
				<xsl:with-param name="depth" select="substring($depth,2)"/>
				<xsl:with-param name="current" select="concat($current,substring($depth,2,1))"/>
				<xsl:with-param name="lowerLeft1" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
				<xsl:with-param name="lowerRight1" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
				<xsl:with-param name="upperLeft1" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
				<xsl:with-param name="upperRight1" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
				<xsl:with-param name="lowerLeft" select="$lowerLeft * 0.85 + $lowerRight * 0.04"/>
				<xsl:with-param name="lowerRight" select="$lowerLeft * -0.042 + $lowerRight * 0.85 + 1.6"/>
				<xsl:with-param name="upperLeft" select="$upperLeft * 0.85 + $upperRight * 0.04"/>
				<xsl:with-param name="upperRight" select="$upperLeft * -0.042 + $upperRight * 0.85 + 1.6"/>
		    	    </xsl:call-template>
		</xsl:if>			
						
	  	
	</xsl:template>		
<!--
**
**  Model "replace-string"
** 
**  reusable replace-string function **  
-->
	<xsl:template name="replace-string">
		<xsl:param name="text"/>
		<xsl:param name="from"/>
		<xsl:param name="to"/>
		<xsl:choose>
			<xsl:when test="contains($text, $from)">
				<xsl:variable name="before" select="substring-before($text, $from)"/>
				<xsl:variable name="after" select="substring-after($text, $from)"/>
				<xsl:variable name="prefix" select="concat($before, $to)"/>
				<xsl:value-of select="$before"/>
				<xsl:value-of select="$to"/>
				<xsl:call-template name="replace-string">
					<xsl:with-param name="text" select="$after"/>
					<xsl:with-param name="from" select="$from"/>
					<xsl:with-param name="to" select="$to"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$text"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	
</xsl:stylesheet>




