W3C home > Mailing lists > Public > public-ws-desc-eds@w3.org > November 2006

2002/ws/desc/test-suite/xmlcatalog/schematron schematron1-5.dtd,NONE,1.1 schematron1-5.xsd,NONE,1.1 schematron1-5.sch,NONE,1.1 XSD2Schtrn.xsl,NONE,1.1 XSD2Schtrn.zip,NONE,1.1 build.xml,1.1,1.2 wsdlcm.sch,1.1,1.2

From: Arthur Ryman via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 17 Nov 2006 22:46:02 +0000
To: public-ws-desc-eds@w3.org
Message-Id: <E1GlCTC-0005sm-DU@lionel-hutz.w3.org>

Update of /sources/public/2002/ws/desc/test-suite/xmlcatalog/schematron
In directory hutz:/tmp/cvs-serv22437/test-suite/xmlcatalog/schematron

Modified Files:
	build.xml wsdlcm.sch 
Added Files:
	schematron1-5.dtd schematron1-5.xsd schematron1-5.sch 
	XSD2Schtrn.xsl XSD2Schtrn.zip 
Log Message:
updated schematron resources

Index: wsdlcm.sch
===================================================================
RCS file: /sources/public/2002/ws/desc/test-suite/xmlcatalog/schematron/wsdlcm.sch,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** wsdlcm.sch	14 Nov 2006 08:18:20 -0000	1.1
--- wsdlcm.sch	17 Nov 2006 22:46:00 -0000	1.2
***************
*** 21,23 ****
--- 21,24 ----
  	<sch:ns prefix="cmextensions"
  		uri="http://www.w3.org/2002/ws/desc/wsdl/component-extensions" />
+ 		
  </sch:schema>
\ No newline at end of file

Index: build.xml
===================================================================
RCS file: /sources/public/2002/ws/desc/test-suite/xmlcatalog/schematron/build.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** build.xml	14 Nov 2006 08:18:20 -0000	1.1
--- build.xml	17 Nov 2006 22:46:00 -0000	1.2
***************
*** 45,48 ****
--- 45,60 ----
  	</target>
  
+ 	<target name="get.schematron1-5.dtd">
+ 		<get dest="schematron1-5.dtd" src="http://www.ascc.net/xml/schematron/schematron1-5.dtd" />
+ 	</target>
+ 
+ 	<target name="get.schematron1-5.sch">
+ 		<get dest="schematron1-5.sch" src="http://xml.ascc.net/schematron/schematron1-5.sch" />
+ 	</target>
+ 
+ 	<target name="get.schematron1-5.xsd">
+ 		<get dest="schematron1-5.xsd" src="http://xml.ascc.net/schematron/schematron1-5.xsd" />
+ 	</target>
+ 
  </project>
  

--- NEW FILE: schematron1-5.sch ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema PUBLIC "http://www.ascc.net/xml/schematron"
   "http://www.ascc.net/xml/schematron/schematron1-5.dtd">
