SlideShare a Scribd company logo
Schematron
Step-By-Step Guide
tcworld, 2018
© 2018 Syncro Soft SRL. All rights reserved.
Octavian Nadolu, Syncro Soft
octavian_nadolu@oxygenxml.com
@OctavianNadolu
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
About the Author
● Software architect
● 15+ years XML technologies experience
● Contributor to a number of XML-related open source
projects
● Editor of Schematron QuickFix specification developed
by a W3C community group
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Overview
● Schematron history
● Schematron step-by-step
● Schematron in the development process
● Schematron for technical and non-technical users
● Schematron Quick Fixes
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
What is Schematron?
● A natural language for making assertions in documents
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron is an Open Standard
● Schematron is an Open Standard adopted by hundreds
of major projects in the past decade
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron History
● Schematron was invented by Rick Jelliffe
● Schematron 1.0 (1999), 1.3 (2000), 1.5 (2001)
● ISO Schematron (2006, 2010, 2016)
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Why Schematron?
● You can express constraints in a way that you cannot
perform with other schemas (like XSD, RNG, or DTD).
● XSD, RNG, and DTD schemas define structural aspects and data
types of the XML documents
● Schematron allows you to create custom rules specific to your
project
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Usage
● Verify data inter-dependencies
● Check data cardinality
● Perform algorithmic checks
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Used in Multiple Domains
● Financial
● Insurance
● Government
● Technical publishing
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron is Very Simple
● There are only 6 basic elements:
assert
report
rule
pattern
schema
ns
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Step-by-Step
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
XML
A list of books from a bookstore:
...
<book price="75">
<title>XSLT 2.0 Programmer's Reference</title>
<author>Michael Kay</author>
<isbn>0764569090</isbn>
</book>
...
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<assert>
An assert generates a message when a test statement
evaluates to false
<assert test="@price > 10">The book price is too small</assert>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<report>
A report generates a message when a test statement
evaluate to true.
<report test="@price > 1000">The book price is too big</report>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<rule>
A rule defines a context on which a list of assertions will
be tested, and is comprised of one or more assert or
report elements.
<rule context="book">
<assert test="@price > 10">The book price is too small</assert>
<report test="@price > 1000">The book price is too big</report>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<pattern>
A set of rules giving constraints that are in some way
related
<pattern>
<rule context="book">
<assert test="@price > 10">The book price is too small</assert>
<report test="@price > 1000">The book price is too big</report>
</rule>
</pattern>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<schema>
The top-level element of a Schematron schema.
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern>
<rule context="book">
<assert test="@price > 10">The book price is too small</assert>
<report test="@price > 1000">The book price is too big</report>
</rule>
</pattern>
</schema>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Apply Schematron
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern>
<rule context="book">
<assert test="@price > 10">The book price is too small</assert>
<report test="@price > 1000">The book price is too big</report>
</rule>
</pattern>
</schema>
...
<book price="7">
<title>XSLT 2.0 Programmer's Reference</title>
<author>Michael Kay</author>
<isbn>0764569090</isbn>
</book>
...
The price is too small
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<ns>
Defines a namespace prefix and URI
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<ns uri="http://book.example.com" prefix="b"/>
<pattern>
<rule context="b:book">
<assert test="@price > 10">The book price is too small</assert>
<report test="@price > 1000">The book price is too big</report>
</rule>
</pattern>
</schema>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Uses XPath
● XPath it is very important in Schematron:
● Rule context is expressed using an XPath expression
<rule context="book">
● Assertions are expressed using XPath expressions that are
evaluated as true or false
<assert test="@price > 10">
● @queryBinding – determines the XPath version
<schema queryBinding="xslt2">
● Possible values: xslt, xslt2, xslt3
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
What is XPath?
● A language for addressing parts of an XML document
(XML Path Language)
● A W3C Recommendation in 1999
www.w3.org/TR/xpath
● XPath versions 1.0, 2.0, 3.0, 3.1 (2017)
● Tutorials:
● www.data2type.de/en/xml-xslt-xslfo/xpath/
● www.xfront.com/xpath/
● www.zvon.org/comp/m/xpath.html
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Conclusion
● Schematron is simple (6 basic elements)
● Used in multiple domains
● Schematron uses XPath
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Examples of Schematron Rules
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Check Number of List Items
● Example of a rule that checks the number of list items
in a list
A list must have more than one item
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Check Number of List Items
● The number of list items from an unordered list should
be greater than one
<sch:rule context="ul">
<sch:assert test="count(li) > 1">
A list must have more than one item</sch:assert>
</sch:rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Styling in Titles
● Example rule that checks for styling in titles
Bold is not allowed in title element
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Styling in Titles
● The b element should not be used in a title
<sch:rule context="title">
<sch:report test="b">
Bold is not allowed in <sch:name/> element</sch:report>
</sch:rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Semicolon at End of List Items
● Example of rule that checks if a semicolon is at the
end of a list item
Semicolon is not allowed at the end of a list item
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Semicolon at End of List Items
● The last text from a list item should not end with
semicolon
<sch:rule context="li">
<sch:report test="ends-with(text()[last()], ';')">
Semicolon is not allowed after list item</sch:report>
</sch:rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Check External Link Protocol
● Example of rule that check the external link protocol
The external link should start with http(s)
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Check External Link Protocol
● The @href attribute value it is an external link and
should start with http or https.
<rule context="xref">
<sch:assert test="matches(@href, '^http(s?)://')">
An link should start with http(s).</sch:assert>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Missing Tables Cells
● Missing cells in a table
Cells are missing from table
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Missing Tables Cells
● Check that are the same number of cells on each row
<sch:rule context="table">
<sch:let name="minColumsNo" value="min(//row/count(entry))"/>
<sch:let name="reqColumsNo" value="max(//row/count(entry))"/>
<sch:assert test="$minColumsNo >= $reqColumsNo">
Cells are missing. (The number of cells for each row must be
<sch:value-of select="$reqColumsNo"/>)
</sch:assert>
</sch:rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Link in Text Content
● Links are added directly in text content
Link detected in the current element
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Link in Text Content
● Check if a link is added in text content but is not
tagged as a link
<sch:rule context="text()">
<sch:report test="matches(., '(http|www)S+')
and local-name(parent::node()) != 'xref'">
The link should be a xref element</sch:report>
</sch:rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Conclusion
● Simple to complex Schematron rules
● Additional Schematron elements used:
● <let> - A declaration of a named variable
● <value-of> - Finds or calculates values from the instance
document
● <name> - Provides the names of nodes from the instance
document
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Integrating Schematron in the
Development Process
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Validate XML with Schematron
● Associate Schematron in the XML file
● Use tool-specific association options
● Associate Schematron file with a set of XML files (all files with a
specific namespace, or from a directory)
● Associate Schematron with all XML files from a project
<?xml-model href="books.sch" type="application/xml"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Embed Schematron in XSD or
RNG
● Schematron can be added in the XSD appinfo element
● Add Schematron checks in any element on any level of
an RNG schema
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Run Schematron Validation
● From an XML editing framework
● Check the XML files as you type
● Run the Schematron validation on multiple files
● Using W3C's XProc pipeline language through its
"validate-with-schematron" step
● Using Apache Ant, from bat/shell
https://github.com/Schematron/ant-schematron
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Validation Result
● Messages presented in the editing framework
● As an XML file describing the validation errors, normally
in Schematron Validation Reporting Language (SVRL)
<svrl:failed-assert test="matches(@href, '^http(s?)://')" role="warn"
location="/topic[1]/body[1]/section[1]/p[3]/xref[1]">
<svrl:text>An external link should start with http(s).</svrl:text>
</svrl:failed-assert>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Messages Severity
● Severity level can be set in the value of the @role attribute
from an assert or report element (fatal, error, warn, or info)
● Depending on the severity, the message can be rendered
differently in an editing framework
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Multilingual Support in
Schematron
● Based on the Schematron diagnostic element
● A diagnostic element is used for each language
● Multilingual support defined in the Schematron
specification
<sch:assert test="bone" diagnostics="d_en d_de">
A dog should have a bone.
</sch:assert>
….
<sch:diagnostics xml:lang="en">
<sch:diagnostic id="d_en">A dog should have a bone.<sch:diagnostic>
</sch:diagnostics>
<sch:diagnostics xml:lang="de">
<sch:diagnostic id="d_de">Das Hund muss ein Bein haben.</sch:diagnostic>
</sch:diagnostics>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Conclusion
● Multiple ways to associate and apply the validation
● Validation results as you type or in a report
● Messages with different severity
● Multilingual support
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron for Non-Technical and
Technical Users
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron for Non-Technical
Users
● Schematron is used in multiple domains
● There are more and more non-technical users that
want to develop their own rules
● Providing a user interface to create the Schematron
rules will be more appropriate for them
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Library of Rules
● A solution can be to provide a library of rules
● The user can choose the rule that he wants to add
Avoid a word in a certain element
Limit the number of words
Avoid duplicate content
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Abstract Patterns
● Library of rules implemented using abstract patterns
AvoidWordInElement
LimitNoOfWords
AvoidDuplicateContent
select
Schemtron rules
generate
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Abstract Pattern
● Allows to reuse patterns by making them generic
<pattern id="LimitNoOfWords" abstract="true">
<rule context="$parentElement">
<let name="words" value="count(tokenize(normalize-space(.), ' '))"/>
<assert test="$words le $maxWords">
$message You have <value-of select="$words"/> word(s).
</assert>
<assert test="$words ge $minWords">
$message You have <value-of select="$words"/> word(s).
</assert>
</rule>
</pattern>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Pattern Instantiation
● Refer an abstract pattern and specifies values for
parameters
<pattern is-a="LimitNoOfWords">
<param name="parentElement" value="shortdesc"/>
<param name="minWords" value="1"/>
<param name="maxWords" value="50"/>
<param name="message" value="Keep short descriptions between 1 and 50 words!"/>
</pattern>
<pattern is-a="LimitNoOfWords">
<param name="parentElement" value="title"/>
<param name="minWords" value="1"/>
<param name="maxWords" value="8"/>
<param name="message" value="Keep titles between 1 and 8 words."/>
</pattern>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Create Business Rules Using DIM
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Dynamic Information Model (DIM)
● An implementation of an intelligent style guide
● Describes and enforces rules
● Open-source project available on GitHub
https://github.com/oxygenxml/dim
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron for Technical
Users
Environment to develop Schematron schemas
● Editor
● Validation
● Search and refactoring
● Working with modules
● Unit testing
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Editor
● Syntax highlighting - to improve the readability of the
content
● Content completion assistant - offering proposals that
are valid at the cursor position
● Documentation - with information about the particular
proposal
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Validate
● Validate Schematron schemas, and highlight problems
directly in the editor
● Validate Schematron modules in context
● Support for validation as you type
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Search and Refactoring
● Find references to variables, pattern, phases, or
diagnostics
● Support for renaming all references from the current
document, or in the entire hierarchy
● Preview the changes
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Working with Modules
● Visualize the hierarchy of modules
● Support for editing a Schematron module in the context
● Moving and renaming modules
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Test Schematron Rules
● Developing Schematron schema also involves testing
● Make sure Schematron rules work as expected
● Apply multiple XML examples over the Schematron
rules and check the results
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
XSpec
●
Solution to create Schematron unit tests
●
Unit test and BDD (Behaviour Driven Development )
framework
– https://github.com/xspec/xspec/
●
Oxygen XSpec Helper View plugin
– github.com/xspec/oXygen-XML-editor-xspec-support
●
Tutorials
●
github.com/xspec/xspec/wiki/Getting-Started-with-XSpec-and-Schematron
●
oxygenxml.com/events/2018/webinar_xspec_unit_testing_for_xslt_and_schematron.html
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Conclusion
● Library of rules using abstract patterns
● User interface for non-technical users
● Editing, validation, and refactoring support for
technical users
● Test cases for Schematron
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Quick Fixes
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Fix Proposals
● Schematron assertion messages are not always
enough for the user to find a solution
● It is better to have some proposals to correct the
Schematron reported problem
● Similar to spell check proposals
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Quick Fix
Proposals
● User-defined fixes for Schematron errors
● Schematron Quick Fix (SQF) language
● Extension of the Schematron language
● SQF initiated by Nico Kutscherauer
www.schematron-quickfix.com
github.com/schematron-quickfix/sqf
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Quick Fixes Spec
www.w3.org/community/quickfix
schematron-quickfix.github.io/sqf
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
SQF Extension of Schematron
● Added as Schematron annotations
● Associate fixes with assert and report elements
<rule context="title">
<report test="b" sqf:fix="resolveBold">
Bold is not allowed in title element</report>
<sqf:fix id="resolveBold">
<sqf:description>
<sqf:title>Change the bold element into text</sqf:title>
<sqf:p>Removes the bold (b) markup and keeps the text content.</sqf:p>
</sqf:description>
<sqf:replace match="b" select="node()"/>
</sqf:fix>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Schematron Quick Fix (SQF)
<sqf:fix id="resolveBold">
<sqf:description>
<sqf:title>Change the bold element into text</sqf:title>
<sqf:p>Removes the bold (b) markup and keeps the text content.</sqf:p>
</sqf:description>
<sqf:replace match="b" select="node()"/>
</sqf:fix>
Operation
ID
Description
Title
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
SQF Operations
The following 4 types of operations are supported:
– <sqf:add> - To add a new node or fragment in the document
– <sqf:delete> - To remove a node from the document
– <sqf:replace> - To replace a node with another node or fragment
– <sqf:stringReplace> - To replace text content with other text or a
fragment
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Introduction to SQF Through
Examples
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
1. SQF “add” Operation
● Example of using the “add” operation: add new list
item in a list
List contains only one item
Add new list item
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
1. SQF “add” Operation
● <sqf:add> element allows you to add one or more
nodes to the XML instance
<rule context="ul">
<assert test="count(li) > 1" sqf:fix="addListItem">A list must have more
than one item.</assert>
<sqf:fix id="addListItem">
<sqf:description>
<sqf:title>Add new list item</sqf:title>
</sqf:description>
<sqf:add node-type="element" target="li" position="last-child"/>
</sqf:fix>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
2. SQF “delete” Operation
● Example of using the “delete” operation: remove
redundant link text
Remove redundant link text
Text in the link and the value of the @href are the same
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
2. SQF “delete” Operation
● <sqf:delete> element specifies the nodes for the
deletion
<rule context="xref">
<report test="@href = text()" sqf:fix="removeText">
Link text is same as @href attribute value. Please remove.</report>
<sqf:fix id="removeText">
<sqf:description>
<sqf:title>Remove redundant link text</sqf:title>
</sqf:description>
<sqf:delete match="text()"/>
</sqf:fix>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
3. SQF “replace” Operation
● Example of using the “replace” operation: replace bold
element with text
Change the bold into text
Styling is not allowed in titles
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
3. SQF “replace” Operation
● <sqf:replace> element specifies the nodes to be
replaced and the replacing content
<rule context="title">
<report test="b" sqf:fix="resolveBold">
Bold is not allowed in title element.</report>
<sqf:fix id="resolveBold">
<sqf:description>
<sqf:title>Change the bold into text</sqf:title>
</sqf:description>
<sqf:replace match="b" select="node()"/>
</sqf:fix>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
4. SQF “stringReplace” Operation
● Example of using the “stringReplace” operation:
replace semicolon with full stop
Replace semicolon with full stop
Semicolon is not allowed at the end of a list item
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
4. SQF “stringReplace” Operation
● <sqf:stringReplace> element defines the nodes that
will replace the substrings
<rule context="li">
<report test="ends-with(text()[last()], ';')" sqf:fix="replaceSemicolon">
Semicolon is not allowed after list item</report>
<sqf:fix id="replaceSemicolon">
<sqf:description>
<sqf:title>Replace semicolon with full stop</sqf:title>
</sqf:description>
<sqf:stringReplace match="text()[last()]" regex=";$" select="'.'"/>
</sqf:fix>
</rule>
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Conclusions
● Schematron Quick Fix language is simple
● You can define custom fixes for your project
● Just 4 types of operations
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
SQF Implementations
● <oXygen/> XML Editor validation engine
http://www.oxygenxml.com
● Escali Schematron engine
http://schematron-quickfix.com/escali_xsm.html
● Escali Schematron command-line tool
● Oxygen plugin for invoking Escali Schematron
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Projects Using SQF
● Thieme - publishing company uses a custom framework
to create and edit XML documents
● parsX - a product developed by pagina GmbH used to
facilitate EPUB production
● ART-DECOR - an open-source tool suite that supports
SDOs active in the healthcare industry
Sample SQF embedded in XSD
● ATX custom framework – used by a major automotive
manufacturer
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
Resources
● Schematron official site
● Schematron specification
● Schematron Quick Fix specification
● Sample files:
github.com/octavianN/Schematron-step-by-step
Schematron step-by-stepSchematron step-by-step
Copyright @ Syncro Soft, 2018. All rights reserved.
<oXygen/> XML Editor
http://www.oxygenxml.com
octavian_nadolu@oxygenxml.com
@OctavianNadolu
THANK YOU!
Any questions?
Your opinion is important to us! Please tell us what you thought of the lecture. We
look forward to your feedback under
http://ta14.honestly.de
or scan the QR code
The feedback tool will be available even after the conference!

