293.6. 架构规则和报告示例
以下是 schematron 规则的示例
<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"> <title>Check Sections 12/07</title> <pattern id="section-check"> <rule context="section"> <assert test="title">This section has no title</assert> <assert test="para">This section has no paragraphs</assert> </rule> </pattern> </schema>
以下是 schematron 报告的示例:
<?xml version="1.0" encoding="UTF-8"?> <svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:iso="http://purl.oclc.org/dsdl/schematron" xmlns:saxon="http://saxon.sf.net/" xmlns:schold="http://www.ascc.net/xml/schematron" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaVersion="" title=""> <svrl:active-pattern document="" /> <svrl:fired-rule context="chapter" /> <svrl:failed-assert test="title" location="/doc[1]/chapter[1]"> <svrl:text>A chapter should have a title</svrl:text> </svrl:failed-assert> <svrl:fired-rule context="chapter" /> <svrl:failed-assert test="title" location="/doc[1]/chapter[2]"> <svrl:text>A chapter should have a title</svrl:text> </svrl:failed-assert> <svrl:fired-rule context="chapter" /> </svrl:schematron-output>
提示
有用的链接和资源 - Mulleberry 技术 介绍 Schematron。PDF 中的良好文档,使您开始实施架构。* Schematron 官方网站.这包括其他资源的链接