summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kovesdan <gabor@FreeBSD.org>2013-04-03 10:56:14 +0000
committerGabor Kovesdan <gabor@FreeBSD.org>2013-04-03 10:56:14 +0000
commitffd8fc666ffb19b4a8da20f4ce677c57bd997580 (patch)
treea09e17b455571f0fbef405653380a529bbc455df
parente8e2dfdbabfabc0fcdc5301c0f86ccc706e6b5b7 (diff)
- Allow foreign elements in Schematron
- Add some embedded XSLT to improve the input of validation failures
Notes
svn path=/projects/xml-tools/; revision=41361
-rw-r--r--share/mk/doc.docbook.mk2
-rw-r--r--share/xml/freebsd.sch16
2 files changed, 12 insertions, 6 deletions
diff --git a/share/mk/doc.docbook.mk b/share/mk/doc.docbook.mk
index bb90244dea..b75acc5388 100644
--- a/share/mk/doc.docbook.mk
+++ b/share/mk/doc.docbook.mk
@@ -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
diff --git a/share/xml/freebsd.sch b/share/xml/freebsd.sch
index 96280fe675..4072cd66b8 100644
--- a/share/xml/freebsd.sch
+++ b/share/xml/freebsd.sch
@@ -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>