More Related Content

What's hot

Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
Rodrigo Prates
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
Tomasz Bak
 
Joget Workflow v6 Training Slides - 21 - Userview Key
Joget Workflow v6 Training Slides - 21 - Userview KeyJoget Workflow v6 Training Slides - 21 - Userview Key
Joget Workflow v6 Training Slides - 21 - Userview Key
Joget Workflow
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and Django
Chariza Pladin
 
SAP S/4HANA Migration Cockpit
SAP S/4HANA Migration CockpitSAP S/4HANA Migration Cockpit
SAP S/4HANA Migration Cockpit
Edwin Weijers
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
Vibhor Grover
 
Introduction to SAP Business One HANA
Introduction to SAP Business One HANAIntroduction to SAP Business One HANA
Introduction to SAP Business One HANA
Octopoda Consulting GmbH
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
juzten
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
Learnbay Datascience
 
Prototype_pattern
Prototype_patternPrototype_pattern
Prototype_pattern
Iryney Baran
 
Spring boot Under Da Hood
Spring boot Under Da HoodSpring boot Under Da Hood
Spring boot Under Da Hood
Michel Schudel
 
Sap hana tutorial
Sap hana tutorialSap hana tutorial
Sap hana tutorial
Sridhar Kasthuri
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
Sap Analytics Cloud
Sap Analytics CloudSap Analytics Cloud
Sap Analytics Cloud
Srinath Reddy
 
