[Laszlo-checkins] r3773 - openlaszlo/branches/legalsdt/docs/src/xsl

jgrandy@openlaszlo.org jgrandy at openlaszlo.org
Fri Feb 9 15:19:27 PST 2007


Author: jgrandy
Date: 2007-02-09 15:19:25 -0800 (Fri, 09 Feb 2007)
New Revision: 3773

Modified:
   openlaszlo/branches/legalsdt/docs/src/xsl/js2doc2dbk.xsl
Log:
checkpoint to private branch

Modified: openlaszlo/branches/legalsdt/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/legalsdt/docs/src/xsl/js2doc2dbk.xsl	2007-02-09 22:39:16 UTC (rev 3772)
+++ openlaszlo/branches/legalsdt/docs/src/xsl/js2doc2dbk.xsl	2007-02-09 23:19:25 UTC (rev 3773)
@@ -192,16 +192,19 @@
 
         <xsl:call-template name="describe-members">
           <xsl:with-param name="members" select="&objectvalue;/property[not(@name='prototype') and not(child::function) and not(child::event)]"/>
+          <xsl:with-param name="static" select="true()"/>
           <xsl:with-param name="title" select="'Static Fields'"/>
         </xsl:call-template>
         
         <xsl:call-template name="describe-members">
           <xsl:with-param name="members" select="&objectvalue;/property[not(@name='prototype') and child::function]"/>
+          <xsl:with-param name="static" select="true()"/>
           <xsl:with-param name="title" select="'Static Methods'"/>
         </xsl:call-template>
         
         <xsl:call-template name="describe-members">
           <xsl:with-param name="members" select="&objectvalue;/property[not(@name='prototype') and child::event]"/>
+          <xsl:with-param name="static" select="true()"/>
           <xsl:with-param name="title" select="'Static Events'"/>
         </xsl:call-template>
         
@@ -258,7 +261,9 @@
     </xsl:template>
 
     <xsl:template name="describe-members">
+      <!-- to do: use translate($name,'_$','  ') to properly sort members -->
       <xsl:param name="members"/>
+      <xsl:param name="static"/>
       <xsl:param name="title"/>
       <xsl:param name="subtitle"/>
       <xsl:variable name="visible-members" select="$members[contains($visibility.filter, at access)]"/>
@@ -266,12 +271,15 @@
         <variablelist>
           <title><xsl:value-of select="$title"/> (<xsl:value-of select="count($visible-members)"/>)</title>
           <xsl:if test="$subtitle"><para><xsl:value-of select="$subtitle"/></para></xsl:if>
-          <xsl:apply-templates select="$visible-members" mode="describe-member"/>
+          <xsl:apply-templates select="$visible-members" mode="describe-member">
+            <xsl:with-param name="static" select="$static"/>
+          </xsl:apply-templates>
         </variablelist>
       </xsl:if>
     </xsl:template>
 
     <xsl:template match="initarg|property" mode="describe-member">
+      <xsl:param name="static"/>
       <xsl:variable name="name" select="@name"/>
       <xsl:variable name="sortasname" select="translate($name,'_$','  ')"/>
       <xsl:variable name="id" select="@id"/>
@@ -291,6 +299,7 @@
           <xsl:apply-templates select="." mode="synopsis">
             <xsl:with-param name="add-link" select="false()"/>
             <xsl:with-param name="language" select="'javascript'"/>
+            <xsl:with-param name="static" select="$static"/>
           </xsl:apply-templates>
         </term>
         <listitem>
@@ -571,16 +580,29 @@
 
           <xsl:choose>
             <xsl:when test="$verbose">
