Schema documentation for file isoSchematron.rng.

Top

Date Generated: 2007-02-07Z

Revision History

Rev. date Desc Author
1.0 2007-01-24T10:56:47.0Z Initial release Dave P
1.1 2007-01-30T11:51:47.0Z Cross reference errors corrected. Dave P

Element definitions in this Schema.

Attributes. Definitions in this Schema.

Data types. Definitions in this Schema.


ISO /IEC 19757-3:2006

Revision 1.0

(c) International Organization for Standardization 2005. Permission to copy in any form is granted for use with conforming SGML systems and applications as defined in ISO 8879, provided this notice is included in all copies.

identifier : http://www.dpawson.co.uk/schematron/isoSchematron.rng
creator : Dave Pawson
dateCreated : 2007-01-24T10:54:45.0Z
isPartOf : ISO/IEC 19757-3:2006
publisher : http://www.dpawson.co.uk
rights : © Dave Pawson, 2007
creator : Dave Pawson

Document element


Element schema

Document element, Root of a schematron file

{ schema

{optional}
Typed Data (ID)
Rich  
{optional}
SchemaVersion  
{optional}
DefaultPhase  
{optional}
QueryBinding   {interleave - in any order
Foreign   {zero Or More
Include  
} {group}
{optional}
Title   {zero Or More
Ns  
} {zero Or More
P  
} {zero Or More
Let  
} {zero Or More
Phase  
} {one Or More}
Pattern   {zero Or More
P  
}
{optional}
Diagnostics  
}
}


Attribute schemaVersion

An optional attribute, containing a non-empty string indicating the version of the Schematron schema in use

Non-empty-string  


Attribute defaultPhase

An optional attribute, containing an IDREF which links to a phase definition

Typed Data (IDREF)


Attribute queryBinding

An optional attribute, containing a non-empty string indicating the query language binding in use. Could be xslt1, xslt2 or python. Should match the implementation being used.

Non-empty-string  


Data type, a non empty string

Typed Data (token)


Element active

A child of the phase element, the active element specifyies which patterns are to be used in this phase of validation.

{ active
Typed Data (IDREF)
{interleave - in any order
Foreign   {zero Or More
{choice}
{text content.} dir  emph  span  
}
}
}


Element assert

An assertion made within the context (of the input document) specified by test attribute. If the test evaluates positive the assertion succeeds. If the assertion fails, the contained text is output.

{ assert
ExprValue  
{optional}
flagValue  
{optional}
Typed Data (ID)

{optional}
Typed Data (IDREFS)
Rich  Linkable   {interleave - in any order
Foreign   {zero Or More
{choice}
{text content.} Name  Value-of  emph  dir  span  
}
}
}


Element diagnostic

An individual diagnostic message referenced from an assert or report statements.

{ diagnostic
Typed Data (ID)
Rich   {interleave - in any order
Foreign   {zero Or More
{choice}
{text content.} Value-of  emph  dir  span  
}
}
}


Element diagnostics

A wrapper for individual diagnostic messages referenced from assert or report statements.

{ diagnostics
{interleave - in any order
Foreign   {zero Or More
Include  
} {zero Or More
Diagnostic  
}
}
}


Element dir

Text in which the writing direction is specified, either as ltr (left to right) or rtl(right to left)

{ dir

{optional}
{choice}
ltr rtl  {interleave - in any order
Foreign   {text content.}
}
}

{ emph
{text content.}
}


Element extends

An element which effectively imports into the current context all the assertions of the abstract rule referenced by the rule attribute, which matches the id value of an abstract rule. See rule

{ extends
Typed Data (IDREF)
Foreign-empty  
}


Element let

Declares a named variable. If within a rule, it is scoped to the current rule, otherwise it is scoped to the instance document root. The variable name is specified using the name attribute and the value calculated using the value attribute.

{ let
nameValue   Typed Data (string)

}


Element name

Provides indirect access to nodes in the input document. If the optional path attribute is used, then this node is retrieved. Without the path attribute, the name of the current context node is retrieved.

{ name

{optional}
PathValue  Foreign-empty  
}


Element ns

Use this to specify a namespace and the associated namespace prefix. e.g. <ns prefix='dp' uri='http://www.dpawson.co.uk/ns#'/>

{ ns
UriValue  nameValue  Foreign-empty  
}


Element p

A basic paragraph to help with documentation. Styling can be aided with the class attribute and the icon attribute. It may contain foreign elements.

{ p

{optional}
Typed Data (ID)

{optional}
ClassValue  
{optional}
UriValue   {interleave - in any order
Foreign   {zero Or More
{choice}
{text content.} dir  emph  span  
}
}
}


Element param

An element holding the name and value of a parameter passed to an abstract pattern.

{ param
nameValue  Non-empty-string  
}


Element pattern.

A wrapper element for rules. A pattern is said to be abstract when the abstract attribute has the value 'true'. An abstract rule may be applied within different contexts with parameters being used to set the values retrieved in the pattern by the $name construction. Patterns may be documented using the title and p children.