Django
DjangoDjango
Django
Kangjin Jun
 
PART 1 - Python Tutorial | Variables and Data Types in Python
PART 1 - Python Tutorial | Variables and Data Types in PythonPART 1 - Python Tutorial | Variables and Data Types in Python
PART 1 - Python Tutorial | Variables and Data Types in Python
Shivam Mitra
 
Javascript Prototype Visualized
Javascript Prototype VisualizedJavascript Prototype Visualized
Javascript Prototype Visualized
军 沈
 
L18 Object Relational Mapping
L18 Object Relational MappingL18 Object Relational Mapping
L18 Object Relational Mapping
Ólafur Andri Ragnarsson
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 

What's hot (20)

Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
Joget Workflow v6 Training Slides - 21 - Userview Key
Joget Workflow v6 Training Slides - 21 - Userview KeyJoget Workflow v6 Training Slides - 21 - Userview Key
Joget Workflow v6 Training Slides - 21 - Userview Key
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and Django
 
SAP S/4HANA Migration Cockpit
SAP S/4HANA Migration CockpitSAP S/4HANA Migration Cockpit
SAP S/4HANA Migration Cockpit
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Introduction to SAP Business One HANA
Introduction to SAP Business One HANAIntroduction to SAP Business One HANA
Introduction to SAP Business One HANA
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Prototype_pattern
Prototype_patternPrototype_pattern
Prototype_pattern
 
