goba            Sun Aug  4 07:50:14 2002 EDT

  Modified files:              
    /phpdoc/xsl html-common.xsl htmlhelp.xsl.in 
  Log:
  Add our special methodsynopsys rendering code for XSL sheets. Override
  the default to use this, and also use this for special HTML Help needs.
  
  
Index: phpdoc/xsl/html-common.xsl
diff -u phpdoc/xsl/html-common.xsl:1.16 phpdoc/xsl/html-common.xsl:1.17
--- phpdoc/xsl/html-common.xsl:1.16     Fri Jul 26 08:17:47 2002
+++ phpdoc/xsl/html-common.xsl  Sun Aug  4 07:50:14 2002
@@ -3,7 +3,7 @@
 
   Common HTML customizations
 
-  $Id: html-common.xsl,v 1.16 2002/07/26 12:17:47 goba Exp $
+  $Id: html-common.xsl,v 1.17 2002/08/04 11:50:14 goba Exp $
 
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -201,6 +201,54 @@
     <xsl:with-param name="allow-anchors" select="0"/>
     <xsl:with-param name="template" select="'%t'"/>
   </xsl:call-template>
+</xsl:template>
+
+<!-- Rendering of methodsynopsis. The output of this should look like:
+     
+     int preg_match_all ( string pattern, string subject, array matches [, int flags])
+     
+     working from a structure like this:
+     
+     <methodsynopsis>
+      <type>int</type><methodname>preg_match_all</methodname>
+      <methodparam><type>string</type><parameter>pattern</parameter></methodparam>
+      <methodparam><type>string</type><parameter>subject</parameter></methodparam>
+      <methodparam><type>array</type><parameter>matches</parameter></methodparam>
+      <methodparam 
+choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
+     </methodsynopsis>
+-->
+
+<!-- Override default [java] methodsynopsis rendering -->
+<xsl:template match="methodsynopsis">
+  <xsl:apply-templates mode="php"/>
+</xsl:template>
+
+<!-- Print out the return type, the method name, then the parameters.
+     Close all the optional signs opened and close the prentheses -->
+<xsl:template match="methodsynopsis" mode="php">
+  <xsl:value-of select="./type/text()"/>
+  <xsl:text> </xsl:text>
+  <xsl:value-of select="./methodname/text()"/>
+  <xsl:text> ( </xsl:text>
+  <xsl:apply-templates select="./methodparam" mode="php"/>
+  <xsl:for-each select="./methodparam[@choice = 'opt']">
+    <xsl:text>]</xsl:text>
+  </xsl:for-each>
+  <xsl:text> )</xsl:text>
+</xsl:template>
+
+<!-- Print out optional sign if needed, then a comma if this is
+     not the first param, then the type and the parameter name -->
+<xsl:template match="methodsynopsis/methodparam" mode="php">
+  <xsl:if test="@choice = 'opt'">
+    <xsl:text> [</xsl:text>
+  </xsl:if>
+  <xsl:if test="position() != 1">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:value-of select="./type/text()"/>
+  <xsl:text> </xsl:text>
+  <xsl:value-of select="./parameter/text()"/>
 </xsl:template>
 
 </xsl:stylesheet>
Index: phpdoc/xsl/htmlhelp.xsl.in
diff -u phpdoc/xsl/htmlhelp.xsl.in:1.32 phpdoc/xsl/htmlhelp.xsl.in:1.33
--- phpdoc/xsl/htmlhelp.xsl.in:1.32     Sun Aug  4 06:46:29 2002
+++ phpdoc/xsl/htmlhelp.xsl.in  Sun Aug  4 07:50:14 2002
@@ -3,7 +3,7 @@
 
   HTML Help specific stylesheet
 
-  $Id: htmlhelp.xsl.in,v 1.32 2002/08/04 10:46:29 goba Exp $
+  $Id: htmlhelp.xsl.in,v 1.33 2002/08/04 11:50:14 goba Exp $
 
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -222,7 +222,7 @@
      but print out them in header -->
 <xsl:template match="methodsynopsis"/>
 <xsl:template match="methodsynopsis" mode="htmlhelp.methodsyn">
-  <xsl:apply-templates/><br/>
+  <xsl:apply-templates mode="php"/><br/>
 </xsl:template>
 
 <!-- do not enclose <methodname> in a <tt> -->



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to