Schematron is a rule-based validation language. Has become an ISO standard since 2006 and it is a very popular language in the XML world. In the last few years, Schematron started to be used more and more and in numerous domains. In this tutorial you will learn how to create ISO Schematron schemas, how to use XPath to express your constraints, as well as how to validate your XML files using an ISO Schematron schema and create a report.
In this tutorial I will present how to create an ISO Schematron schema from scratch. I will explain the ISO Schematron schema structure, elements and attributes, and how you can express custom rules and constraints.
https://github.com/octavianN/Schematron-step-by-step
Schematron is a very simple and powerful language. It is used in various domains (financial, insurance, government, and technical publishing sectors) for quality assurance, validating business rules, constraint checking, or data reporting. During the presentation, I will show you how to create Schematron rules step-by-step, apply the rules over one or multiple documents, and also how to integrate Schematron rules in your development process
Schematron is a rule-based validation language for making assertions about presence or absence of certain patterns in XML documents. With 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 and can be used to check big things, such as if an element is allowed in a specific context, or if an attribute is allowed for an element. But with Schematron, you can create your custom rules specific to your project, and check things such as if the text from an element respects a particular constraint, or verify data inter-dependencies such as if a start date from an attribute value is set before the end date attribute value.
In a Schematron document, you can add a collection of rules that contain tests. The Schematron content is written as an XML document using a small number of elements, and this makes it easy to understand and write, even for people that are not programmers.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
It is a basic presentation which can help you understand the basic concepts about Graphql and how it can be used to resolve the frontend integration of projects and help in reducing the data fetching time
This presentation also explains the core features of Graphql and why It is a great alternative for REST APIs along with the procedure with which we can integrate it into our projects
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Edureka!
This Edureka Spring Framework Tutorial will help you in understanding the fundamentals of Spring Framework and help you in building a strong foundation in Spring with examples. Below are the topics covered in this tutorial:
1. Java Frameworks
2. Spring Framework
3. Why Spring Framework?
4. Spring Architecture
5. Spring Modules
6. IoC Container
7. Dependency Injection
A short presentation that explains the internals of the Spring Boot framework. Includes an example of a starter and an autoconfig artifac, and a github repo:
https://github.com/MichelSchudel/springbootunderdahood
https://github.com/octavianN/Schematron-step-by-step
Schematron is a very simple and powerful language. It is used in various domains (financial, insurance, government, and technical publishing sectors) for quality assurance, validating business rules, constraint checking, or data reporting. During the presentation, I will show you how to create Schematron rules step-by-step, apply the rules over one or multiple documents, and also how to integrate Schematron rules in your development process
Schematron is a rule-based validation language for making assertions about presence or absence of certain patterns in XML documents. With 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 and can be used to check big things, such as if an element is allowed in a specific context, or if an attribute is allowed for an element. But with Schematron, you can create your custom rules specific to your project, and check things such as if the text from an element respects a particular constraint, or verify data inter-dependencies such as if a start date from an attribute value is set before the end date attribute value.
In a Schematron document, you can add a collection of rules that contain tests. The Schematron content is written as an XML document using a small number of elements, and this makes it easy to understand and write, even for people that are not programmers.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
It is a basic presentation which can help you understand the basic concepts about Graphql and how it can be used to resolve the frontend integration of projects and help in reducing the data fetching time
This presentation also explains the core features of Graphql and why It is a great alternative for REST APIs along with the procedure with which we can integrate it into our projects
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Edureka!
This Edureka Spring Framework Tutorial will help you in understanding the fundamentals of Spring Framework and help you in building a strong foundation in Spring with examples. Below are the topics covered in this tutorial:
1. Java Frameworks
2. Spring Framework
3. Why Spring Framework?
4. Spring Architecture
5. Spring Modules
6. IoC Container
7. Dependency Injection
A short presentation that explains the internals of the Spring Boot framework. Includes an example of a starter and an autoconfig artifac, and a github repo:
https://github.com/MichelSchudel/springbootunderdahood
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...Edureka!
This Edureka "Spring Interview Questions and Answers" tutorial will help you to prepare yourself for Spring Framework Interviews. This tutorial is ideal for freshers as well as experienced also. Learn about the most important Spring Framework interview questions and answers and know what will set you apart in the interview process. Below are the topics covered in this tutorial:
1. General Questions
2. Dependency Injection/ IoC
3. Beans
4. Annotations
5. Data Access
6. Aspect Oriented Programming(AOP)
7. MVC
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on File Handling with Python covers all the important aspects of using files in Python right from the introduction to what fields are, all the way till checking out the major aspects of working with files and using the code-first approach to understand them better.
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Django Rest Framework | How to Create a RESTful API Using Django | Django Tut...Edureka!
This Edureka “Django Rest Framework tutorial" introduces you to the concepts of API and will help you build a successful REST API in Django. This video helps you to learn the following topics:
1. What is an API?
2. Introduction to Rest Framework
3. What is Rest API?
4. Demo - Create a RESTful Web APi
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...Edureka!
This Edureka "What Is Spring Framework" tutorial will help you in understanding the fundamentals of Spring Framework and build a strong foundation in Spring. Below are the topics covered in this tutorial:
1. Java Frameworks
2. Spring Framework
3. Why Spring Framework?
4. Spring Architecture
5. Spring Modules
6. Spring Features
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...Edureka!
This Edureka "Spring Interview Questions and Answers" tutorial will help you to prepare yourself for Spring Framework Interviews. This tutorial is ideal for freshers as well as experienced also. Learn about the most important Spring Framework interview questions and answers and know what will set you apart in the interview process. Below are the topics covered in this tutorial:
1. General Questions
2. Dependency Injection/ IoC
3. Beans
4. Annotations
5. Data Access
6. Aspect Oriented Programming(AOP)
7. MVC
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on File Handling with Python covers all the important aspects of using files in Python right from the introduction to what fields are, all the way till checking out the major aspects of working with files and using the code-first approach to understand them better.
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Django Rest Framework | How to Create a RESTful API Using Django | Django Tut...Edureka!
This Edureka “Django Rest Framework tutorial" introduces you to the concepts of API and will help you build a successful REST API in Django. This video helps you to learn the following topics:
1. What is an API?
2. Introduction to Rest Framework
3. What is Rest API?
4. Demo - Create a RESTful Web APi
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...Edureka!
This Edureka "What Is Spring Framework" tutorial will help you in understanding the fundamentals of Spring Framework and build a strong foundation in Spring. Below are the topics covered in this tutorial:
1. Java Frameworks
2. Spring Framework
3. Why Spring Framework?
4. Spring Architecture
5. Spring Modules
6. Spring Features
A new compact XML algorithm without any dependencies. Its implemented as a rubygem to provide Non-native XML parser for particular usages. RubyGem at http://rubygems.org/gems/xml-motor and https://github.com/abhishekkr/rubygem_xml_motor
These days you can't go far without encountering XML or JSON and in the world of the web these data types are ubiquitous. Since version 8.3 XML has been supported as a data type and JSON support was introduced in 9.2. We'll be looking at what advantages there are in storing your data with these data types and how we can query and manipulate our data once it's stored.
Boston Sakai09 Preconference workshop on OSP forms. We cover XML, XSD, XSL basics and specifics as it pertains to OSP. There is a packet of downloadable support files for the workshop at:
http://threecanoes.com/2009-boston-workshop
This presentation is distributed under the Creative Commons "Attribution Non-Commercial No Derivatives" license.
Please post questions about the materials on these presentations to the Sakai portfolio list.
Oxygen provides full support for editing and validating YAML documents. You can use Oxygen's editor to create, modify, and format YAML files with its intelligent editing features, including syntax highlighting, code folding, content completion, and error checking. Oxygen also offers validation against JSON schemas and supports customization of schemas for specific projects or file types. Additionally, you can visualize and navigate through your YAML structures with Oxygen's Outline view.
https://www.oxygenxml.com/events/2023/webinar_exploring_oxygen_yaml_support.html
https://www.oxygenxml.com/json_editor/yaml.html
Oxygen JSON Editor is a specialized tool designed for editing JSON documents. It offers a wide range of features and views, including Text, Grid, and Author editing modes, along with Design mode for JSON Schema. The intuitive interface and comprehensive set of tools make it easy to navigate, understand, and modify your JSON, JSON Schema files, as well as YAML and OpenAPI files.
Leveraging the Power of AI and Schematron for Content Verification and Correc...Octavian Nadolu
The journey into the world of AI continues by exploring its application in conjunction with Schematron and Schematron Quick Fix (SQF) for content verification and correction. In this webinar, we aim to offer a comprehensive overview of AI, highlight the potential advantages it brings, and shed light on the challenges we encounter when utilizing AI for these purposes.
Don't miss this opportunity to gain valuable insights into the intersection of AI and content validation by exploring topics such as:
Artificial Intelligence (AI)
OpenAI/Generative Pre-trained Transformer
Schematron and Schematron Quick Fixes (SQF)
Implementing AI in Schematron and SQF
Examples of AI-driven Schematron and SQF Solutions
Benefits of Using AI in Schematron and SQF
https://www.oxygenxml.com/events/2022/webinar_openapi_support_in_oxygen.html
OpenAPI is a community-driven open specification that defines a language-agnostic interface used to describe, produce, consume, and visualize RESTful APIs and web services.
AsyncAPI started as an adaptation of the OpenAPI specification, used for describing asynchronous messaging APIs.
OpenAPI/AsyncAPI documents describe the API (or its elements) and are represented in either YAML or JSON formats.
During this live webinar, you will discover the support offered in Oxygen to create, edit, and validate OpenAPI/AsyncAPI documents as well as how to test, and generate documentation for OpenAPI documents. By joining this live event, you will get the chance to learn the following:
How to create OpenAPI/AsyncAPI documents
How to edit and validate OpenAPI/AsyncAPI documents
How edit OpenAPI/AsyncAPI documentation in Author mode
How to generate documentation for OpenAPI components in HTML format
How to test an OpenAPI, execute API requests, and validate responses
How to create and run test scenarios
Validating XML and JSON Documents Using Oxygen ScriptingOctavian Nadolu
https://www.oxygenxml.com/events/2023/webinar_validating_xml_and_json_documents_using_oxygen_scripting.html
This presentation covers details about this newly implemented validation scripting support, as well as showing examples of how to use it efficiently. You will learn how to validate files or directories from a command line interface. You can check that your documents are valid from an integration server and you can generate reports in several formats (text, XML, JSON, or an HTML visual format). We won’t be stopping there, as we will also be looking at how you can use transformation or comparison scripts.
During this 1-hour live event, we will focus on showing you the following:
How to use the Validation command-line script
How to validate against a specific schema file
How to validate using the default Oxygen validation scenarios
How to use validation scenario from either a scenarios file or a project file
How to generate the validation results in various formats (YAML, JSON, XML, HTML)
How to run validation on an continuous integration server CI/CD
How to use the Transformation command-line script
How to use the Comparison/Merge command-line script
OpenAPI is a community-driven open specification that defines a language-agnostic interface used to describe, produce, consume, and visualize RESTful APIs and web services. OpenAPI documents describe the API (or its elements) and are represented in either YAML or JSON formats.
Vide Demo:
https://www.oxygenxml.com/events/2022/webinar_openapi_editing_testing_and_documenting.html
In this presentation, you will learn about the new JSON and JSON Schema support added in the latest Oxygen versions, as well as the support for OpenAPI, AsyncAPI, and JSON-LD. Get the chance to discover the following:
- Smart editing of JSON documents based on the JSON Schema
- Specialized JSON tools
- Editing JSON Schema in design mode
- The OpenAPI, AsyncAPI, JSON-LD support
https://youtu.be/r5SLk3XLOUs
In this presentation you will get to see how the Design mode can help both content authors who want to visualize or understand a schema and schema designers who develop complex schemas. You will also get the chance to learn:
- How to create JSON schemas from scratch
- How to use the new Pallet view to add new components
- How to use the drag-and-drop support to design your JSON Schema
- How to use refactoring actions
- How to visualize and edit complex JSON Schemas
Oxygen Compare and Merge Scripts
In this presentation I cover in detail this compare and merge scripting support, as well as showing you examples on how to use it efficiently, showing you the following:
- The Compare and Merge Files Command-Line Script - used to compare and merge files and get the comparison results in various formats (YAML, JSON, XML, HTML).
- The Compare and Merge Directories Command-Line Script - with many options to choose from, such as the comparison mode (content, binary, timestamp), the algorithm to be used for the comparison, the "strength" of the comparison algorithm, various "include/exclude" type file filters, various "ignore" type options to refine the comparison results.
- Generating File or Directory Comparison HTML Reports - the support to save the comparison made with Oxygen XML Editor in HTML format.
https://www.oxygenxml.com/events/2021/webinar_the_new_oxygen_compare_and_merge_scripts.html
https://www.oxygenxml.com/events/2021/webinar_the_new_json_schema_diagram_editor.html
A webinar in which we will show you how Oxygen now offers even more powerful tools that allow you to design, develop, and edit JSON Schemas. We will be focusing on presenting features ranging from the new intuitive and expressive visual schema Design mode, all the way up to the JSON Schema documentation generator that includes diagram images for each component.
During this live webinar, you will get the chance to take an in-depth look at all of these features, as well as learn:
How to create JSON Schemas from scratch
How to visualize and edit complex JSON Schemas
How to generate JSON Schema documentation
Schematron is designed to be used for XML documents. The definition of the Schematron is "A language for making assertions about the presence or absence of patterns in XML documents". But why we should not use it also for non-XML languages, such as JSON, Markdown, or even HTML5?
Oxygen provides a specialized JSON and JSON Schema editor with a variety of editing features, helper views, and useful tools. In this presentation you will see an overview of the JSON support, as well as the new additions, such as:
- An instance generator from a JSON Schema
- XSD to JSON schema converter
- Generate JSON Schema from JSON instance
- JSON Schema annotations
- Schematron validation for JSON
Oxygen provides support for generating HTML5 and XHTML5 documents, and support for editing and validating XHTML5 files. Now Oxygen Editor introduces full HTML5 support, providing features such as:
- Specialized text-based and visual-based editing
- Syntax highlights based on the HTML5 specification
- Content completion based on the HTML5 schema
- Outline view that displays the document structure
- Validation against the W3C validator, including batch validation
- Emmet plugin - toolkit for high-speed HTML coding and editing
Documentation Quality Assurance with ISO SchematronOctavian Nadolu
It is important to have quality control over the XML documents in your project. You do this using Schematron schema in combination with other schemas (such as XSD, RNG, or DTD). Schematron solves the limitation that other types of schema have when validating XML documents because it allows the schema author to define the tests and control the messages that are presented to the user. The validation problems are more accessible to users and it ensures that they understand the problem.
Schematron is a language that ca be used to define rules for quality assurance an consistency in the XML documents. Reporting detected inconsistencies and error conditions enables content writers to correct the problems.
With Schematron you can define different type of problems (such as code smell, bug, or vulnerability) and you can set different severities (such us: info, warn, error, fatal) to the messages. By analyzing the report you can give a verdict if the project build fails, or is with warnings, or is successful.
This presentation is meant to explain the JSON languages and the support that you need when this type of documents are edited, validated, queried, or converted. You will also discover what languages and tools can be used when working with these types of documents.
JSON it is a common format for data interchange and is adopted by applications as a way to store data. It is a self describing languages, the structure is defined hierarchically, and has schema to define its structure.
A JSON Schema can be used the define JSON documents structure. It is an Internet Draft at the IETF and not many tools support it, but it is actively developed.
JSON Edit, Validate, Query, Transform, and ConvertOctavian Nadolu
This presentation will explore the JSON features added in Oxygen 20.1 and the new features that will be available in Oxygen 21, including:
- Validating JSON documents against a JSON Schema
- The new redesigned Outline view for JSON documents
- Content completion assistance for JSON, based on the JSON Schema
- Defining code Templates for JSON
- Associating a JSON Schema directly in JSON documents
- Executing XPath expressions over multiple JSON files
- Transforming JSON documents using XSLT
The Power Of Schematron Quick Fixes - XML Prague 2019Octavian Nadolu
In this presentation, you will discover the new additions for the SQF language and how you can create useful and interesting quick fixes for the Schematron rules defined in your project. It will include examples of quick fixes for several type of projects and using abstract quick fixes to enable easier creation of specific fixes or XSLT code for more complex fixes. You will also discover some use cases for quick fixes that extend your Schematron scope.
Collaboration Tools to Help Improve Documentation ProcessOctavian Nadolu
An in-depth view of our documentation workflow to show real world use-cases of how you can use Oxygen products to efficiently and thoroughly collaborate with everyone involved in the documentation process.
Exploring the new features in Oxygen XML Editor 20 - DevelopmentOctavian Nadolu
Explore some of the new features and improvements that were added in Oxygen XML Editor 20 on the development part. The subjects that we will discuss include:
Productivity enhancements for XSLT developers
Saxon update
Schematron improvements
Schematron Quick Fix Update
JSON
Comparing and Merging XML Documents in Visual ModeOctavian Nadolu
More and more users are using the visual Author mode to edit documents. Comparing and merging documents directly in the visual Author mode is more appropriate for them. This makes it easier to see how the compared changes will look in the final output once the changes are merged. There are multiple ways to present the differences in a visual Author mode: using Oxygen built-in actions, from an external tool, or from a plugin.
Acorn Recovery: Restore IT infra within minutesIP ServerOne
Introducing Acorn Recovery as a Service, a simple, fast, and secure managed disaster recovery (DRaaS) by IP ServerOne. A DR solution that helps restore your IT infra within minutes.
This presentation by Morris Kleiner (University of Minnesota), was made during the discussion “Competition and Regulation in Professions and Occupations” held at the Working Party No. 2 on Competition and Regulation on 10 June 2024. More papers and presentations on the topic can be found out at oe.cd/crps.
This presentation was uploaded with the author’s consent.
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Orkestra
UIIN Conference, Madrid, 27-29 May 2024
James Wilson, Orkestra and Deusto Business School
Emily Wise, Lund University
Madeline Smith, The Glasgow School of Art
This presentation, created by Syed Faiz ul Hassan, explores the profound influence of media on public perception and behavior. It delves into the evolution of media from oral traditions to modern digital and social media platforms. Key topics include the role of media in information propagation, socialization, crisis awareness, globalization, and education. The presentation also examines media influence through agenda setting, propaganda, and manipulative techniques used by advertisers and marketers. Furthermore, it highlights the impact of surveillance enabled by media technologies on personal behavior and preferences. Through this comprehensive overview, the presentation aims to shed light on how media shapes collective consciousness and public opinion.
Have you ever wondered how search works while visiting an e-commerce site, internal website, or searching through other types of online resources? Look no further than this informative session on the ways that taxonomies help end-users navigate the internet! Hear from taxonomists and other information professionals who have first-hand experience creating and working with taxonomies that aid in navigation, search, and discovery across a range of disciplines.
0x01 - Newton's Third Law: Static vs. Dynamic AbusersOWASP Beja
f you offer a service on the web, odds are that someone will abuse it. Be it an API, a SaaS, a PaaS, or even a static website, someone somewhere will try to figure out a way to use it to their own needs. In this talk we'll compare measures that are effective against static attackers and how to battle a dynamic attacker who adapts to your counter-measures.
About the Speaker
===============
Diogo Sousa, Engineering Manager @ Canonical
An opinionated individual with an interest in cryptography and its intersection with secure software development.
2. Introduction to ISO SchematronIntroduction to ISO Schematron
Software Architect at Syncro Soft
octavian.nadolu@oxygenxml.com
• 15+ years of XML technology experience
• Contributor for various XML-related open source projects
• Editor of Schematron QuickFix specification developed by a W3C
community group
About me
3. Introduction to ISO SchematronIntroduction to ISO Schematron
Agenda
● ISO Schematron history
● ISO Schematron introduction
● XPath in ISO Schematron
● Schematron in the development process
● Schematron for technical and non-
technical users
● Schematron Quick Fixes
4. Introduction to ISO SchematronIntroduction to ISO Schematron
What is Schematron?
A natural language for making assertions in documents
5. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron is an ISO Standard
Schematron is an ISO standard adopted by hundreds of major
projects in the past decade
6. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron History
Schematron was invented by
Rick Jelliffe
● Schematron 1.0 (1999), 1.3
(2000), 1.5 (2001)
● ISO Schematron (2006, 2010,
2016)
7. Introduction to ISO SchematronIntroduction to ISO Schematron
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. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Usage
● Verify data inter-dependencies
● Check data cardinality
● Perform algorithmic checks
9. Introduction to ISO SchematronIntroduction to ISO Schematron
Used in Multiple Domains
● Financial
● Insurance
● Government
● Technical publishing
10. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron is Very Simple
There are only 6 basic elements:
assert
report
rule
pattern
schema
ns
11. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Step-by-Step
12. Introduction to ISO SchematronIntroduction to ISO Schematron
XML
A list of books from a bookstore:
...
<book price="7">
<title>XSLT 2.0 Programmer's Reference</title>
<author>Michael Kay</author>
<isbn>0764569090</isbn>
</book>
<book price="1100">
<title>XSLT and XPath On The Edge</title>
<author>Jeni Tennison</author>
<isbn>0764547763 </isbn>
</book>
...
13. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
<book price="1100">
<title>XSLT and XPath On The Edge</title>
<author>Jeni Tennison</author>
<isbn>0764547763</isbn>
</book>
...
The price is too small
The book price is too big
Validate
19. Introduction to ISO SchematronIntroduction to ISO Schematron
<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. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusion
● Schematron is simple (6 basic elements)
● Used in multiple domains
● Schematron uses XPath
21. Introduction to ISO SchematronIntroduction to ISO Schematron
//* XPath in Schematron
22. Introduction to ISO SchematronIntroduction to ISO Schematron
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)
23. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Uses XPath
● XPath 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">
24. Introduction to ISO SchematronIntroduction to ISO Schematron
Basic XPath Syntax
● nodeName – select node with a specific name
● / - level selector
● // - multi-level selector
● ../ - level up selector
● @ - attribute selector
25. Introduction to ISO SchematronIntroduction to ISO Schematron
Examples
● book – select all nodes with the name “book”
● /books/book – selects all the “book” elements that are in the
“books” root element
● book/title – selects the “title” elements for all the books
● /books//title – selects all the “title” elements from the “books”
● @price – selects all the price attributes
26. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Example
<rule context="/books/book">
<assert test="@price > 10">The book price is too small</assert>
</rule>
<rule context="/books/book/@price">
<assert test=". > 10">The book price is too small</assert>
</rule>
27. Introduction to ISO SchematronIntroduction to ISO Schematron
Predicates
Condition in square brakes
● //book[2] – selects the second book element
● book[@price < 10] – selects all the book elements with
the price less than(lt) 10
● book[last()] - selects the last book element
● book[@price>1000]/author - selects all the “author”
elements that are in a book with the price grater than(gt)
1000
28. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Example
<rule context="book[@price>1000]/author">
<assert test="text() = 'Jeni Tennison'">
Only 'Jeni Tennison' books can have bigger price</assert>
</rule>
<rule context="book[@price lt 10] ">
<assert test="false()">The book price is too small</assert>
</rule>
29. Introduction to ISO SchematronIntroduction to ISO Schematron
Wildcards
* - any element node selector
@* - any attribute node selector
node() - any node selector
30. Introduction to ISO SchematronIntroduction to ISO Schematron
Wildcards Examples
//* - selects all the elements from the document
//book[@*] - selects all the book elements that have an
attribute
//book/* - selects all the elements from the book
31. Introduction to ISO SchematronIntroduction to ISO Schematron
XPath Functions
● For strings: concat(), substring(), contains(), substring-before(),
substring-after(), translate(), normalize-space(), string-length()
● For numbers: sum(), round(), floor(), ceiling()
● Node Properties: name(), local-name(), namespace-uri()
32. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Example
<rule context="book/title">
<assert test="string-length(text()) lt 30">
Titles should be less than 30 characters</assert>
</rule>
<rule context="books">
<report test="sum(book/@price) > 10000">
The books price is too big</report>
</rule>
33. Introduction to ISO SchematronIntroduction to ISO Schematron
XPath Version in Schematron
● @queryBinding – determines the XPath version
<schema queryBinding="xslt2">
Possible values: xslt, xslt2, xslt3
34. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusion
● XPath it is very important in Schematron
● Used in rule context and assertions
● Different XPath versions
● Tutorials:
– www.data2type.de/en/xml-xslt-xslfo/xpath/
– www.xfront.com/xpath/
– www.zvon.org/comp/m/xpath.html
35. Introduction to ISO SchematronIntroduction to ISO Schematron
Examples of Rules
36. Introduction to ISO SchematronIntroduction to ISO Schematron
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
37. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
38. Introduction to ISO SchematronIntroduction to ISO Schematron
Styling in Titles
● Example rule that checks for styling in titles
Bold is not allowed in title element
39. Introduction to ISO SchematronIntroduction to ISO Schematron
Styling in Titles
● The b element should not be used in a title or short
description
<sch:rule context="title | shortdesc">
<sch:report test="b">
Bold is not allowed in <sch:name/> element</sch:report>
</sch:rule>
40. Introduction to ISO SchematronIntroduction to ISO Schematron
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
41. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
42. Introduction to ISO SchematronIntroduction to ISO Schematron
Check External Link Protocol
● Example of rule that check the external link protocol
The external link should start with http(s)
43. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
44. Introduction to ISO SchematronIntroduction to ISO Schematron
Missing Tables Cells
● Missing cells in a table
Cells are missing from table
45. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
46. Introduction to ISO SchematronIntroduction to ISO Schematron
Link in Text Content
● Links are added directly in text content
Link detected in the current element
47. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
48. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusion
● Simple to complex
Schematron rules
● Additional Schematron
elements
<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
49. Introduction to ISO SchematronIntroduction to ISO Schematron
Integrating Schematron in the Development Process
50. Introduction to ISO SchematronIntroduction to ISO Schematron
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"?>
51. Introduction to ISO SchematronIntroduction to ISO Schematron
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
52. Introduction to ISO SchematronIntroduction to ISO Schematron
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
53. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
54. Introduction to ISO SchematronIntroduction to ISO Schematron
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
55. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
56. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusion
● Multiple ways to associate and apply the
validation
● Validation results as you type or in a
report
● Messages with different severity
● Multilingual support
57. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron for
Non-Technical Users
58. Introduction to ISO SchematronIntroduction to ISO Schematron
Create Rules
● 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
59. Introduction to ISO SchematronIntroduction to ISO Schematron
Auto-Generate Schematron Rules
● A style guide can contain information to automate the style
guide checks
● An automated rule is an instantiation of a generic rule
60. Introduction to ISO SchematronIntroduction to ISO Schematron
Intelligent Integrated Style Guide
● An implementation of an intelligent style guide
● Describes and enforces rules
● Open-source project is available on GitHub
github.com/oxygenxml/integrated-styleguide
61. Introduction to ISO SchematronIntroduction to ISO Schematron
Library of Rules
● Generic rules can be created using 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
62. Introduction to ISO SchematronIntroduction to ISO Schematron
Abstract Patterns
Library of rules implemented using abstract patterns
AvoidWordInElement
LimitNoCharacters
AvoidDuplicateContent
Schematron rules
generate
63. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
64. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
65. Introduction to ISO SchematronIntroduction to ISO Schematron
Chatbot to Generate Schematron
66. Introduction to ISO SchematronIntroduction to ISO Schematron
Generate Schematron Patterns
66
<sch:pattern is-a="limitElement">
<sch:param name="element" value="p"/>
<sch:param name="limit" value="maximum"/>
<sch:param name="size" value="100"/>
<sch:param name="unit" value="words"/>
<sch:param name="message" value="p should contain maximum 100 words"/>
</sch:pattern>
l
“Paragraphs should have less than 100 words”
67. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron for Technical Users
68. Introduction to ISO SchematronIntroduction to ISO Schematron
Environment to Develop Schematron Schemas
– Editor
– Validation
– Search and refactoring
– Working with modules
– Unit testing
69. Introduction to ISO SchematronIntroduction to ISO Schematron
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
70. Introduction to ISO SchematronIntroduction to ISO Schematron
Validate
● Validate Schematron schemas, and highlight problems
directly in the editor
● Validate Schematron modules in context
● Support for validation as you type
71. Introduction to ISO SchematronIntroduction to ISO Schematron
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
72. Introduction to ISO SchematronIntroduction to ISO Schematron
Working with Modules
● Visualize the hierarchy of modules
● Support for editing a Schematron module in the context
● Moving and renaming modules
73. Introduction to ISO SchematronIntroduction to ISO Schematron
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
74. Introduction to ISO SchematronIntroduction to ISO Schematron
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.h
tml
75. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusion
● User interface for non-technical users
● Library of rules using abstract patterns
● Editing, validation, and refactoring for
technical users
● Test cases for Schematron
76. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Quick Fixes
77. Introduction to ISO SchematronIntroduction to ISO Schematron
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
78. Introduction to ISO SchematronIntroduction to ISO Schematron
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
79. Introduction to ISO SchematronIntroduction to ISO Schematron
Schematron Quick Fixes Spec
www.w3.org/community/quickfix
schematron-quickfix.github.io/sqf
80. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
81. Introduction to ISO SchematronIntroduction to ISO Schematron
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
82. Introduction to ISO SchematronIntroduction to ISO Schematron
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
83. Introduction to ISO SchematronIntroduction to ISO Schematron
Introduction to SQF Through Examples
84. Introduction to ISO SchematronIntroduction to ISO Schematron
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
85. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
86. Introduction to ISO SchematronIntroduction to ISO Schematron
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
87. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
88. Introduction to ISO SchematronIntroduction to ISO Schematron
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
89. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
90. Introduction to ISO SchematronIntroduction to ISO Schematron
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
91. Introduction to ISO SchematronIntroduction to ISO Schematron
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>
92. Introduction to ISO SchematronIntroduction to ISO Schematron
Conclusions
● Schematron Quick Fix language is simple
● You can define custom fixes for your project
● Just 4 types of operations
93. Introduction to ISO SchematronIntroduction to ISO Schematron
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
94. Introduction to ISO SchematronIntroduction to ISO Schematron
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
95. Introduction to ISO SchematronIntroduction to ISO Schematron
Resources
● Schematron official site
● Schematron specification
● Schematron Quick Fix specification
Sample files:
github.com/octavianN/Schematron-step-by-step