Spring boot Under Da Hood
Spring boot Under Da HoodSpring boot Under Da Hood
Spring boot Under Da Hood
 
Sap hana tutorial
Sap hana tutorialSap hana tutorial
Sap hana tutorial
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
 
Sap Analytics Cloud
Sap Analytics CloudSap Analytics Cloud
Sap Analytics Cloud
 
Django
DjangoDjango
Django
 
PART 1 - Python Tutorial | Variables and Data Types in Python
PART 1 - Python Tutorial | Variables and Data Types in PythonPART 1 - Python Tutorial | Variables and Data Types in Python
PART 1 - Python Tutorial | Variables and Data Types in Python
 
Javascript Prototype Visualized
Javascript Prototype VisualizedJavascript Prototype Visualized
Javascript Prototype Visualized
 
L18 Object Relational Mapping
L18 Object Relational MappingL18 Object Relational Mapping
L18 Object Relational Mapping
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 

Similar to Schematron step-by-step

XML Quick Fixes
XML Quick FixesXML Quick Fixes
XML Quick Fixes
Octavian Nadolu
 
Documentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO SchematronDocumentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO Schematron
Octavian Nadolu
 
The Dynamic Information Model
The Dynamic Information ModelThe Dynamic Information Model
The Dynamic Information Model
georgebina
 
Introduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on RailsIntroduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on Rails
pmatsinopoulos
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
CardinaleWay Mazda
 
Welcome Webinar Slides
Welcome Webinar SlidesWelcome Webinar Slides
Welcome Webinar Slides
Sumo Logic
 
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Amazon Web Services
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
Amazon Web Services
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-HibernateJay Shah
 
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
Amazon Web Services
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and Tips
Connor McDonald
 
Ajax
AjaxAjax
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
TigerGraph
 

Similar to Schematron step-by-step (20)

XML Quick Fixes
XML Quick FixesXML Quick Fixes
XML Quick Fixes
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Documentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO SchematronDocumentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO Schematron
 
The Dynamic Information Model
The Dynamic Information ModelThe Dynamic Information Model
The Dynamic Information Model
 
Introduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on RailsIntroduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on Rails
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
Welcome Webinar Slides
Welcome Webinar SlidesWelcome Webinar Slides
Welcome Webinar Slides
 
Ajax
AjaxAjax
Ajax
 
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-Hibernate
 
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
Best Practices for Scalable Monitoring (ENT310-S) - AWS re:Invent 2018
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and Tips
 
Ajax
AjaxAjax
Ajax
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
 

More from Octavian Nadolu

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
YAML Editing and Validation In Oxygen
YAML Editing and Validation In OxygenYAML Editing and Validation In Oxygen
YAML Editing and Validation In Oxygen
Octavian Nadolu
 
Oxygen JSON Editor
Oxygen JSON EditorOxygen JSON Editor
Oxygen JSON Editor
Octavian Nadolu
 
Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...
Octavian Nadolu
 
OpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in OxygenOpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in Oxygen
Octavian Nadolu
 
Validating XML and JSON Documents Using Oxygen Scripting
 Validating XML and JSON Documents Using Oxygen Scripting Validating XML and JSON Documents Using Oxygen Scripting
Validating XML and JSON Documents Using Oxygen Scripting
Octavian Nadolu
 
OpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and DocumentingOpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and Documenting
Octavian Nadolu
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPI
Octavian Nadolu
 
Create an Design JSON Schema
Create an Design JSON SchemaCreate an Design JSON Schema
Create an Design JSON Schema
Octavian Nadolu
 
Compare And Merge Scripts
Compare And Merge ScriptsCompare And Merge Scripts
Compare And Merge Scripts
Octavian Nadolu
 
JSON Schema Design
JSON Schema DesignJSON Schema Design
JSON Schema Design
Octavian Nadolu
 
Schematron For Non-XML Languages
Schematron For Non-XML LanguagesSchematron For Non-XML Languages
Schematron For Non-XML Languages
Octavian Nadolu
 
