]> granicus.if.org Git - docbook-dsssl/commitdiff
Support xml:id and XLink (at last)
authorNorman Walsh <ndw@nwalsh.com>
Sun, 17 Oct 2004 21:38:21 +0000 (21:38 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 17 Oct 2004 21:38:21 +0000 (21:38 +0000)
docbook/relaxng/src/docbook.rnc
docbook/relaxng/src/pool.rnc
docbook/relaxng/src/xlink.rnc [new file with mode: 0644]

index 932150357ef5998d827b9fc6f76546e5a7ed6452..5294e9e66e018b07192a3e4040f2396f18b45d8a 100644 (file)
@@ -25,6 +25,7 @@ start = db.set
        | db.section
        | db.para
 
+include "xlink.rnc"
 include "hier.rnc"
 include "sect1.rnc"
 include "refentry.rnc"
index 6e17d48acb198678f1623f4b603121aa091cd0b5..68bd27dad1c2a13b1c7a281aebfc7e356b45df81 100644 (file)
@@ -60,6 +60,7 @@ namespace rng  = "http://relaxng.org/ns/structure/1.0"
 namespace s = "http://www.ascc.net/xml/schematron"
 namespace db = "http://docbook.org/docbook-ng"
 namespace dbx = "http://sourceforge.net/projects/docbook/defguide/schema/extra-markup"
+namespace xlink = "http://www.w3.org/1999/xlink"
 default namespace = "http://docbook.org/docbook-ng"
 
 # ======================================================================
@@ -85,12 +86,19 @@ db.linkend.attribute  = attribute linkend { xsd:IDREF }
 
 db.linkends.attribute = attribute linkends { xsd:IDREFS }
 
-db.href.attribute = attribute href { text }
+db.href.attribute =
+   attribute xlink:href { text }
+ & attribute xlink:type { "simple" }?
+ & attribute xlink:role { xsd:anyURI }?
+ & attribute xlink:arcrole { xsd:anyURI }?
+ & attribute xlink:title { text }?
+ & attribute xlink:show { "new" | "replace" | "embed" | "other" }?
+ & attribute xlink:actuate { "onLoad" | "onRequest" | "other" | "none" }?
 
 # ======================================================================
 
 db.common.attributes =
-  attribute id { xsd:ID }?,
+  attribute xml:id { xsd:ID }?,
   attribute version { text }?,
   attribute xml:lang { text }?,
   attribute xml:base { text }?,
@@ -100,7 +108,7 @@ db.common.attributes =
   db.effectivity.attributes
 
 db.common.idreq.attributes =
-  attribute id { xsd:ID },
+  attribute xml:id { xsd:ID },
   attribute version { text }?,
   attribute xml:lang { text }?,
   attribute xml:base { text }?,
diff --git a/docbook/relaxng/src/xlink.rnc b/docbook/relaxng/src/xlink.rnc
new file mode 100644 (file)
index 0000000..65e8507
--- /dev/null
@@ -0,0 +1,99 @@
+# This file is part of DocBook NG: The "Eaux-de-vie" Release.
+
+# This schema is a "work-in-progress". It validates a DocBook-like grammar that
+# may, in some incarnation, form the basis for DocBook V.next. Or it may not.
+# At the moment, it's just an exploration by Norm. It has utterly no normative
+# value at all.
+#
+# Author: Norman Walsh, <ndw@nwalsh.com>
+# Source: Derived from DocBook XML V4.3
+# Release: $Id$
+#
+
+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/docbook-ng"
+namespace xlink = "http://www.w3.org/1999/xlink"
+default namespace = "http://docbook.org/docbook-ng"
+
+db.info.elements |= db.extendedlink
+
+# ======================================================================
+
+[
+   db:refname [ "extendedlink" ]
+   db:refpurpose [ "" ]
+]
+div {
+
+   db.extendedlink.role.attribute = attribute role { text }
+
+   db.extendedlink.attlist =
+      db.extendedlink.role.attribute?
+    & db.common.attributes
+    & attribute xlink:type { "extended" }?
+    & attribute xlink:role { xsd:anyURI }?
+    & attribute xlink:title { text }?
+
+   db.extendedlink =
+      element extendedlink {
+         db.extendedlink.attlist,
+         (db.locator|db.arc)+
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "locator" ]
+   db:refpurpose [ "" ]
+]
+div {
+
+   db.locator.role.attribute = attribute role { text }
+
+   db.locator.attlist =
+      db.locator.role.attribute?
+    & db.common.attributes
+    & attribute xlink:type { "locator" }?
+    & attribute xlink:href { text }
+    & attribute xlink:role { xsd:anyURI }?
+    & attribute xlink:title { text }?
+    & attribute xlink:label { xsd:NMTOKEN }?
+
+   db.locator =
+      element locator {
+         db.locator.attlist,
+         empty
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "arc" ]
+   db:refpurpose [ "" ]
+]
+div {
+
+   db.arc.role.attribute = attribute role { text }
+
+   db.arc.attlist =
+      db.arc.role.attribute?
+    & db.common.attributes
+    & attribute xlink:type { "arc" }?
+    & attribute xlink:arcrole { xsd:anyURI }?
+    & attribute xlink:title { text }?
+    & attribute xlink:show { "new" | "replace" | "embed" | "other" }?
+    & attribute xlink:actuate { "onLoad" | "onRequest" | "other" | "none" }?
+    & attribute xlink:from { xsd:NMTOKEN }?
+    & attribute xlink:to { xsd:NMTOKEN }?
+
+   db.arc =
+      element arc {
+         db.arc.attlist,
+         empty
+      }
+}
+