db.glosssee =
[
- s:rule [
- context = "db:glosssee[@otherterm]"
- s:assert [
- test = "local-name(//*[@id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
- "@otherterm on glosssee must point to a glossentry."
+ s:pattern [
+ name = "Glosssary 'see' type constraint"
+ s:rule [
+ context = "db:glosssee[@otherterm]"
+ s:assert [
+ test = "local-name(//*[@id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+ "@otherterm on glosssee must point to a glossentry."
+ ]
]
]
]
db.glossseealso =
[
- s:rule [
- context = "db:glossseealso[@otherterm]"
- s:assert [
- test = "local-name(//*[@id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
- "@otherterm on glossseealso must point to a glossentry."
+ s:pattern [
+ name = "Glossary 'seealso' type constraint"
+ s:rule [
+ context = "db:glossseealso[@otherterm]"
+ s:assert [
+ test = "local-name(//*[@id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'"
+ "@otherterm on glossseealso must point to a glossentry."
+ ]
]
]
]
db.firstterm =
[
- s:rule [
- context = "db:firstterm[@linkend]"
- s:assert [
- test = "local-name(//*[@id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
- "@linkend on firstterm must point to a glossentry."
+ s:pattern [
+ name = "Glossary 'firstterm' type constraint"
+ s:rule [
+ context = "db:firstterm[@linkend]"
+ s:assert [
+ test = "local-name(//*[@id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+ "@linkend on firstterm must point to a glossentry."
+ ]
]
]
]
db.glossterm =
[
- s:rule [
- context = "db:glossterm[@linkend]"
- s:assert [
- test = "local-name(//*[@id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
- "@linkend on glossterm must point to a glossentry."
+ s:pattern [
+ name = "Glossary 'glossterm' type constraint"
+ s:rule [
+ context = "db:glossterm[@linkend]"
+ s:assert [
+ test = "local-name(//*[@id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+ "@linkend on glossterm must point to a glossentry."
+ ]
]
]
]
db.termdef =
[
- s:rule [
- context = "db:termdef"
- s:assert [
- test = "count(db:glossterm) != 1"
- "A termdef must contain a glossterm"
+ s:pattern [
+ name = "Glossary term definition constraint"
+ s:rule [
+ context = "db:termdef"
+ s:assert [
+ test = "count(db:glossterm) != 1"
+ "A termdef must contain a glossterm"
+ ]
]
]
]
db.seglistitem =
[
- s:rule [
- context = "db:seglistitem"
- s:assert [
- test = "count(db:seg) = count(../db:segtitle)"
- "The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist"
+ s:pattern [
+ name = "Cardinality of segments and titles"
+ s:rule [
+ context = "db:seglistitem"
+ s:assert [
+ test = "count(db:seg) = count(../db:segtitle)"
+ "The number of seg elements must be the same as the number of segtitle elements in the parent segmentedlist"
+ ]
]
]
]
db.synopfragmentref =
[
- s:rule [
- context = "db:synopfragmentref"
- s:assert [
- test = "local-name(//*[@id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
- "@linkend on synopfragmentref must point to a synopfragment."
+ s:pattern [
+ name = "Synopsis fragment type constraint"
+ s:rule [
+ context = "db:synopfragmentref"
+ s:assert [
+ test = "local-name(//*[@id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+ "@linkend on synopfragmentref must point to a synopfragment."
+ ]
]
]
]
db.footnoteref =
[
- s:rule [
- context = "db:footnoteref"
- s:assert [
- test = "local-name(//*[@id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
- "@linkend on footnoteref must point to a footnote."
+ s:pattern [
+ name = "Footnote reference type constraint"
+ s:rule [
+ context = "db:footnoteref"
+ s:assert [
+ test = "local-name(//*[@id=current()/@linkend]) = 'footnote' and namespace-uri(//*[@id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+ "@linkend on footnoteref must point to a footnote."
+ ]
]
]
]
</xsl:message>
-->
- <s:rule context="db:{$name}">
- <s:assert test="not(.//db:{name(.)})">
- <xsl:value-of select="name(.)"/>
- <xsl:text> must not occur in the descendants of </xsl:text>
- <xsl:value-of select="$name"/>
- </s:assert>
- </s:rule>
+ <s:pattern name="Element exclusion">
+ <s:rule context="db:{$name}">
+ <s:assert test="not(.//db:{name(.)})">
+ <xsl:value-of select="name(.)"/>
+ <xsl:text> must not occur in the descendants of </xsl:text>
+ <xsl:value-of select="$name"/>
+ </s:assert>
+ </s:rule>
+ </s:pattern>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$isStart > 0">
- <s:rule context="/db:{$name}">
- <s:assert test="@version">
- <xsl:text>The root element must have a version attribute.</xsl:text>
- </s:assert>
- </s:rule>
+ <s:pattern name="Root must have version">
+ <s:rule context="/db:{$name}">
+ <s:assert test="@version">
+ <xsl:text>The root element must have a version attribute.</xsl:text>
+ </s:assert>
+ </s:rule>
+ </s:pattern>
</xsl:if>
<xsl:apply-templates/>