JSON and JSON Schema in Oxygen
JSON and JSON Schema in OxygenJSON and JSON Schema in Oxygen
JSON and JSON Schema in Oxygen
Octavian Nadolu
 
HTML5 Editing Validation
HTML5 Editing ValidationHTML5 Editing Validation
HTML5 Editing Validation
Octavian Nadolu
 
Hands on JSON
Hands on JSONHands on JSON
Hands on JSON
Octavian Nadolu
 
JSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and ConvertJSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and Convert
Octavian Nadolu
 
The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019
Octavian Nadolu
 
Collaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation ProcessCollaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation Process
Octavian Nadolu
 
Exploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - DevelopmentExploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - Development
Octavian Nadolu
 

More from Octavian Nadolu (20)

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
YAML Editing and Validation In Oxygen
YAML Editing and Validation In OxygenYAML Editing and Validation In Oxygen
YAML Editing and Validation In Oxygen
 
Oxygen JSON Editor
Oxygen JSON EditorOxygen JSON Editor
Oxygen JSON Editor
 
Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...
 
OpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in OxygenOpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in Oxygen
 
Validating XML and JSON Documents Using Oxygen Scripting
 Validating XML and JSON Documents Using Oxygen Scripting Validating XML and JSON Documents Using Oxygen Scripting
Validating XML and JSON Documents Using Oxygen Scripting
 
OpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and DocumentingOpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and Documenting
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPI
 
Create an Design JSON Schema
Create an Design JSON SchemaCreate an Design JSON Schema
Create an Design JSON Schema
 
Compare And Merge Scripts
Compare And Merge ScriptsCompare And Merge Scripts
Compare And Merge Scripts
 
JSON Schema Design
JSON Schema DesignJSON Schema Design
JSON Schema Design
 
Schematron For Non-XML Languages
Schematron For Non-XML LanguagesSchematron For Non-XML Languages
Schematron For Non-XML Languages
 
JSON and JSON Schema in Oxygen
JSON and JSON Schema in OxygenJSON and JSON Schema in Oxygen
JSON and JSON Schema in Oxygen
 
HTML5 Editing Validation
HTML5 Editing ValidationHTML5 Editing Validation
HTML5 Editing Validation
 
Hands on JSON
Hands on JSONHands on JSON
Hands on JSON
 
JSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and ConvertJSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and Convert
 
The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019
 
Collaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation ProcessCollaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation Process
 
Exploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - DevelopmentExploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - Development
 

Recently uploaded

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 

Recently uploaded (20)

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 

