FreeXmlToolkit

Schematron Support

Last Updated: November 2025 Version: 1.0.0

Schematron lets you create custom validation rules that go beyond what XSD schemas can check. It’s perfect for validating business rules and data relationships.


What is Schematron?

Schematron Overview Screenshot placeholder: Schematron validation interface

While XSD schemas check the structure of your XML (which elements can appear where), Schematron checks the content and relationships:

XSD Checks Schematron Checks
Element names Data values
Element order Field relationships
Required fields Business rules
Data types Conditional requirements

Example Rules


Key Features

1. Visual Rule Builder

Rule Builder Screenshot placeholder: Visual rule builder interface

Create validation rules without writing code:

2. Real-time Validation

Validation Results Screenshot placeholder: Validation results panel

3. Integration with XML Editor

Use Schematron validation directly in the XML Editor:

  1. Open an XML file
  2. Select a Schematron file in the sidebar
  3. Enable continuous validation
  4. Errors are highlighted automatically

How to Use Schematron

Creating Rules

Creating Rules Screenshot placeholder: Rule creation interface

  1. Open the Schematron tab
  2. Create a new Schematron file
  3. Define your rules using the visual builder
  4. Save the file

Validating Documents

  1. Open your XML file
  2. Load the Schematron rules file
  3. View validation results
  4. Fix any errors shown

Example Schematron Rule

Here’s what a simple Schematron rule looks like:

<schema xmlns="http://purl.oclc.org/dsdl/schematron">
    <pattern>
        <rule context="invoice">
            <assert test="@date">
                Every invoice must have a date
            </assert>
            <assert test="sum(item/price) = total">
                Total must equal sum of item prices
            </assert>
        </rule>
    </pattern>
</schema>

Supported Formats

Format Support
Pure Schematron (.sch) Full support
XSLT-based Schematron Full support

Tips


Previous Home Next
Auto-Completion Home Schema Support
All Pages: XML Editor XML Features XSD Tools XSD Validation XSLT FOP/PDF Signatures IntelliSense Schematron Favorites Templates Tech Stack Licenses