]> granicus.if.org Git - docbook-dsssl/commitdiff
Experimental schemas
authorNorman Walsh <ndw@nwalsh.com>
Fri, 18 Jul 2008 11:29:59 +0000 (11:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 18 Jul 2008 11:29:59 +0000 (11:29 +0000)
docbook/relaxng/docbook/experiments/group-test.xml [new file with mode: 0644]
docbook/relaxng/docbook/experiments/group.rnc [new file with mode: 0644]

diff --git a/docbook/relaxng/docbook/experiments/group-test.xml b/docbook/relaxng/docbook/experiments/group-test.xml
new file mode 100644 (file)
index 0000000..0ad59a0
--- /dev/null
@@ -0,0 +1,40 @@
+<article xmlns="http://docbook.org/ns/docbook">
+<title>Method Parameter Grouping Test</title>
+
+<methodsynopsis>
+<type>int</type>
+<methodname>x</methodname>
+<methodparam>
+<type>int</type>
+<parameter>param1</parameter>
+</methodparam>
+<group choice="opt">
+<methodparam>
+<type>string</type>
+<parameter>param2</parameter>
+</methodparam>
+<methodparam>
+<type>float</type>
+<parameter>param3</parameter>
+</methodparam>
+<group choice="opt">
+<methodparam>
+<type>array</type>
+<parameter>param4</parameter>
+</methodparam>
+<methodparam>
+<type>array</type>
+<parameter>param5</parameter>
+</methodparam>
+<group choice="opt">
+<methodparam>
+<type>boolean</type>
+<parameter>param6</parameter>
+</methodparam>
+</group>
+</group>
+</group>
+</methodsynopsis>
+
+</article>
+
diff --git a/docbook/relaxng/docbook/experiments/group.rnc b/docbook/relaxng/docbook/experiments/group.rnc
new file mode 100644 (file)
index 0000000..9cd2394
--- /dev/null
@@ -0,0 +1,92 @@
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+namespace rng  = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace db = "http://docbook.org/ns/docbook"
+default namespace = "http://docbook.org/ns/docbook"
+
+include "../docbook.rnc" {
+
+   db.constructorsynopsis =
+      element constructorsynopsis {
+         db.constructorsynopsis.attlist,
+         db.modifier*,
+         db.methodname?,
+         ((db.methodparam|db.group.methodparam)+ | db.void?),
+         db.exceptionname*
+      }
+
+   db.destructorsynopsis =
+      element destructorsynopsis {
+         db.destructorsynopsis.attlist,
+         db.modifier*,
+         db.methodname?,
+         ((db.methodparam|db.group.methodparam)+ | db.void?),
+         db.exceptionname*
+      }
+
+   db.methodsynopsis =
+      element methodsynopsis {
+         db.methodsynopsis.attlist,
+         db.modifier*,
+         (db.type | db.void)?,
+         db.methodname,
+         ((db.methodparam|db.group.methodparam)+ | db.void),
+         db.exceptionname*,
+         db.modifier*
+      }
+
+   db.funcprototype =
+      element funcprototype {
+         db.funcprototype.attlist,
+         db.modifier*,
+         db.funcdef,
+         (db.void | db.varargs | ((db.paramdef|db.group.paramdef)+, db.varargs?)),
+         db.modifier*
+      }
+
+}
+
+[
+   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 [ "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)+
+      }
+}
+