{ pattern
Rich   {interleave - in any order
Foreign   {zero Or More
Include  
} {choice}
{group} true  Typed Data (ID)

{optional}
Title   {group} {zero Or More
P  
} {zero Or More
Let  
} {zero Or More
Rule  
} {group}
{optional}
false 
{optional}
Typed Data (ID)

{optional}
Title   {group} {zero Or More
P  
} {zero Or More
Let  
} {zero Or More
Rule  
} {group}
{optional}
false  Typed Data (IDREF)

{optional}
Typed Data (ID)

{optional}
Title   {group} {zero Or More
P  
} {zero Or More
Param  
}
}
}


Element phase

A set of patterns which are run at the same time. Enables progressive validation of an instance. The patterns are identified by the child active children, and the group of patterns (the phase) is identified by the id attribute on the phase element.

{ phase
Typed Data (ID)
Rich   {interleave - in any order
Foreign   {zero Or More
Include  
} {group} {zero Or More
P  
} {zero Or More
Let  
} {zero Or More
Active  
}
}
}


Element report

If the test attribute evaluates positive, then the report is said to succeed. The output of a report statement is seen when the report succeeds. Additional diagnostic information may be generated by diagnostics element specified by the diagnostics attribute, an IDREF link. The mixed content of the element can include name, value-of, emphasis, dir and span elements.

{ report
ExprValue  
{optional}
flagValue  
{optional}
Typed Data (ID)

{optional}
Typed Data (IDREFS)
Rich  Linkable   {interleave - in any order
Foreign   {zero Or More
{choice}
{text content.} Name  Value-of  emph  dir  span  
}
}
}


Element rule

A wrapper for a list of assert and report statements. The context in which the assertions are made is defined by the context attribute.

A rule is either abstract (in which case the abstract attribute has a value of true and the element has an id value), or the rule has a context (i.e. the context attribute has a value). Abstract rules may be re-used by means of the extends element.

{ rule

{optional}
flagValue  Rich  Linkable   {interleave - in any order
Foreign   {zero Or More
Include  
} {choice}
{group} true  Typed Data (ID)
{zero Or More
Let  
} {one Or More}
{choice}
Assert  Report  Extends   {group} PathValue  
{optional}
Typed Data (ID)

{optional}
false  {zero Or More
Let  
} {one Or More}
{choice}
Assert  Report  Extends  
}
}


Element span

An inline markup for decoration in the report message. The differentiation is set by the class attribute, used as in HTML

{ span
ClassValue   {interleave - in any order
Foreign   {text content.}
}
}


Element title

A decorative element, allowing the association of a descriptive title to either an entire schema or pattern. Not required to be implemented.

{ title
{zero Or More
{choice}
{text content.} dir  
}
}


Element value-of

A way of retrieving values from the instance document. Context is the current rule context.

{ value-of
PathValue  Foreign-empty  
}


Element include

Include an external Schematron file (as specified by the href attribute) appropriate to the place within the schema at which the include is found.

{ include
UriValue  
}


Rich.

A set of optional attributes which may be used to decorate some elements


{optional}
UriValue  
{optional}
UriValue  
{optional}
FpiValue  
{optional}
LangValue  
{optional}
{choice}
preserve default 


linkable attribute

Optional attributes (role and subject). If the subject is present, the role attribute labels the arc between the context node and any nodes which match the subject value (an xpath expression).


{optional}
RoleValue  
{optional}
PathValue  


Datatype uriValue

A URI, used as the value of an attribute to specify, for example, an include, an icon file, or simply a namespace URI

Typed Data (anyURI)


Datatype pathValue

An xpath expression returning a node value or name (dependent on context)

Typed Data (string)


Datatype exprValue

An xpath expression returning a boolean value. See assert and report which both use the test attribute.

Typed Data (string)


Datatype fpiValue

A formal public identifier for containing element (schema, assert, report etc)

Typed Data (string)


Datatype langValue

The value assigned to an xml:lang attribute. Normally used to identify the language used in the containing element and its children.

Typed Data (language)


Datatype roleValue

The role attribute allows you to label the subject and subject nodes of assertions with simple labels. You could also see it as labelling the arcs between context subject and the arc subjects. For example, if generating RDF: see xml-dev archive

For example, imagine you had a document containing gene sequences. You could use the role attribute to label the junk DNA parts.

So the role could be what role the subject plays in the document, but is could be what role the subject plays in the pattern, or what role the rule plays in the pattern.

The role attribute is used, therefore, like a kind of type binding, but instead of binding the node to a type name, it is bound to (one or more) arbitrary names.

Typed Data (string)


Datatype flagValue

A string used as the name of a boolean flag

Typed Data (string)


Datatype nameValue

The string which is the name of a variable, namespace prefix or parameter

Typed Data (string)


Datatype classValue

A string used to hold the class of an element

Typed Data (string)


Element 'foreign'

An element not in the Schematron namespace

Foreign-attributes   {zero Or More
Foreign-element  
}


Element 'foreign-element'

Any element not in the Schematron namespace

{
anyName
Except {
Elements in namespace {}
} {zero Or More
{choice}
anyName
Foreign-element  Schema   {text content.}
}
}


An empty element with foreign attributes

An element not in the Schematron namespace which is empty and may contain attributes

Foreign-attributes  


Foreign attributes

attributes of elements in a namespace other than the Schematron namespace.

{zero Or More
anyName
Except {
Elements in namespace {}
Elements in namespace {http://www.w3.org/XML/1998/namespace}
}
}