<schema xmlns="http://www.ascc.net/xml/schematron"
       xmlns:sch="http://www.ascc.net/xml/schematron"
       xml:lang="en"                                       
       xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
       xsi:schemaLocation="http://www.ascc.net/xml/schematron
          http://www.ascc.net/xml/schematron/schematron1-5.xsd" 
	fpi="+//IDN ascc.net//SGML XML Schematron 1.5 Schema for Schematron 1.5//EN"
	schemaVersion="2002/08/19"  version="1.5"
        defaultPhase="New"
       icon="http://www.ascc.net/xml/resource/schematron/bilby.jpg">

	<title>Schematron 1.5</title>
	<ns uri="http://www.ascc.net/xml/schematron" prefix="sch"/>

        <p>Copyright (C) 2001 Rick Jelliffe. 
	Freely and openly available under zlib/libpng license.</p>
	<p>This schema is open: it only
 	considers elements in the Schematron namespce. 
	Elements and attributes from other namespaces can be used freely.
 	This schema does not assume that the Schematron schema is the top-level element.
 	</p>
  	<p>This schema uses conservative rules (e.g. no use of key()) to 
  	work with incomplete XSLT-based implementations.</p>


        <phase id="New">
		<p>For creating new documents.</p>
		<active pattern="mini"/>
	</phase>
       <phase id="Draft">
                <p>For fast validation of draft documents.</p>
		<active pattern="required" />
	</phase>
        <phase id="Full">
                <p>For final validation and tracking some tricky problems.</p>
		<active pattern="mini" />
		<active pattern="required" />
		<active pattern="attributes" />
        </phase>

	<pattern name="Minimal Schematron" id="mini">
	<p>These rule establish the smallest possible Schematron document.
	These rules may be handy for beginners with starting documents.</p>
		<rule context="/">
			<assert test="//sch:schema"
			>A Schematron schema should have a schema element. </assert>
                        <report test="count(//sch:schema) > 1"
			>There should only be one schema per document.</report>
			<assert test="//sch:schema/sch:pattern "
			>A Schematron schema should have pattern elements inside the schema element</assert>
			<assert test="//sch:schema/sch:pattern/sch:rule[@context]"
			>A Schematron schema should have rule elements inside the pattern elements. Rule elements should have a context attribute.</assert>
			<assert test="//sch:schema/sch:pattern/sch:rule/sch:assert[@test] 
 			or //sch:schema/sch:pattern/sch:rule/sch:report[@test]" 
			>A Schematron schema should have  assert or report elements inside the rule elements. Assert and report elements should have a test attribute.</assert>
		</rule>
        </pattern>

	<pattern name="Schematron Elements and Required Attributes" id="required">
		<p>Rules defining occurrence rules for Schematron elements
 		and their required attributes. Note that for attributes,
 		it is not that the attribute is being tested for existance,
 		but whether it has a value.</p>
		<p>Some elements require certain children or attributes. 
  		Other elements require certain parents. Schematron can represent 
  		both these kinds of coupling. </p> 

                <rule abstract="true" id="report-n-assert" >
			<assert test="parent::sch:rule"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element rule.</assert>
			<assert test="string-length(normalize-space(text())) &gt; 0"
			>A <name/> element should contain a natural language sentence.</assert>
			<assert test="string-length(normalize-space(@test)) &gt; 0"
			>The element <name/> must have a value for the attribute test. This should be an XSLT expression.</assert>
			<report test="@context"
			>The <name/> element cannot have a context attribute: that should go on the rule element.</report>
		</rule>
                <rule context="sch:assert | sch:report">
			<extends rule="report-n-assert" />
		</rule> 

		<rule context="sch:schema">
			<assert test="count(sch:*) = count(sch:title|sch:ns|sch:phrase|sch:p|sch:pattern|sch:diagnostics|sch:phase)"			
			>The element <name/> should contain only the elements title, ns, phrase, p, pattern, diagnostics or phase from the Schematron namespace.</assert>
			<assert test="sch:pattern"
			>A schema element should contain at least one pattern element.</assert>
			<report test="ancestor::sch:*"
			>A Schematron schema should not appear as a child of another Schematron schema.</report>
			<report test="@defaultPhase and sch:phase and not(@defaultPhase='#ALL') and not(sch:phase[@id= current()/@defaultPhase])"
			>The value of the defaultPhase attribute must match the id of a phase element.</report>
		</rule> 
		<rule context="sch:title">
			<assert test="parent::sch:schema"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element schema.</assert>
			<assert test="count(preceding-sibling::sch:*) = 0"
			>The element <name/> should only appear as the first element from the Schematron namespace in the schema element.</assert>
		</rule>
		<rule context="sch:ns">
			<assert test="parent::sch:schema"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element schema.</assert>
			<assert test="string-length(normalize-space(@prefix)) &gt; 0"
			>The element <name/> must have a value for the attribute prefix.</assert>
			<assert test="string-length(normalize-space(@uri)) &gt; 0"
			>The element <name/> must have a value for the attribute uri.</assert>
			<assert test="count(preceding-sibling::sch:*) = count(preceding-sibling::sch:title)"
			>The <name/> element must come before any other Schematron elements, except the title</assert>
			<report test="*"
			>The <name/> element should be empty.</report>
		</rule>
		<rule context="sch:phase">
			<assert test="parent::sch:schema"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element schema.</assert>
			<assert test="count(preceding-sibling::sch:*) = count(preceding-sibling::sch:phase)
			+ count(preceding-sibling::sch:title) + count(preceding-sibling::sch:ns)
			+ count(preceding-sibling::sch:p)"
			>The <name/> elements must come before any other Schematron elements, except the title, ns and p elements</assert>
		</rule>
		<rule context="sch:active"> 
			<assert test="parent::sch:phase"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element phase.</assert>
			<assert test="string-length(normalize-space(@pattern)) &gt; 0"
			>The element <name/> must have a value for the attribute pattern.</assert>
		</rule>
		<rule context="sch:pattern">
			<assert test="parent::sch:schema"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element schema.</assert>
			<assert test="count(sch:*) = count(sch:rule|sch:p)"
			>The element <name/> should contain only rule and p elements from the Schematron namespace.</assert>
			<assert test="sch:rule"
			>The element <name/> should contain at least one rule element.</assert>
			<assert test="string-length(normalize-space(@name)) &gt; 0"
			>The element <name/> must have a value for the attribute name.</assert>
			<assert test="count(sch:title) &lt; 2"
			>A Schematron schema cannot have more than one title element.</assert>
		</rule>
		<rule context="sch:rule[@abstract='true']">
			<assert test="parent::sch:pattern"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element pattern.</assert>
			<assert test="count(sch:*) = count(sch:assert |sch:report|sch:key|sch:extends ) "
			>The element <name/> should contain only the elements assert, report, key or extends from the Schematron namespace.</assert>
			<assert test="sch:assert | sch:report | sch:extends"
			>The element <name/> should contain at least one assert, report or extends elements.</assert>
			<report test="@test"
			>The <name/> element cannot have a test attribute: that should go on a report or assert element.</report>
			<report test="@context"
			>An abstract rule cannot have a context attribute.</report>
			<assert test="string-length(normalize-space(@id)) &gt; 0"
			>An rule should have an id attribute. </assert>
		</rule>
		<rule context="sch:rule">
			<assert test="parent::sch:pattern"  diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element pattern.</assert>
			<assert test="count(sch:*) = count(sch:assert |sch:report|sch:key|sch:extends ) "
			>The element <name/> should contain only the elements assert, report, key or extends from the Schematron namespace.</assert>
			<assert test="sch:assert | sch:report | sch:extends"
			>The element <name/> should contain at least one assert, report or extends elements.</assert>
			<report test="@test"
			>The <name/> element cannot have a test attribute: that should go on a report or assert element.</report>
			<assert test="string-length(normalize-space(@context)) &gt; 0"
			>A rule should have a context attribute. This should be an XSLT pattern for selecting nodes to make assertions and reports about. (Abstract rules do not require a context attribute.)</assert>
			<assert test="not(@abstract) or (@abstract='false')  or (@abstract='true')"
			>In a rule, the abstract attribute is optional, and can have values 'true' or 'false'</assert>
		</rule>
		<rule context="sch:diagnostics">
			<assert test="parent::sch:schema"  diagnostics="bad-parent"
			>The element <name/> should only appear as a child of the schema element</assert>
			<report test="following-sibling::sch:*"
			>The element <name/> should be the last element in the schema.</report>
		</rule>
		<rule context="sch:diagnostic">
			<assert test="parent::sch:diagnostics"  diagnostics="bad-parent"
			>The element <name/> should only appear in the diagnostics section.</assert>
			<assert test="string-length(normalize-space(@id)) &gt; 0"
			>The element <name/> must have a value for the attribute id. </assert>
		</rule>
		<rule context="sch:key">
			<assert test="parent::sch:rule"  diagnostics="bad-parent"
			>The element <name/> should only appear in a rule.</assert>
			<assert test="string-length(normalize-space(@name)) &gt; 0"
			>The element <name/> must have a value for the attribute name. </assert>
			<assert test="string-length(normalize-space(@path)) &gt; 0"
			>The element <name/> must have a value for the attribute path.   This should be an XPath expression.</assert>
			<report test="*"
			>The <name/> element should be empty.</report>
		</rule>
		<rule context="sch:extends">
			<assert test="parent::sch:rule"  diagnostics="bad-parent"
			>The element <name/> should only appear in a rule.</assert>
			<assert test="string-length(normalize-space(@rule)) &gt; 0"
			>The element <name/> must have a value for the attribute rule. </assert>
			<report test="*"
			>The <name/> element should be empty.</report>
                        <assert test="/*//sch:rule[@abstract='true'][@id = current()/@rule]"
                        >The <name/> element should have an attribute rule which gives the id of an abstract rule.</assert>
		</rule>
		<rule context="sch:p">
			<assert test="parent::sch:*"  diagnostics="bad-parent"
			>The element <name/> should only appear inside an element from the Schematron namespace. It is equivalent to the HTML element of the same name.</assert>
		</rule>
		<rule context="sch:name">
			<assert test="parent::sch:assert | parent::sch:report |parent::sch:p | parent::sch:diagnostic"
			 diagnostics="bad-parent"
			>The element <name/> should only appear inside a Schematron elements p (paragraph) or diagnostic.</assert>
			<report test="*"
			>The <name/> element should be empty.</report>
		</rule>
		<rule context="sch:emph">
			<assert test="parent::sch:p | parent::sch:diagnostic"
			 diagnostics="bad-parent"
			>The element <name/> should only appear inside a Schematron elements p (paragraph) or diagnostic. It is equivalent to the HTML element of the same name.</assert>
		</rule>
		<rule context="sch:dir">
			<assert test="parent::sch:p | parent::sch:diagnostic"
			 diagnostics="bad-parent"
			>The element <name/> should only appear inside a Schematron elements p (paragraph) or diagnostic.</assert>
			<assert test="@value and (@value='rtl' or @value='ltr')"
			>The attribute value of the <name/> element must be lowercase "rtl" or "ltr". It is equivalent to the HTML element of the same name.</assert>
		</rule>
		<rule context="sch:span">
			<assert test="parent::sch:p | parent::sch:diagnostic"
			 diagnostics="bad-parent"
			>The element <name/> should only appear inside a Schematron elements p (paragraph) or diagnostic. It is equivalent to the HTML element of the same name.</assert>
		</rule>
		<rule context="sch:value-of">
			<assert test="parent::sch:diagnostic"   diagnostics="bad-parent"
			>The element <name/> should only appear inside the Schematron element diagnostic.</assert>
			<assert test="string-length(normalize-space(@select)) &gt; 0"
			>The element <name/> must have a value for the attribute select. The value should be an XPath expression.</assert>
			<report test="*"
			>The <name/> element should be empty.</report>
		</rule>
                <rule context="sch:*">
			<report test="1=1" diagnostics="spelling"
			>The <name/> element is not an element from the Schematron 1.5 namespace</report>
                </rule>
	</pattern>

	<pattern name="Schematron Attributes" id="attributes" >
		<p>These rules specify which elements each attribute can belong to, and what they mean.</p>
		<rule context="sch:*">
			<report test="@abstract and not(self::sch:rule)"
			>The boolean attribute abstract can only appear on the element rule. An abstract rule can be used to extend other rules.</report>
			<report test="@class and not(self::sch:span or self::sch:p)"
			>The attribute class can only appear on the elements span and p. It gives a name that can be used by CSS stylesheets.</report>
			<report test="@context and not(self::sch:rule)"
			>The attribute context can only appear on the element rule. It is an XPath pattern.</report>
			<report test="@defaultPhase and not(self::sch:schema)"
			>The attribute defaultPhase can only appear on the element schema. It is the id of the phase that will initially be active.</report>
			<report test="@diagnostics and not(self::sch:assert or self::sch:report)"
			>The attribute diagnostics can only appear on the elements assert and report. It is the id of some relevent diagnostic or hint.</report>
			<report test="@fpi and not(self::sch:schema or self::sch:phase)"
			>The attribute fpi can only appear on the elements schema and phase. It is an ISO Formal Public Identifier.</report>
			<report test="@icon and not(self::sch:schema or self::sch:assert or
      			self::sch:diagnostic or self::sch:key or self::sch:p or self::sch:pattern
      			or self::sch:phase or self::sch:assert )"
			>The attribute icon can only appear on the elements schema, assert , diagnostic, key, p, pattern, phase and report. It is the URL of a small image. </report>
			<report test="@id and not(self::sch:schema or self::sch:assert or
     			self::sch:p or self::sch:pattern or self::sch:phase or 
     			self::sch:report or self::sch:rule or self::sch:diagnostic)"
			>The attribute id can only appear on the elements schema, assert, p, pattern, phase, report, rule and diagnostic. It is a name, it should not start with a number or symbol.</report>
			<report test="@name and not(self::sch:key or self::sch:pattern)"
			>The attribute name can only appear on the elements pattern and key.</report>
			<report test="@ns and not(self::sch:schema)"
			>The attribute ns can only appear on the schema element.  It is the namespace to which the names in the role attributes belong.</report>
			<report test="@path and not(self::sch:key | self::sch:name)"
			>The attribute path can only appear on the element key. It is an XPath path.</report>
			<report test="@pattern and not(self::sch:active)"
			>The attribute pattern can only appear on the element active. It gives the id of a pattern that should be activated in that phase.</report>
			<report test="@prefix and not(self::sch:ns)"
			>The attribute prefix can only appear on the element ns.</report>
			<report test="@role and not(self::sch:assert or self::sch:report or self::sch:rule)"
			>The attribute role can only appear on the element assert, report or rule. It is a simple name, not a phrase.</report>
			<report test="@rule and not(self::sch:extends)"
			>The attribute rule can only appear on the element extends. It is the id of an abstract rule declared elsewhere in the schema.</report>
			<report test="@see and not(self::sch:pattern)"
			>The attribute see can only appear on the element pattern. It is the URL of some documentation for the schema.</report>
			<report test="@select and not(self::sch:value-of)"
			>The attribute select can only appear on the element value-of, with the same meaning as in XSLT. It is an XSLT pattern.</report>
	                <report test="@schemaVersion and not(self::sch:schema)"
			>The attribute schemaVersion can only appear on the element schema. It gives the version of the schema.</report>
			<report test="@subject and not(self::sch:assert or self::sch:report)"
			>The attribute subject can only appear on the elements assert and report. It is an XSLT pattern. </report>
			<report test="@test and not(self::sch:assert or self::sch:report)"
			>The attribute test can only appear on the elements assert and report. It is an XPath expression with the XSLT additional functions.</report>
			<report test="@uri and not(self::sch:ns)"
			>The attribute uri can only appear on the element ns. It is a URI.</report>
			<report test="@value and not(self::sch:dir)"
			>The attribute value can only appear on the element dir. It sets the directionality of text: 'rtl' is right-to-left and 'ltr' is left-to-right.</report>
			<report test="@version and not(self::sch:schema)"
			>The attribute version can only appear on the element schema. It gives the version of Schematron required as major number "." minor number.</report>
			<assert test="not(attribute::*) or attribute::*[string-length(normalize-space(text()))=0]"
			>Every attribute on a Schematron element must have a value if it is specified.</assert>                  
		</rule>
	</pattern>
        <diagnostics>
		<diagnostic id="spelling"
		>Check this is not a spelling error. The recognized element names are
		schema, title, ns, pattern, rule, key, assert, report, diagnostics, diagnostic,
		name, value-of, emph and dir.</diagnostic>
		<diagnostic id="bad-parent"
		>The element appeared inside a <value-of select="name(parent::*)"/>.</diagnostic>
	</diagnostics>
</schema>


--- NEW FILE: XSD2Schtrn.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
        based on an original transform by Eddie Robertsson
        2001/04/21      fn: added support for included schemas
        2001/06/27      er: changed XMl Schema prefix from xsd: to xs: and changed to the Rec namespace
-->
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <!-- Set the output to be XML with an XML declaration and use indentation -->
        <xsl:output method="xml" omit-xml-declaration="no" indent="yes" standalone="yes"/>
        <!-- -->
        <!-- match schema and call recursive template to extract included schemas -->
        <!-- -->
        <xsl:template match="xs:schema">
                <!-- call the schema definition template ... -->
                <xsl:call-template name="gatherSchema">
                        <!-- ... with current current root as the $schemas parameter ... -->
                        <xsl:with-param name="schemas" select="/"/>
                        <!-- ... and any includes in the $include parameter -->
                        <xsl:with-param name="includes" 
						select="document(/xs:schema/xs:*[self::xs:include or self::xs:import or self::xs:redefine]/@schemaLocation)"/>
                </xsl:call-template>
        </xsl:template>
        <!-- -->
        <!-- gather all included schemas into a single parameter variable -->
        <!-- -->
        <xsl:template name="gatherSchema">
                <xsl:param name="schemas"/>
                <xsl:param name="includes"/>
                <xsl:choose>
                        <xsl:when test="count($schemas) &lt; count($schemas | $includes)">
                                <!-- when $includes includes something new, recurse ... -->
                                <xsl:call-template name="gatherSchema">
                                        <!-- ... with current $includes added to the $schemas parameter ... -->
                                        <xsl:with-param name="schemas" select="$schemas | $includes"/>
                                        <!-- ... and any *new* includes in the $include parameter -->
                                        <xsl:with-param name="includes" 
										select="document($includes/xs:schema/xs:*[self::xs:include or self::xs:import or self::xs:redefine]/@schemaLocation)"/>
                                </xsl:call-template>
                        </xsl:when>
                        <xsl:otherwise>
                                <!-- we have the complete set of included schemas, 
								so now let's output the embedded schematron -->
                                <xsl:call-template name="output">
                                        <xsl:with-param name="schemas" select="$schemas"/>
                                </xsl:call-template>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
        <!-- -->
        <!-- output the schematron information -->
        <!-- -->
        <xsl:template name="output">
                <xsl:param name="schemas"/>
                <!-- -->
                <sch:schema>
                        <!-- get header-type elements - eg title and especially ns -->
                        <!-- title (just one) -->
                        <xsl:copy-of select="$schemas//xs:appinfo/sch:title[1]"/>
                        <!-- get remaining schematron schema children -->
                        <!-- get non-blank namespace elements, dropping duplicates -->
                        <xsl:for-each select="$schemas//xs:appinfo/sch:ns">
                                <xsl:if test="generate-id(.) = 
								generate-id($schemas//xs:appinfo/sch:ns[@prefix = current()/@prefix][1])">
                                        <xsl:copy-of select="."/>
                                </xsl:if>
                        </xsl:for-each>
                        <xsl:copy-of select="$schemas//xs:appinfo/sch:phase"/>
                        <xsl:copy-of select="$schemas//xs:appinfo/sch:pattern"/>
                        <sch:diagnostics>
                                <xsl:copy-of select="$schemas//xs:appinfo/sch:diagnostics/*"/>
                        </sch:diagnostics>
                </sch:schema>
        </xsl:template>
        <!-- -->
</xsl:transform>
--- NEW FILE: XSD2Schtrn.zip ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: schematron1-5.dtd ---
<!-- +//IDN sinica.edu.tw//DTD Schematron 1.5//EN -->
<!-- http://www.ascc.net/xml/schematron/schematron1-5.dtd -->
<!-- version of 2002/08/16 -->
<!-- This version has the 1.6 feature that sch:key element with @match 
     is allowed under sch:schema. This is not part of 1.5 proper.
-->
<!-- All names are given indirectly, to allow explicit use of a namespace prefix
       if desired.  In that case, in the internal subset of the doctype declaration,
       define <!ENTITY % sp "sch:" >
-->
<!ENTITY % sp "">
<!ENTITY % schema "%sp;schema">
<!ENTITY % active "%sp;active">
<!ENTITY % assert "%sp;assert">
<!ENTITY % dir "%sp;dir">
<!ENTITY % emph "%sp;emph">
<!ENTITY % extends "%sp;extends">
<!ENTITY % diagnostic "%sp;diagnostic">
<!ENTITY % diagnostics "%sp;diagnostics">
<!ENTITY % key "%sp;key">
<!ENTITY % name "%sp;name">
<!ENTITY % ns "%sp;ns">
<!ENTITY % p "%sp;p">
<!ENTITY % pattern "%sp;pattern">
<!ENTITY % phase "%sp;phase">
<!ENTITY % report "%sp;report">
<!ENTITY % rule "%sp;rule">
<!ENTITY % span "%sp;span">
<!ENTITY % title "%sp;title">
<!ENTITY % value-of "%sp;value-of">
<!-- Data types -->
<!ENTITY % URI "CDATA">
<!ENTITY % PATH "CDATA">
<!ENTITY % EXPR "CDATA">
<!ENTITY % FPI "CDATA">
<!-- Element declarations -->
<!ELEMENT %schema; ((%title;)?, (%ns;)*, (%p;)*, (%phase; | %key; )*, (%pattern;)+, (%p;)*, (%diagnostics;)?)>
<!ELEMENT %active; (#PCDATA | %dir; | %emph; | %span;)*>
<!ELEMENT %assert; (#PCDATA | %name; | %emph; | %dir; | %span;)*>
<!ELEMENT %dir; (#PCDATA)>
<!ELEMENT %emph; (#PCDATA)>
<!ELEMENT %extends; EMPTY>
<!ELEMENT %diagnostic; (#PCDATA | %value-of; | %emph; | %dir; | %span;)*>
<!ELEMENT %diagnostics; (%diagnostic;)*>
<!ELEMENT %key; EMPTY>
<!ELEMENT %name; EMPTY>
<!ELEMENT %ns; EMPTY>
<!ELEMENT %p; (#PCDATA | %dir; | %emph; | %span;)*>
<!ELEMENT %pattern; ((%p;)*, (%rule;)*)>
<!ELEMENT %phase; ((%p;)*, (%active;)*)>
<!ELEMENT %report; (#PCDATA | %name; | %emph; | %dir; | %span;)*>
<!ELEMENT %rule; (%assert; | %report; | %key; | %extends;)+>
<!ELEMENT %span; (#PCDATA)>
<!ELEMENT %title; (#PCDATA | %dir;)*>
<!ELEMENT %value-of; EMPTY>
<!-- Attribute declarations -->
<!ATTLIST %schema;
	xmlns %URI; #FIXED  "http://www.ascc.net/xml/schematron"
	xmlns:sch %URI; #FIXED "http://www.ascc.net/xml/schematron"
	xmlns:xsi %URI; #FIXED "http://www.w3.org/2000/10/XMLSchema-instance"
	xsi:schemaLocation %URI;  "http://www.ascc.net/xml/schematron
		http://www.ascc.net/xml/schematron/schematron.xsd"
	id ID #IMPLIED
	fpi %FPI; #IMPLIED
        ns %FPI; #IMPLIED
        schemaVersion CDATA #IMPLIED
	defaultPhase IDREF #IMPLIED
	icon %URI; #IMPLIED
	version CDATA "1.5"
	xml:lang NMTOKEN #IMPLIED
>
<!ATTLIST %active;
	pattern IDREF #REQUIRED
>
<!ATTLIST %assert;
	test %EXPR; #REQUIRED
	role NMTOKEN #IMPLIED
	id ID #IMPLIED
	diagnostics IDREFS #IMPLIED
	icon %URI; #IMPLIED
	subject %PATH; #IMPLIED
	xml:lang NMTOKEN #IMPLIED
>
<!ATTLIST %dir;
	value (ltr | rtl) #IMPLIED
>
<!ATTLIST %extends;
	rule IDREF #REQUIRED
>
<!ATTLIST %diagnostic;
	id ID #REQUIRED
	icon %URI; #IMPLIED
	xml:lang NMTOKEN #IMPLIED
>
<!ATTLIST %key;
        match CDATA #IMPLIED
	name NMTOKEN #REQUIRED
	path %PATH; #REQUIRED
	icon %URI; #IMPLIED
>
<!ATTLIST %name;
	path %PATH; "."
>
<!-- Schematrons should implement '.' 
               as the default value for path in sch:name -->
<!ATTLIST %p;
	xml:lang CDATA #IMPLIED
	id ID #IMPLIED
	class CDATA #IMPLIED
	icon %URI; #IMPLIED
>
<!ATTLIST %pattern;
	name CDATA #REQUIRED
	see %URI; #IMPLIED
	id ID #IMPLIED
	icon %URI; #IMPLIED
>
<!ATTLIST %ns;
	uri %URI; #REQUIRED
	prefix NMTOKEN #IMPLIED
>
<!ATTLIST %phase;
	id ID #REQUIRED
	fpi %FPI; #IMPLIED
	icon %URI; #IMPLIED
>
<!ATTLIST %span;
	class CDATA #IMPLIED
>
<!ATTLIST %report;
	test %EXPR; #REQUIRED
	role NMTOKEN #IMPLIED
	id ID #IMPLIED
	diagnostics IDREFS #IMPLIED
	icon %URI; #IMPLIED
	subject %PATH; #IMPLIED
	xml:lang CDATA #IMPLIED
>
<!ATTLIST %rule;
	context %PATH; #IMPLIED
	abstract (true | false) "false"
	role NMTOKEN #IMPLIED
	id ID #IMPLIED
>
<!-- Schematrons should implement 'false' as the default
                  value of abstract -->
<!ATTLIST %value-of;
	select %PATH; #REQUIRED
>


--- NEW FILE: schematron1-5.xsd ---
<?xml version="1.0" encoding="UTF-8"?>
<!-- schemaVersion of 2001/02/15 -->
<xs:schema targetNamespace="http://www.ascc.net/xml/schematron" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.ascc.net/xml/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="+//IDN sinica.edu.tw//SGML W3C XML Schema for Schematron 1.5//EN">
	<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
   	<xs:annotation>
			<xs:documentation>
       		Get access to the xml: attribute groups for xml:lang
     		</xs:documentation>
   	</xs:annotation>
 	</xs:import>
	<xs:annotation>
		<xs:documentation source="http://www.ascc.net/xml/resource/schematron/schematron.html" xml:lang="en"/>
	</xs:annotation>
	<xs:element name="active">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:dir"/>
				<xs:element ref="sch:emph"/>
				<xs:element ref="sch:span"/>
			</xs:choice>
			<xs:attribute name="pattern" type="xs:IDREF" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="assert">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:name"/>
				<xs:element ref="sch:emph"/>
				<xs:element ref="sch:dir"/>
				<xs:element ref="sch:span"/>
				<xs:any namespace="##other" processContents="lax"/>
			</xs:choice>
			<xs:attribute name="test" type="xs:string" use="required"/>
			<xs:attribute name="role" type="xs:NMTOKEN"/>
			<xs:attribute name="id" type="xs:string"/>
			<xs:attribute name="diagnostics" type="xs:IDREFS"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
			<xs:attribute name="subject" type="xs:string" default="."/>
			<xs:attribute ref="xml:lang"/>
			<xs:anyAttribute namespace="##other" processContents="lax"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="diagnostic">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:value-of"/>
				<xs:element ref="sch:emph"/>
				<xs:element ref="sch:dir"/>
				<xs:element ref="sch:span"/>
				<xs:any namespace="##other" processContents="lax"/>
			</xs:choice>
			<xs:attribute name="id" type="xs:ID" use="required"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
			<xs:attribute ref="xml:lang"/>
			<xs:anyAttribute namespace="##other" processContents="lax"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="diagnostics">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="diagnostic" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="dir">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="value">
						<xs:simpleType>
							<xs:restriction base="xs:NMTOKEN">
								<xs:enumeration value="ltr"/>
								<xs:enumeration value="rtl"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="emph" type="xs:string"/>
	<xs:element name="extends">
		<xs:complexType>
			<xs:attribute name="rule" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="key">
		<xs:complexType>
			<xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
			<xs:attribute name="path" type="xs:string" use="required"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="name">
		<xs:complexType>
			<xs:attribute name="path" type="xs:string" default="."/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ns">
		<xs:complexType>
			<xs:attribute name="uri" type="xs:anyURI" use="required"/>
			<xs:attribute name="prefix" type="xs:NCName"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="p">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:dir"/>
				<xs:element ref="sch:emph"/>
				<xs:element ref="sch:span"/>
			</xs:choice>
			<xs:attribute name="id" type="xs:string"/>
			<xs:attribute name="class" type="xs:string"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
			<xs:attribute ref="xml:lang"/>
			<xs:anyAttribute namespace="##other" processContents="lax"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="pattern">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="p" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:rule" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="name" type="xs:string" use="required"/>
			<xs:attribute name="see" type="xs:anyURI"/>
			<xs:attribute name="id" type="xs:string"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="phase">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="sch:p" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:active" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:string" use="required"/>
			<xs:attribute name="fpi" type="xs:string"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="report">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:name"/>
				<xs:element ref="sch:emph"/>
				<xs:element ref="sch:dir"/>
				<xs:element ref="sch:span"/>
				<xs:any namespace="##other" processContents="lax"/>
			</xs:choice>
			<xs:attribute name="test" type="xs:string" use="required"/>
			<xs:attribute name="role" type="xs:NMTOKEN"/>
			<xs:attribute name="id" type="xs:string"/>
			<xs:attribute name="diagnostics" type="xs:IDREFS"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
			<xs:attribute name="subject" type="xs:string" default="."/>
			<xs:attribute ref="xml:lang"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="rule">
		<xs:complexType>
			<xs:choice maxOccurs="unbounded">
				<xs:element ref="sch:assert"/>
				<xs:element ref="sch:report"/>
				<xs:element ref="sch:key"/>
				<xs:element ref="sch:extends"/>
			</xs:choice>
			<xs:attribute name="context" type="xs:string"/>
			<xs:attribute name="abstract" type="xs:boolean" default="false"/>
			<xs:attribute name="role" type="xs:NMTOKEN"/>
			<xs:attribute name="id" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="schema">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="sch:title" minOccurs="0"/>
				<xs:element ref="sch:ns" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:p" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:phase" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:pattern" maxOccurs="unbounded"/>
				<xs:element ref="sch:p" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="sch:diagnostics" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:ID"/>
			<xs:attribute name="fpi" type="xs:string"/>
			<xs:attribute name="schemaVersion" type="xs:string"/>
			<xs:attribute name="defaultPhase" type="xs:string"/>
			<xs:attribute name="icon" type="xs:anyURI"/>
			<xs:attribute name="ns" type="xs:anyURI"/>
			<xs:attribute name="version" type="xs:string" default="1.5"/>
			<xs:attribute ref="xml:lang"/>
			<xs:anyAttribute namespace="##other" processContents="lax"/>
		</xs:complexType>
		<xs:unique name="assertId">
			<xs:selector xpath="sch:pattern/sch:rule/sch:assert"/>
			<xs:field xpath="@id"/>
		</xs:unique>
		<xs:unique name="reportId">
			<xs:selector xpath="sch:pattern/sch:rule/sch:report"/>
			<xs:field xpath="@id"/>
		</xs:unique>
		<xs:unique name="ruleId">
			<xs:selector xpath="sch:pattern/sch:rule"/>
			<xs:field xpath="@id"/>
		</xs:unique>
		<xs:unique name="patternId">
			<xs:selector xpath="sch:pattern"/>
			<xs:field xpath="@id"/>
		</xs:unique>
		<xs:unique name="pId">
			<xs:selector xpath=".//sch:p"/>
			<xs:field xpath="@id"/>
		</xs:unique>
		<xs:key name="phaseId">
			<xs:selector xpath="sch:phase"/>
			<xs:field xpath="@id"/>
		</xs:key>
		<xs:keyref name="activePattern" refer="patternId">
			<xs:selector xpath="sch:phase/sch:active"/>
			<xs:field xpath="@pattern"/>
		</xs:keyref>
		<xs:keyref name="extendsRule" refer="ruleId">
			<xs:selector xpath="sch:pattern/sch:rule/sch:extends"/>
			<xs:field xpath="@rule"/>
		</xs:keyref>
		<xs:keyref name="defaultPhase" refer="phaseId">
			<xs:selector xpath="."/>
			<xs:field xpath="@defaultPhase"/>
		</xs:keyref>
		<!-- Define the identity constraints -->
	</xs:element>
	<xs:element name="span">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="class" type="xs:string"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="title">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="sch:dir"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
	<xs:element name="value-of">
		<xs:complexType>
			<xs:attribute name="select" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
Received on Friday, 17 November 2006 22:46:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:32:24 UTC