-            <xsl:variable name="members" select="class/property[not(@name='setters')]"/>
-            <xsl:variable name="public-members" select="$members[&ispublic;]"/>
-            <xsl:if test="count($public-members) > 0">
-              <xsl:for-each select="$public-members">
-                <xsl:sort select="translate(@name,'_$','  ')"/>
-                <xsl:apply-templates select="." mode="synopsis">
-                  <xsl:with-param name="add-link" select="$add-sublink"/>
-                </xsl:apply-templates>
-              </xsl:for-each>
-            </xsl:if>
+              <xsl:if test="$language='javascript'">
+                <xsl:variable name="static-members" select="class/property[not(@name='prototype') and not(@name='setters')]"/>
+                <xsl:variable name="public-static-members" select="$static-members[&ispublic;]"/>
+                <xsl:if test="count($public-static-members) > 0">
+                  <xsl:for-each select="$public-static-members">
+                    <xsl:sort select="translate(@name,'_$','  ')"/>
+                    <xsl:apply-templates select="." mode="synopsis">
+                      <xsl:with-param name="add-link" select="$add-sublink"/>
+                      <xsl:with-param name="static" select="true()"/>
+                    </xsl:apply-templates>
+                  </xsl:for-each>
+                </xsl:if>
+              </xsl:if>
+              <xsl:variable name="members" select="class/property[@name='prototype']/object/property"/>
+              <xsl:variable name="public-members" select="$members[&ispublic;]"/>
+              <xsl:if test="count($public-members) > 0">
+                <xsl:for-each select="$public-members">
+                  <xsl:sort select="translate(@name,'_$','  ')"/>
+                  <xsl:apply-templates select="." mode="synopsis">
+                    <xsl:with-param name="add-link" select="$add-sublink"/>
+                  </xsl:apply-templates>
+                </xsl:for-each>
+              </xsl:if>
             </xsl:when>
             <xsl:otherwise><xsl:text>...</xsl:text></xsl:otherwise>
           </xsl:choose>
@@ -626,22 +648,26 @@
     <xsl:template match="initarg|property" mode="synopsis">
       <xsl:param name="add-link"/>
       <xsl:param name="language"/>
+      <xsl:param name="static"/>
       <xsl:call-template name="fieldsynopsis">
         <xsl:with-param name="field" select="."/>
         <xsl:with-param name="add-link" select="$add-link"/>
         <xsl:with-param name="id" select="@id"/>
         <xsl:with-param name="language" select="$language"/>
+        <xsl:with-param name="static" select="$static"/>
       </xsl:call-template>
     </xsl:template>
 
     <xsl:template match="property[child::function]" mode="synopsis">
       <xsl:param name="add-link"/>
       <xsl:param name="language"/>
+      <xsl:param name="static"/>
       <xsl:apply-templates select="function" mode="synopsis">
         <xsl:with-param name="add-link" select="$add-link"/>
         <xsl:with-param name="name" select="@name"/>
         <xsl:with-param name="id" select="@id"/>
         <xsl:with-param name="language" select="$language"/>
+        <xsl:with-param name="static" select="$static"/>
       </xsl:apply-templates>
     </xsl:template>
 
@@ -651,8 +677,9 @@
       <xsl:param name="language"/>
       <xsl:param name="name" select="(@name | 'construct')[1]"/>
       <xsl:param name="id" select="@id"/>
+      <xsl:param name="static"/>
       <methodsynopsis language="{$language}">
-        <xsl:if test="@static = true"><modifier>static</modifier></xsl:if>
+        <xsl:if test="$static"><modifier>static</modifier></xsl:if>
         <xsl:if test="@access"><modifier><xsl:value-of select="@access"/></modifier></xsl:if>
         <xsl:if test="@modifiers">
           <xsl:call-template name="insert-modifiers">
@@ -680,7 +707,9 @@
     <xsl:template match="event" mode="synopsis">
       <xsl:param name="language"/>
       <xsl:param name="add-link" select="false()"/>
+      <xsl:param name="static"/>
       <fieldsynopsis role="event" language="{$language}">
+        <xsl:if test="$static"><modifier>static</modifier></xsl:if>
         <xsl:if test="@access"><modifier><xsl:value-of select="@access"/></modifier></xsl:if>
         <xsl:if test="@modifiers">
           <xsl:call-template name="insert-modifiers">



More information about the Laszlo-checkins mailing list