Home arrow XML arrow Schematron Patterns and Validation
XML

Schematron Patterns and Validation


In the last article, we grouped assertions into rules. As you know, each rule has its own context that it acts upon. So, grouping assertions into a rule provides a way to organize assertions that apply to the same elements. In this article, we'll start by explaining patterns, which takes organization to a new level.

Author Info:
By: Peyton McCullough
Rating: 4 stars4 stars4 stars4 stars4 stars / 7
January 14, 2009
TABLE OF CONTENTS:
  1. · Schematron Patterns and Validation
  2. · Abstract Patterns
  3. · Validation
  4. · Conclusion

print this article
SEARCH DEVARTICLES

Schematron Patterns and Validation
(Page 1 of 4 )

Patterns

Rules can also be related to one another. For example, although rules can have different contexts, some can perform the same types of operations on one another. Some rules may deal with the structure of a document, checking for the presence of certain elements and attributes. These rules would have different contexts, but they would be related.

Other rules may operate on different contexts in the same hierarchy. For example, one rule could operate on one element, and another rule could operate on a child of that element. Yet another rule could operate on the child of that element's child. These rules also have different contexts, but they are also very related.

Just as related assertions can be grouped into rules, related rules can be grouped into Schematron patterns. A pattern is simply a group of rules that place similar constraints on a document. The above example sets of rules could all be grouped into patterns.

Creating a basic pattern isn't very hard at all. The simplest way to create a pattern is simply to wrap a set of rules in a bare pattern tag:


<pattern>
  <rule context="context">
    
  </rule>
  <
rule context="context">
    
  </rule>
</
pattern>



blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials