XML
  Home arrow XML arrow Schematron Patterns and Validation
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Schematron Patterns and Validation
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2009-01-14

    Table of Contents:
  • Schematron Patterns and Validation
  • Abstract Patterns
  • Validation
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Schematron Patterns and Validation


    (Page 1 of 4 )

    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.

    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>


    More XML Articles
    More By Peyton McCullough


     

    XML ARTICLES

    - 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
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek