svn commit: r41361 - in projects/xml-tools/share: mk xml
Gabor Kovesdan
gabor at FreeBSD.org
Wed Apr 3 10:56:16 UTC 2013
Author: gabor
Date: Wed Apr 3 10:56:14 2013
New Revision: 41361
URL: http://svnweb.freebsd.org/changeset/doc/41361
Log:
- Allow foreign elements in Schematron
- Add some embedded XSLT to improve the input of validation failures
Modified:
projects/xml-tools/share/mk/doc.docbook.mk
projects/xml-tools/share/xml/freebsd.sch
Modified: projects/xml-tools/share/mk/doc.docbook.mk
==============================================================================
--- projects/xml-tools/share/mk/doc.docbook.mk Wed Apr 3 09:05:13 2013 (r41360)
+++ projects/xml-tools/share/mk/doc.docbook.mk Wed Apr 3 10:56:14 2013 (r41361)
@@ -338,7 +338,7 @@ NO_RTF= yes
schxslts+= ${sch}.xsl
${sch}.xsl: ${sch}
- ${XSLTPROC} ${XSLSCH} ${.ALLSRC} > ${.TARGET}
+ ${XSLTPROC} --param allow-foreign "true" ${XSLSCH} ${.ALLSRC} > ${.TARGET}
.endfor
.endif
Modified: projects/xml-tools/share/xml/freebsd.sch
==============================================================================
--- projects/xml-tools/share/xml/freebsd.sch Wed Apr 3 09:05:13 2013 (r41360)
+++ projects/xml-tools/share/xml/freebsd.sch Wed Apr 3 10:56:14 2013 (r41361)
@@ -2,11 +2,17 @@
<!-- $FreeBSD$ -->
-<schema xmlns="http://purl.oclc.org/dsdl/schematron">
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<pattern name="Check file reference validity">
<rule context="//imagedata|//graphic">
- <report test="contains(@fileref, '.')">Image references cannot have an extension; the proper format is inferred by the output type to generate.</report>
- <report test="@format">Image format must not be specified; it is inferred by the output type to generate.</report>
+ <report test="contains(@fileref, '.')">Image reference (<xsl:value-of select="@fileref"/>) cannot have an extension; the proper format is inferred by the output type to generate.</report>
+ <report test="@format">Image reference (<xsl:value-of select="@fileref"/>) format must not be specified; it is inferred by the output type to generate.</report>
+ </rule>
+ </pattern>
+
+ <pattern name="Check cross-reference validity">
+ <rule context="//link">
+ <assert test="* or normalize-space()">Link (<xsl:value-of select="@linkend"/>) element must have a content; or use xref to auto-generate the linking text.</assert>
</rule>
</pattern>
@@ -20,10 +26,10 @@
<pattern name="Check profiling attributes">
<rule context="//*/@edition">
- <assert test="(. = 'online') or (. = 'print')">The edition attribute can only be set to 'online' or "print".</assert>
+ <assert test="(. = 'online') or (. = 'print')">Invalid edition value (<xsl:value-of select="."/>); must be either 'online' or "print".</assert>
</rule>
<rule context="//*/@os">
- <assert test="(. = 'freebsd8') or (. = 'freebsd9') or (. = 'freebsd10')">The os attribute can only be set to 'freebsd8', 'freebsd9' or 'freebsd10'.</assert>
+ <assert test="(. = 'freebsd8') or (. = 'freebsd9') or (. = 'freebsd10')">Invalid os value (<xsl:value-of select="."/>); must be either 'freebsd8', 'freebsd9' or 'freebsd10'.</assert>
</rule>
</pattern>
</schema>
More information about the svn-doc-projects
mailing list