Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jul 2013 12:07:50 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-projects@freebsd.org
Subject:   svn commit: r42133 - in projects/db5/share: mk xml
Message-ID:  <201307031207.r63C7oLC053870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gabor
Date: Wed Jul  3 12:07:50 2013
New Revision: 42133
URL: http://svnweb.freebsd.org/changeset/doc/42133

Log:
  - Add support for RELAX NG validation since it is the normative DB 5.0
    schema.  The DTD validation still does a good job so there is no need
    to install Java; RNG validation is optional

Added:
  projects/db5/share/xml/freebsd50.rnc   (contents, props changed)
Modified:
  projects/db5/share/mk/doc.commands.mk
  projects/db5/share/mk/doc.docbook.mk

Modified: projects/db5/share/mk/doc.commands.mk
==============================================================================
--- projects/db5/share/mk/doc.commands.mk	Wed Jul  3 11:31:31 2013	(r42132)
+++ projects/db5/share/mk/doc.commands.mk	Wed Jul  3 12:07:50 2013	(r42133)
@@ -69,6 +69,8 @@ HTML2PDBOPTS?=	-y -d0 -Idef ${HTML2PDBFL
 HTML2TXT?=	${PREFIX}/bin/w3m
 HTML2TXTOPTS?=	-dump ${HTML2TXTFLAGS}
 
+JING?=		${PREFIX}/bin/jing
+
 XMLLINT?=	${PREFIX}/bin/xmllint
 XSLTPROC?=	${PREFIX}/bin/xsltproc
 

Modified: projects/db5/share/mk/doc.docbook.mk
==============================================================================
--- projects/db5/share/mk/doc.docbook.mk	Wed Jul  3 11:31:31 2013	(r42132)
+++ projects/db5/share/mk/doc.docbook.mk	Wed Jul  3 12:07:50 2013	(r42133)
@@ -56,6 +56,8 @@
 
 MASTERDOC?=	${.CURDIR}/${DOC}.xml
 
+DB5RNC?=	${DOC_PREFIX}/share/xml/freebsd50.rnc
+
 XSLPROF?=	/usr/local/share/xsl/docbook-ns/profiling/profile.xsl
 XSLXHTML?=	${DOC_PREFIX}/${LANGCODE}/share/xsl/freebsd-xhtml.xsl
 XSLXHTMLCHUNK?=	${DOC_PREFIX}/${LANGCODE}/share/xsl/freebsd-xhtml-chunk.xsl
@@ -388,6 +390,10 @@ lint validate: ${SRCS} ${schxslts}
 	  fi )
 .endfor
 .endif
+.if exists(${JING})
+	@${ECHO} "==> Validating with RELAX NG"
+	@${JING} -c ${DB5RNC} ${DOC}.parsed.xml
+.endif
 	@${RM} -rf ${CLEANFILES} ${CLEANDIRS} ${DOC}.parsed.xml
 
 # ------------------------------------------------------------------------

Added: projects/db5/share/xml/freebsd50.rnc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/db5/share/xml/freebsd50.rnc	Wed Jul  3 12:07:50 2013	(r42133)
@@ -0,0 +1,63 @@
+default namespace db = "http://docbook.org/ns/docbook"
+
+# $FreeBSD$
+
+# ======================================================================
+
+include "/usr/local/share/xml/docbook/5.0/rng/docbook.rnc" inherit = db {
+
+  # XXX: trademark not allowed in lineannotation in normal DocBook 5.0
+  db.lineannotation =
+    element lineannotation { db.lineannotation.attlist, (db._text | db.trademark)* }
+
+  # XXX: trademark not allowed in application in normal DocBook 5.0
+  db.application =
+    element application { db.application.attlist, (db._text | db.trademark)* }
+
+  # XXX: trademark not allowed in contrib in normal DocBook 5.0
+  db.contrib =
+    element contrib { db.contrib.attlist, (db._text | db.trademark)* }
+
+  # XXX: email not allowed in attribution in normal DocBook 5.0
+  db.attribution =
+    element attribution {
+      db.attribution.attlist,
+      (db._text
+       | db.person
+       | db.personname
+       | db.citetitle
+       | db.citation
+       | db.email )*
+    }
+
+  # FreeBSD extension: add buildtarget element to allowed inlines
+  db.extension.inlines = db.buildtarget
+     | db.revnumber
+#    | db.trademark
+
+
+  # FreeBSD extension: edition and releasetype profiling attributes
+  db.effectivity.attributes =
+    db.arch.attribute?
+    & db.audience.attribute?
+    & db.condition.attribute?
+    & db.conformance.attribute?
+    & db.os.attribute?
+    & db.revision.attribute?
+    & db.security.attribute?
+    & db.userlevel.attribute?
+    & db.vendor.attribute?
+    & db.wordsize.attribute?
+    & db.edition.attribute?
+    & db.releasetype.attribute?
+}
+
+# FreeBSD extension: buildtarget for make targets
+db.buildtarget = element buildtarget { (text | db.replaceable)* }
+
+# FreeBSD extension: profiling attribute for edition (online, print)
+db.edition.attribute = attribute edition { text }
+
+# FreeBSD extension: profiling attribute for release type (release,
+#   current, snapshot)
+db.releasetype.attribute = attribute releasetype { text }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307031207.r63C7oLC053870>