Schematron step-by-step

  • 1. Schematron Step-By-Step Guide tcworld, 2018 © 2018 Syncro Soft SRL. All rights reserved. Octavian Nadolu, Syncro Soft octavian_nadolu@oxygenxml.com @OctavianNadolu
  • 2. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. About the Author ● Software architect ● 15+ years XML technologies experience ● Contributor to a number of XML-related open source projects ● Editor of Schematron QuickFix specification developed by a W3C community group
  • 3. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Overview ● Schematron history ● Schematron step-by-step ● Schematron in the development process ● Schematron for technical and non-technical users ● Schematron Quick Fixes
  • 4. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. What is Schematron? ● A natural language for making assertions in documents
  • 5. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron is an Open Standard ● Schematron is an Open Standard adopted by hundreds of major projects in the past decade
  • 6. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron History ● Schematron was invented by Rick Jelliffe ● Schematron 1.0 (1999), 1.3 (2000), 1.5 (2001) ● ISO Schematron (2006, 2010, 2016)
  • 7. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Why Schematron? ● You can express constraints in a way that you cannot perform with other schemas (like XSD, RNG, or DTD). ● XSD, RNG, and DTD schemas define structural aspects and data types of the XML documents ● Schematron allows you to create custom rules specific to your project
  • 8. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Usage ● Verify data inter-dependencies ● Check data cardinality ● Perform algorithmic checks
  • 9. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Used in Multiple Domains ● Financial ● Insurance ● Government ● Technical publishing
  • 10. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron is Very Simple ● There are only 6 basic elements: assert report rule pattern schema ns
  • 11. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Step-by-Step
  • 12. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. XML A list of books from a bookstore: ... <book price="75"> <title>XSLT 2.0 Programmer's Reference</title> <author>Michael Kay</author> <isbn>0764569090</isbn> </book> ...
  • 13. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <assert> An assert generates a message when a test statement evaluates to false <assert test="@price > 10">The book price is too small</assert>
  • 14. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <report> A report generates a message when a test statement evaluate to true. <report test="@price > 1000">The book price is too big</report>
  • 15. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <rule> A rule defines a context on which a list of assertions will be tested, and is comprised of one or more assert or report elements. <rule context="book"> <assert test="@price > 10">The book price is too small</assert> <report test="@price > 1000">The book price is too big</report> </rule>
  • 16. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <pattern> A set of rules giving constraints that are in some way related <pattern> <rule context="book"> <assert test="@price > 10">The book price is too small</assert> <report test="@price > 1000">The book price is too big</report> </rule> </pattern>
  • 17. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <schema> The top-level element of a Schematron schema. <schema xmlns="http://purl.oclc.org/dsdl/schematron"> <pattern> <rule context="book"> <assert test="@price > 10">The book price is too small</assert> <report test="@price > 1000">The book price is too big</report> </rule> </pattern> </schema>
  • 18. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Apply Schematron <schema xmlns="http://purl.oclc.org/dsdl/schematron"> <pattern> <rule context="book"> <assert test="@price > 10">The book price is too small</assert> <report test="@price > 1000">The book price is too big</report> </rule> </pattern> </schema> ... <book price="7"> <title>XSLT 2.0 Programmer's Reference</title> <author>Michael Kay</author> <isbn>0764569090</isbn> </book> ... The price is too small
  • 19. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <ns> Defines a namespace prefix and URI <schema xmlns="http://purl.oclc.org/dsdl/schematron"> <ns uri="http://book.example.com" prefix="b"/> <pattern> <rule context="b:book"> <assert test="@price > 10">The book price is too small</assert> <report test="@price > 1000">The book price is too big</report> </rule> </pattern> </schema>
  • 20. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Uses XPath ● XPath it is very important in Schematron: ● Rule context is expressed using an XPath expression <rule context="book"> ● Assertions are expressed using XPath expressions that are evaluated as true or false <assert test="@price > 10"> ● @queryBinding – determines the XPath version <schema queryBinding="xslt2"> ● Possible values: xslt, xslt2, xslt3
  • 21. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. What is XPath? ● A language for addressing parts of an XML document (XML Path Language) ● A W3C Recommendation in 1999 www.w3.org/TR/xpath ● XPath versions 1.0, 2.0, 3.0, 3.1 (2017) ● Tutorials: ● www.data2type.de/en/xml-xslt-xslfo/xpath/ ● www.xfront.com/xpath/ ● www.zvon.org/comp/m/xpath.html
  • 22. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Conclusion ● Schematron is simple (6 basic elements) ● Used in multiple domains ● Schematron uses XPath
  • 23. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Examples of Schematron Rules
  • 24. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Check Number of List Items ● Example of a rule that checks the number of list items in a list A list must have more than one item
  • 25. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Check Number of List Items ● The number of list items from an unordered list should be greater than one <sch:rule context="ul"> <sch:assert test="count(li) > 1"> A list must have more than one item</sch:assert> </sch:rule>
  • 26. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Styling in Titles ● Example rule that checks for styling in titles Bold is not allowed in title element
  • 27. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Styling in Titles ● The b element should not be used in a title <sch:rule context="title"> <sch:report test="b"> Bold is not allowed in <sch:name/> element</sch:report> </sch:rule>
  • 28. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Semicolon at End of List Items ● Example of rule that checks if a semicolon is at the end of a list item Semicolon is not allowed at the end of a list item
  • 29. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Semicolon at End of List Items ● The last text from a list item should not end with semicolon <sch:rule context="li"> <sch:report test="ends-with(text()[last()], ';')"> Semicolon is not allowed after list item</sch:report> </sch:rule>
  • 30. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Check External Link Protocol ● Example of rule that check the external link protocol The external link should start with http(s)
  • 31. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Check External Link Protocol ● The @href attribute value it is an external link and should start with http or https. <rule context="xref"> <sch:assert test="matches(@href, '^http(s?)://')"> An link should start with http(s).</sch:assert> </rule>
  • 32. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Missing Tables Cells ● Missing cells in a table Cells are missing from table
  • 33. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Missing Tables Cells ● Check that are the same number of cells on each row <sch:rule context="table"> <sch:let name="minColumsNo" value="min(//row/count(entry))"/> <sch:let name="reqColumsNo" value="max(//row/count(entry))"/> <sch:assert test="$minColumsNo >= $reqColumsNo"> Cells are missing. (The number of cells for each row must be <sch:value-of select="$reqColumsNo"/>) </sch:assert> </sch:rule>
  • 34. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Link in Text Content ● Links are added directly in text content Link detected in the current element
  • 35. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Link in Text Content ● Check if a link is added in text content but is not tagged as a link <sch:rule context="text()"> <sch:report test="matches(., '(http|www)S+') and local-name(parent::node()) != 'xref'"> The link should be a xref element</sch:report> </sch:rule>
  • 36. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Conclusion ● Simple to complex Schematron rules ● Additional Schematron elements used: ● <let> - A declaration of a named variable ● <value-of> - Finds or calculates values from the instance document ● <name> - Provides the names of nodes from the instance document
  • 37. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Integrating Schematron in the Development Process
  • 38. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Validate XML with Schematron ● Associate Schematron in the XML file ● Use tool-specific association options ● Associate Schematron file with a set of XML files (all files with a specific namespace, or from a directory) ● Associate Schematron with all XML files from a project <?xml-model href="books.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
  • 39. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Embed Schematron in XSD or RNG ● Schematron can be added in the XSD appinfo element ● Add Schematron checks in any element on any level of an RNG schema
  • 40. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Run Schematron Validation ● From an XML editing framework ● Check the XML files as you type ● Run the Schematron validation on multiple files ● Using W3C's XProc pipeline language through its "validate-with-schematron" step ● Using Apache Ant, from bat/shell https://github.com/Schematron/ant-schematron
  • 41. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Validation Result ● Messages presented in the editing framework ● As an XML file describing the validation errors, normally in Schematron Validation Reporting Language (SVRL) <svrl:failed-assert test="matches(@href, '^http(s?)://')" role="warn" location="/topic[1]/body[1]/section[1]/p[3]/xref[1]"> <svrl:text>An external link should start with http(s).</svrl:text> </svrl:failed-assert>
  • 42. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Messages Severity ● Severity level can be set in the value of the @role attribute from an assert or report element (fatal, error, warn, or info) ● Depending on the severity, the message can be rendered differently in an editing framework
  • 43. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Multilingual Support in Schematron ● Based on the Schematron diagnostic element ● A diagnostic element is used for each language ● Multilingual support defined in the Schematron specification <sch:assert test="bone" diagnostics="d_en d_de"> A dog should have a bone. </sch:assert> …. <sch:diagnostics xml:lang="en"> <sch:diagnostic id="d_en">A dog should have a bone.<sch:diagnostic> </sch:diagnostics> <sch:diagnostics xml:lang="de"> <sch:diagnostic id="d_de">Das Hund muss ein Bein haben.</sch:diagnostic> </sch:diagnostics>
  • 44. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Conclusion ● Multiple ways to associate and apply the validation ● Validation results as you type or in a report ● Messages with different severity ● Multilingual support
  • 45. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron for Non-Technical and Technical Users
  • 46. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron for Non-Technical Users ● Schematron is used in multiple domains ● There are more and more non-technical users that want to develop their own rules ● Providing a user interface to create the Schematron rules will be more appropriate for them
  • 47. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Library of Rules ● A solution can be to provide a library of rules ● The user can choose the rule that he wants to add Avoid a word in a certain element Limit the number of words Avoid duplicate content
  • 48. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Abstract Patterns ● Library of rules implemented using abstract patterns AvoidWordInElement LimitNoOfWords AvoidDuplicateContent select Schemtron rules generate
  • 49. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Abstract Pattern ● Allows to reuse patterns by making them generic <pattern id="LimitNoOfWords" abstract="true"> <rule context="$parentElement"> <let name="words" value="count(tokenize(normalize-space(.), ' '))"/> <assert test="$words le $maxWords"> $message You have <value-of select="$words"/> word(s). </assert> <assert test="$words ge $minWords"> $message You have <value-of select="$words"/> word(s). </assert> </rule> </pattern>
  • 50. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Pattern Instantiation ● Refer an abstract pattern and specifies values for parameters <pattern is-a="LimitNoOfWords"> <param name="parentElement" value="shortdesc"/> <param name="minWords" value="1"/> <param name="maxWords" value="50"/> <param name="message" value="Keep short descriptions between 1 and 50 words!"/> </pattern> <pattern is-a="LimitNoOfWords"> <param name="parentElement" value="title"/> <param name="minWords" value="1"/> <param name="maxWords" value="8"/> <param name="message" value="Keep titles between 1 and 8 words."/> </pattern>
  • 51. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Create Business Rules Using DIM
  • 52. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Dynamic Information Model (DIM) ● An implementation of an intelligent style guide ● Describes and enforces rules ● Open-source project available on GitHub https://github.com/oxygenxml/dim
  • 53. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron for Technical Users Environment to develop Schematron schemas ● Editor ● Validation ● Search and refactoring ● Working with modules ● Unit testing
  • 54. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Editor ● Syntax highlighting - to improve the readability of the content ● Content completion assistant - offering proposals that are valid at the cursor position ● Documentation - with information about the particular proposal
  • 55. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Validate ● Validate Schematron schemas, and highlight problems directly in the editor ● Validate Schematron modules in context ● Support for validation as you type
  • 56. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Search and Refactoring ● Find references to variables, pattern, phases, or diagnostics ● Support for renaming all references from the current document, or in the entire hierarchy ● Preview the changes
  • 57. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Working with Modules ● Visualize the hierarchy of modules ● Support for editing a Schematron module in the context ● Moving and renaming modules
  • 58. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Test Schematron Rules ● Developing Schematron schema also involves testing ● Make sure Schematron rules work as expected ● Apply multiple XML examples over the Schematron rules and check the results
  • 59. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. XSpec ● Solution to create Schematron unit tests ● Unit test and BDD (Behaviour Driven Development ) framework – https://github.com/xspec/xspec/ ● Oxygen XSpec Helper View plugin – github.com/xspec/oXygen-XML-editor-xspec-support ● Tutorials ● github.com/xspec/xspec/wiki/Getting-Started-with-XSpec-and-Schematron ● oxygenxml.com/events/2018/webinar_xspec_unit_testing_for_xslt_and_schematron.html
  • 60. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Conclusion ● Library of rules using abstract patterns ● User interface for non-technical users ● Editing, validation, and refactoring support for technical users ● Test cases for Schematron
  • 61. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Quick Fixes
  • 62. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Fix Proposals ● Schematron assertion messages are not always enough for the user to find a solution ● It is better to have some proposals to correct the Schematron reported problem ● Similar to spell check proposals
  • 63. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Quick Fix Proposals ● User-defined fixes for Schematron errors ● Schematron Quick Fix (SQF) language ● Extension of the Schematron language ● SQF initiated by Nico Kutscherauer www.schematron-quickfix.com github.com/schematron-quickfix/sqf
  • 64. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Quick Fixes Spec www.w3.org/community/quickfix schematron-quickfix.github.io/sqf
  • 65. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. SQF Extension of Schematron ● Added as Schematron annotations ● Associate fixes with assert and report elements <rule context="title"> <report test="b" sqf:fix="resolveBold"> Bold is not allowed in title element</report> <sqf:fix id="resolveBold"> <sqf:description> <sqf:title>Change the bold element into text</sqf:title> <sqf:p>Removes the bold (b) markup and keeps the text content.</sqf:p> </sqf:description> <sqf:replace match="b" select="node()"/> </sqf:fix> </rule>
  • 66. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Schematron Quick Fix (SQF) <sqf:fix id="resolveBold"> <sqf:description> <sqf:title>Change the bold element into text</sqf:title> <sqf:p>Removes the bold (b) markup and keeps the text content.</sqf:p> </sqf:description> <sqf:replace match="b" select="node()"/> </sqf:fix> Operation ID Description Title
  • 67. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. SQF Operations The following 4 types of operations are supported: – <sqf:add> - To add a new node or fragment in the document – <sqf:delete> - To remove a node from the document – <sqf:replace> - To replace a node with another node or fragment – <sqf:stringReplace> - To replace text content with other text or a fragment
  • 68. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Introduction to SQF Through Examples
  • 69. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 1. SQF “add” Operation ● Example of using the “add” operation: add new list item in a list List contains only one item Add new list item
  • 70. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 1. SQF “add” Operation ● <sqf:add> element allows you to add one or more nodes to the XML instance <rule context="ul"> <assert test="count(li) > 1" sqf:fix="addListItem">A list must have more than one item.</assert> <sqf:fix id="addListItem"> <sqf:description> <sqf:title>Add new list item</sqf:title> </sqf:description> <sqf:add node-type="element" target="li" position="last-child"/> </sqf:fix> </rule>
  • 71. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 2. SQF “delete” Operation ● Example of using the “delete” operation: remove redundant link text Remove redundant link text Text in the link and the value of the @href are the same
  • 72. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 2. SQF “delete” Operation ● <sqf:delete> element specifies the nodes for the deletion <rule context="xref"> <report test="@href = text()" sqf:fix="removeText"> Link text is same as @href attribute value. Please remove.</report> <sqf:fix id="removeText"> <sqf:description> <sqf:title>Remove redundant link text</sqf:title> </sqf:description> <sqf:delete match="text()"/> </sqf:fix> </rule>
  • 73. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 3. SQF “replace” Operation ● Example of using the “replace” operation: replace bold element with text Change the bold into text Styling is not allowed in titles
  • 74. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 3. SQF “replace” Operation ● <sqf:replace> element specifies the nodes to be replaced and the replacing content <rule context="title"> <report test="b" sqf:fix="resolveBold"> Bold is not allowed in title element.</report> <sqf:fix id="resolveBold"> <sqf:description> <sqf:title>Change the bold into text</sqf:title> </sqf:description> <sqf:replace match="b" select="node()"/> </sqf:fix> </rule>
  • 75. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 4. SQF “stringReplace” Operation ● Example of using the “stringReplace” operation: replace semicolon with full stop Replace semicolon with full stop Semicolon is not allowed at the end of a list item
  • 76. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. 4. SQF “stringReplace” Operation ● <sqf:stringReplace> element defines the nodes that will replace the substrings <rule context="li"> <report test="ends-with(text()[last()], ';')" sqf:fix="replaceSemicolon"> Semicolon is not allowed after list item</report> <sqf:fix id="replaceSemicolon"> <sqf:description> <sqf:title>Replace semicolon with full stop</sqf:title> </sqf:description> <sqf:stringReplace match="text()[last()]" regex=";$" select="'.'"/> </sqf:fix> </rule>
  • 77. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Conclusions ● Schematron Quick Fix language is simple ● You can define custom fixes for your project ● Just 4 types of operations
  • 78. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. SQF Implementations ● <oXygen/> XML Editor validation engine http://www.oxygenxml.com ● Escali Schematron engine http://schematron-quickfix.com/escali_xsm.html ● Escali Schematron command-line tool ● Oxygen plugin for invoking Escali Schematron
  • 79. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Projects Using SQF ● Thieme - publishing company uses a custom framework to create and edit XML documents ● parsX - a product developed by pagina GmbH used to facilitate EPUB production ● ART-DECOR - an open-source tool suite that supports SDOs active in the healthcare industry Sample SQF embedded in XSD ● ATX custom framework – used by a major automotive manufacturer
  • 80. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. Resources ● Schematron official site ● Schematron specification ● Schematron Quick Fix specification ● Sample files: github.com/octavianN/Schematron-step-by-step
  • 81. Schematron step-by-stepSchematron step-by-step Copyright @ Syncro Soft, 2018. All rights reserved. <oXygen/> XML Editor http://www.oxygenxml.com octavian_nadolu@oxygenxml.com @OctavianNadolu THANK YOU! Any questions?
  • 82. Your opinion is important to us! Please tell us what you thought of the lecture. We look forward to your feedback under http://ta14.honestly.de or scan the QR code The feedback tool will be available even after the conference!

Editor's Notes

  1. Hello everybody! My name is Octavian. I am a member of the oXygen, for over 10 years.
  2. Verify data inter-dependencies: such as if a start date from an attribute value is set before the end date attribute value Use Schematron to verify data interdependencies (co constraints), check data cardinality, and perform algorithmic checks. A co-constraint is a dependency between data within an XML document or across XML documents. Cardinality refers to the presence or absence of data. An algorithmic check determines data validity by performing an algorithm on the data. Schematron can perform any function supported by an XPath statement or XSLT test condition
  3. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  4. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  5. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  6. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  7. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  8. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  9. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  10. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  11. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  12. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  13. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  14. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  15. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  16. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  17. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  18. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  19. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  20. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  21. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  22. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  23. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  24. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  25. With Schematron you not only define your own messages, you can specify also the severity level of the message: info, warnning, error, fatal.
  26. In current development version we added multilingiual support for Schematron messages. We implemented this support base on the Schematron specification, using the diagnostic elements. For each language a diagnostic element is created and referred from the assertion. To specify the message language each diagnostic element has an xml:lang attribute.
  27. In current development version we added multilingiual support for Schematron messages. We implemented this support base on the Schematron specification, using the diagnostic elements. For each language a diagnostic element is created and referred from the assertion. To specify the message language each diagnostic element has an xml:lang attribute.
  28. The template name xsl:initial-template is specially recognized in that it provides a default entry point for stylesheet execution If the styleseet has an xsl:initial-tempalate specified, when you create a transformation scenario you don&amp;apos;t need to specify an XML document You can also specify the initial templ;ate name in the advanced options of the transformation scenario
  29. The template name xsl:initial-template is specially recognized in that it provides a default entry point for stylesheet execution If the styleseet has an xsl:initial-tempalate specified, when you create a transformation scenario you don&amp;apos;t need to specify an XML document You can also specify the initial templ;ate name in the advanced options of the transformation scenario
  30. In current development version we added multilingiual support for Schematron messages. We implemented this support base on the Schematron specification, using the diagnostic elements. For each language a diagnostic element is created and referred from the assertion. To specify the message language each diagnostic element has an xml:lang attribute.
  31. In current development version we added multilingiual support for Schematron messages. We implemented this support base on the Schematron specification, using the diagnostic elements. For each language a diagnostic element is created and referred from the assertion. To specify the message language each diagnostic element has an xml:lang attribute.
  32. The template name xsl:initial-template is specially recognized in that it provides a default entry point for stylesheet execution If the styleseet has an xsl:initial-tempalate specified, when you create a transformation scenario you don&amp;apos;t need to specify an XML document You can also specify the initial templ;ate name in the advanced options of the transformation scenario
  33. In current development version we added multilingiual support for Schematron messages. We implemented this support base on the Schematron specification, using the diagnostic elements. For each language a diagnostic element is created and referred from the assertion. To specify the message language each diagnostic element has an xml:lang attribute.
  34. SQF Extension of Schematron
  35. A quick fix structure is in fact very simple. - It has an ID used to refer the quick fix - A title - A description of the quick fix - And the operations that will be performed.
  36. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  37. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  38. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  39. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  40. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  41. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  42. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  43. So, we have similar implementation to the on that Nico presented, but we generate from the SQF quick fixes the oXygen quick fixes, that we know to execute in the application.
  44. Thank you for watching. If you have any questions, that you didn&amp;apos;t ask yet, you can ask now. Also you can send the questions to my email address or on twitter.