]> granicus.if.org Git - docbook-dsssl/commitdiff
RFE 1998852 provide a mechanism to group parameters
authorNorman Walsh <ndw@nwalsh.com>
Thu, 22 Jan 2009 13:56:40 +0000 (13:56 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 22 Jan 2009 13:56:40 +0000 (13:56 +0000)
docbook/relaxng/docbook/src/programming.rnc
docbook/relaxng/tools/doc2dtd-tables.xsl
docbook/relaxng/tools/doc2dtd.xsl

index 5cea50f0f8bc29c863e294f5914d575eb63b5efe..1ae7f565780c1cb2f91f9addeac4804177fb06fa 100644 (file)
@@ -165,7 +165,7 @@ div {
          db.funcprototype.attlist,
          db.modifier*,
          db.funcdef,
-         (db.void | db.varargs | (db.paramdef+, db.varargs?)),
+         (db.void | db.varargs | ((db.paramdef|db.group.paramdef)+, db.varargs?)),
          db.modifier*
       }
 }
@@ -260,6 +260,30 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "group" ]
+   db:refpurpose [ "A group of parameters" ]
+]
+div {
+
+   db.group.paramdef.role.attribute = attribute role { text }
+   db.group.paramdef.choice.attribute = db.choice.opt.attribute
+
+   db.group.paramdef.attlist =
+      db.group.paramdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.group.paramdef.choice.attribute?
+
+   db.group.paramdef =
+      element group {
+         db.group.paramdef.attlist,
+         (db.paramdef|db.group.paramdef)+
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "paramdef" ]
    db:refpurpose [ "Information about a function parameter in a programming language" ]
@@ -605,7 +629,7 @@ div {
          db.constructorsynopsis.attlist,
          db.modifier*,
          db.methodname?,
-         (db.methodparam+ | db.void?),
+         ((db.methodparam|db.group.methodparam)+ | db.void?),
          db.exceptionname*
       }
 }
@@ -631,7 +655,7 @@ div {
          db.destructorsynopsis.attlist,
          db.modifier*,
          db.methodname?,
-         (db.methodparam+ | db.void?),
+         ((db.methodparam|db.group.methodparam)+ | db.void?),
          db.exceptionname*
       }
 }
@@ -658,7 +682,7 @@ div {
          db.modifier*,
          (db.type | db.void)?,
          db.methodname,
-         (db.methodparam+ | db.void),
+         ((db.methodparam|db.group.methodparam)+ | db.void),
          db.exceptionname*,
          db.modifier*
       }
@@ -718,6 +742,30 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "group" ]
+   db:refpurpose [ "A group of method parameters" ]
+]
+div {
+
+   db.group.methodparam.role.attribute = attribute role { text }
+   db.group.methodparam.choice.attribute = db.choice.opt.attribute
+
+   db.group.methodparam.attlist =
+      db.group.methodparam.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.group.methodparam.choice.attribute?
+
+   db.group.methodparam =
+      element group {
+         db.group.methodparam.attlist,
+         (db.methodparam|db.group.methodparam)+
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "varname" ]
    db:refpurpose [ "The name of a variable" ]
index 3fd96b80b304609c44726f102891971dfdf3119a..39bff1956ba19f33d70f9573a2bb26a54d94d62d 100644 (file)
     </dtd:group>
   </dtd:element>
 </xsl:variable>
-
 </xsl:stylesheet>
 
index c2cb0f368bf8ff27cdb9191ae73116915f712b37..9d885b9717ee81142cca6cc309f1bf042d3689d7 100644 (file)
       <!-- db.area.inareaset is the "right" one; it has an optional id -->
     </xsl:when>
 
+    <!-- handle the group patterns -->
+    <xsl:when test="@name = 'db.group'">
+      <dtd:element name="group">
+       <dtd:group>
+         <dtd:choice repeat="+">
+           <dtd:ref name="arg"/>
+           <dtd:ref name="group"/>
+           <dtd:ref name="option"/>
+           <dtd:ref name="synopfragmentref"/>
+           <dtd:ref name="replaceable"/>
+           <dtd:ref name="sbr"/>
+           <dtd:ref name="paramdef"/>
+           <dtd:ref name="methodparam"/>
+         </dtd:choice>
+       </dtd:group>
+      </dtd:element>
+
+      <dtd:attlist name="group">
+       <dtd:attribute name="role" occurs="optional"/>
+       <dtd:peref name="db.common.attributes"/>
+       <dtd:peref name="db.common.linking.attributes"/>
+       <dtd:attribute name="rep" default="norepeat" occurs="optional">(norepeat|repeat)</dtd:attribute>
+       <dtd:attribute name="choice" default="opt" occurs="optional">(opt|plain|req)</dtd:attribute>
+      </dtd:attlist>
+    </xsl:when>
+
+    <xsl:when test="@name = 'db.group.paramdef'
+                   or @name = 'db.group.methodparam'">
+      <!-- nop; handled by group above -->
+    </xsl:when>
+
     <!-- Handle the row patterns -->
 
     <xsl:when test="@name = 'db.entrytbl.row' and key('pattern', 'db.row')">