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>