[Laszlo-checkins] r7109 - openlaszlo/branches/paperpie/docs/src/xsl
ben@openlaszlo.org
ben at openlaszlo.org
Fri Nov 2 18:22:56 PDT 2007
Author: ben
Date: 2007-11-02 18:22:55 -0700 (Fri, 02 Nov 2007)
New Revision: 7109
Modified:
openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl
Log:
Real progress towards analyzing attribute category (final, readonly, read/write, special)
Modified: openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl 2007-11-03 00:36:32 UTC (rev 7108)
+++ openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl 2007-11-03 01:22:55 UTC (rev 7109)
@@ -21,35 +21,94 @@
<!ENTITY isvisible '(contains($visibility.filter, @access))'>
+<!ENTITY ispublic '(@access="public")'>
+
+
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:import href="common-html.xsl"/>
-
<xsl:output method="xml"/>
<!-- simple driver for testing paperpie doctools work -->
+ <xsl:template match="/">
+ <xsl:apply-templates select="/js2doc/property" />
+ </xsl:template>
- <xsl:param name="visibility.filter" select="'public'"/>
+
+
+ <!-- /js2doc/property[@name]/class/property[@name="setters"] -->
+ <xsl:template match="property" >
+ <xsl:variable name="classname" select="@name" />
+ <xsl:variable name="setters" select="class/property[@name='setters']/object/property[not(contains(@access, 'private'))]" />
+ <xsl:variable name="instancevariables" select="class/property[@name='__ivars__']/object/property[not(contains(@access, 'private'))]" />
+ <xsl:variable name="initargs" select="class/initarg[not(contains(@access, 'private'))]" />
+
+
+ property with name <xsl:value-of select="$classname"/>
+
+
+ <!-- things that are both instancevariables and setters are read/write attributes -->
+ <xsl:variable name="setters-names" select="$setters/@name" />
+ <xsl:variable name="ivars-names" select="$instancevariables/@name" />
+
+ <xsl:variable name="attributes" select="$setters | $instancevariables"></xsl:variable>
+
- <xsl:key name="id" match="*" use="@id"/>
- <xsl:key name="unitid" match="*" use="@unitid"/>
- <xsl:key name="topic" match="property" use="@topic"/>
- <xsl:key name="subtopic" match="property" use="@subtopic"/>
- <xsl:key name="name-js" match="property" use="@name"/>
- <xsl:key name="name-lzx" match="property" use="&tagname;"/>
- <xsl:key name="superclass" match="property[child::class]" use="class/@extends"/>
+ attributes: (setters: <xsl:value-of select="count($setters)"/>) (instancevariables: <xsl:value-of select="count($instancevariables)"/>)
+ <xsl:for-each select="$attributes">
+ <xsl:sort select="@name" />
+ <xsl:variable name="sname" select="@name" />
+ <xsl:variable name="issetter" select="count( ancestor::property[@name='setters'] ) > 0" />
+ <xsl:variable name="hassetter" select="count( $setters[@name=$sname] ) > 0" />
+ <xsl:variable name="isinstancevar" select="count( $instancevariables[@name=$sname]) > 0" />
+ <xsl:variable name="isinitarg" select="count( $initargs[@name=$sname] ) > 0" />
+
+ <xsl:if test="$hassetter">
+ <xsl:if test="$issetter">
+ <xsl:call-template name="unique-attribute">
+ <xsl:with-param name="issetter" select="true()"></xsl:with-param>
+ <xsl:with-param name="isinstancevar" select="$isinstancevar"></xsl:with-param>
+ <xsl:with-param name="isinitarg" select="$isinitarg"></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="not($hassetter)">
+ <xsl:call-template name="unique-attribute"></xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+
+
+ instancevariables:
+ <xsl:for-each select="$instancevariables">
+ <xsl:sort select="@name" />
+ <xsl:value-of select="@name"/>,
+ </xsl:for-each>
- <xsl:template match="/">
- <h3>
- <xsl:attribute name="class">goofy</xsl:attribute>
- hi there</h3>
- <xsl:for-each select="descendant::refsect1[1]">
- $relative.path.to.lpshome: <xsl:value-of select="$relative.path.to.lpshome"/>
- local.lps.path:<xsl:call-template name="local.lps.path" />
- base.book.name:<xsl:call-template name="base.book.name" />
- dbhtml-dir <xsl:call-template name="dbhtml-dir"></xsl:call-template>
- </xsl:for-each>
+ initargs:
+ <xsl:for-each select="$initargs">
+ <xsl:sort select="@name" />
+ <xsl:value-of select="@name"/>,
+ </xsl:for-each>
</xsl:template>
+
+
+ <xsl:template name="unique-attribute">
+ <xsl:param name="issetter" select="false()"></xsl:param>
+ <xsl:param name="isinstancevar" select="true()"></xsl:param>
+ <xsl:param name="isinitarg" select="false()"></xsl:param>
+ <xsl:value-of select="@name"/>
+ <xsl:if test="$isinstancevar and $issetter"> (read/write)</xsl:if>
+ <xsl:if test="$isinstancevar and not($issetter)"> (readonly)</xsl:if>
+ <xsl:if test="not($isinstancevar) and $issetter"> (virtual) </xsl:if>
+ <xsl:if test="not($isinstancevar) and not($issetter)"> (strange)</xsl:if>
+ <xsl:if test="@modifiers='final'"> (final)</xsl:if>
+ <!--
+ <xsl:if test="$isinstancevar"> (instancevariable) </xsl:if>
+ <xsl:if test="not($isinstancevar)"> (virtual) </xsl:if>
+ -->
+ <xsl:if test="$isinitarg"> (initarg)</xsl:if>,
+ </xsl:template>
+
+
</xsl:stylesheet>
More information about the Laszlo-checkins
mailing list