<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ViewDoc, created for launchorz. Ben Fisher, 2008 -->
<xsl:template match="/">
<html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cleartype" content="on" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1" />
<title>LnzScript Reference</title>
<link type="text/css" rel="stylesheet" href="viewdoc.css" />
</head>
<body>

<div id="topbar" class="wide"><div class="container"></div></div>

<div tabindex="-1" style="outline: 0px none;" id="page" class="wide">
<div class="container">

<h1>LnzScript Reference</h1>

<div class="maintoplinks">
<!-- Draw the top links -->
<a name="anchor_top"></a>
<xsl:for-each select="launchorzdoc/section">
	<xsl:for-each select="namespace">
		<a>
		<xsl:attribute name="href">javascript:showDiv('div_<xsl:value-of select="../@name"/>_<xsl:value-of select="@name"/>');</xsl:attribute>
		<xsl:choose>
		<xsl:when test="@name = '(Global)'">Global</xsl:when>
		<xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
		</xsl:choose>
		</a> |
	</xsl:for-each>
</xsl:for-each>
<a href="javascript:setVisibleAll(true);">(All)</a>
</div>

<div style="margin:3em"></div>

<div id="divOutput" class="maindoc">
<xsl:for-each select="launchorzdoc/section">
	<xsl:for-each select="namespace">
		<!-- create the named div-->
		<div class="classNamespace" style=""> <!-- put display:none here if you want to start with all sections hidden -->
		<xsl:attribute name="id">div_<xsl:value-of select="../@name" />_<xsl:value-of select="@name" /></xsl:attribute> 
		
		<xsl:for-each select="function">			
			<!-- If an instance method, a.foo(). If a global method, foo(). If a static method, Class.foo() -->
			<pre><xsl:choose>
				<xsl:when test="@instance='true'">
					<xsl:choose>
					<xsl:when test="../@name = 'Array'">arr.</xsl:when>
					<xsl:when test="../@name = 'String'">s.</xsl:when>
					<xsl:when test="../@name = 'RegExp'">re.</xsl:when>
					<xsl:when test="../@name = 'Number'">x.</xsl:when>
					<xsl:when test="../@name = 'Date'">dt.</xsl:when>
					</xsl:choose>
				</xsl:when>
				<xsl:when test="(../@name != '(Global)') and not(starts-with(@name, ' new '))"><xsl:value-of select="../@name"/>.</xsl:when>
			</xsl:choose>
			<xsl:value-of select="@name"/>(<xsl:value-of select="@args"/>)<xsl:if test="@returns != ''"><i> => </i> <xsl:value-of select="@returns"/></xsl:if></pre>
			<p>
			<xsl:value-of select="doc"/>
			<xsl:if test="example != ''">
				<span><xsl:attribute name="onclick">shex('ex_<xsl:value-of select="../@name" />_<xsl:value-of select="@name" />');</xsl:attribute> Example. </span>
				<span class="spanexample">
					<xsl:if test="not(starts-with(example,'Note:'))"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if>
					<xsl:attribute name="id">ex_<xsl:value-of select="../@name" />_<xsl:value-of select="@name" /></xsl:attribute>
					<br/><br/>
				<xsl:value-of select="example"/></span> 
			</xsl:if>
			</p>
			
		</xsl:for-each>
		</div>
	 </xsl:for-each>
</xsl:for-each>
</div>

<!--
	XSL code: 
	Ben Fisher, 2008. Released under Gnu Public License v3.
	CSS styles:
	Copyright 2009 The Go Authors. All rights reserved.
	Use of this source code is governed by a BSD-style
	license that can be found in the LICENSE file.
-->
<div id="footer">
Styling from golang package documentation; <a href="http://golang.org/LICENSE">license</a>.
</div>

</div></div>
<script src="viewdoc.js"></script>
</body>
</html>
</xsl:template>
</xsl:stylesheet>