Schematron QuickFix – a simple language to specify the actions that will be used to fix the Schematron detected issues, layered on top of XPath and XSLT, and integrated within Schematron schemas through the annotation support.
The idea of Schematron QuickFix (SQF) was discussed during the XML Prague conference and it started to take shape. It has now reached a point where we have a draft specification available, a W3C community group dedicated to XML Quick Fixes, and two independent SQF implementations. The first draft of the Schematron QuickFix specification was published in April 2015 and it is now available on GitHub (http://schematron-quickfix.github.io/sqf) and within the W3C “Quick-Fix Support for XML Community Group” (https://www.w3.org/community/quickfix/). Schematron QuickFix defines a simple language to specify the actions that are used to fix the detected issues, layered on top of XPath and XSLT, and integrated within Schematron schemas through the Schematron annotation support. In this session, we will present various use cases that are solved with Schematron QuickFixes, ranging from simple to complex, sometimes involving changes in multiple locations within a document, or even in external documents. We will also discuss the language and challenges related to the SQF implementation.
Slides of the QuickFix presentation on the oXygen User Meetup at the pre-conference day at the XMLPrague 2015. See the main part of the presentation slides here http://de.slideshare.net/nottavy/quick-fixes
Due to the feedback that we received from our users, oXygen has continued to improve the support for Schematron and Schematron QuickFix (SQF). You can use XSLT 3.0 in Schematron schemas and as well as multilingual messages. oXygen extended the SQF support for resolving errors in documents other than the current one and allows the users to specify values to be used when executing a fix.
Identifying an error is only the first step in correcting a document. You also need to understand the problem and perform actions to fix it. Quick Fixes offer a choice of possible actions that will automatically fix a reported problem. See how oXygen implemented Quick Fixes for XSLT and XML documents and discover Schematron Quick Fixes (a language that allows you to define your own quick fix actions).
See also Nico Kutscherauer presentation about Schematron Quick Fixes, from oXygen User Meetup at the pre-conference day at the XMLPrague 2015: http://de.slideshare.net/NicoKutscherauer/schematron-quickfix-on-xmlprague
Performance Test Automation With GatlingKnoldus Inc.
Gatling is a lightweight dsl written in scala by which you can treat your performance test as a production code means you can easily write a readable code to test the performance of an application it s a framework based on Scala, Akka and Netty.
Slides of the QuickFix presentation on the oXygen User Meetup at the pre-conference day at the XMLPrague 2015. See the main part of the presentation slides here http://de.slideshare.net/nottavy/quick-fixes
Due to the feedback that we received from our users, oXygen has continued to improve the support for Schematron and Schematron QuickFix (SQF). You can use XSLT 3.0 in Schematron schemas and as well as multilingual messages. oXygen extended the SQF support for resolving errors in documents other than the current one and allows the users to specify values to be used when executing a fix.
Identifying an error is only the first step in correcting a document. You also need to understand the problem and perform actions to fix it. Quick Fixes offer a choice of possible actions that will automatically fix a reported problem. See how oXygen implemented Quick Fixes for XSLT and XML documents and discover Schematron Quick Fixes (a language that allows you to define your own quick fix actions).
See also Nico Kutscherauer presentation about Schematron Quick Fixes, from oXygen User Meetup at the pre-conference day at the XMLPrague 2015: http://de.slideshare.net/NicoKutscherauer/schematron-quickfix-on-xmlprague
Performance Test Automation With GatlingKnoldus Inc.
Gatling is a lightweight dsl written in scala by which you can treat your performance test as a production code means you can easily write a readable code to test the performance of an application it s a framework based on Scala, Akka and Netty.
JChem Microservices provide microservices in small separate modules for different areas of ChemAxon functionalities like chemical dataset searching, conversion between chemical file formats.
This presentation shows introduction to performance testing open source tool Gatling.
I am working on this tool from more than a year now and loved it's load testing features.
It uncovered many performance issues in our web based software service application.
I made and presented these slides to 20 QA people audience in our organization to show basics of Gatling tool. It also covers main facilities of Gatling for effective performance testing.
Thanks,
er.viral.jain@gmail.com
It is important to have documents without errors, but not all users know how to fix the errors from the documents. And even if they do know, ideally they should use a quick and automated solution.
oXygen does not only report errors, it also helps you correct them automatically through the Quick Fix support, which provides automatic fixes for XML documents validated against XSD, Relax NG, and Schematron schemas. In the case of Schematron, the schema developer takes full control over the Quick Fix actions, being able to offer custom solutions to any detected issue using the Schematron Quick Fix language.
The presentation includes:
- Generic Quick Fix support in oXygen
- Quick fix support for XML validated against XSD
- Quick fix support for XML validated against Relax NG
Schematron Quick Fix language
- Developing custom quick fixes in Schematron
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.
See how to create automatic business rule checks and how to develop fixes using the Schematron QuickFix (SQF) language. Using SQF, you can provide fix proposals for business rules, thus offering a complete solution while saving time and avoiding the potential for causing other issues.
Schematron solves certain limitations that other types of schema have when validating XML documents since it allows the schema developer to define the errors and control the messages that are presented to the user. Therefore, Schematron makes the validation errors more accessible to users and helps to ensures that they understand the problem. These messages may also include hints to help the user to fix the problem, but this doesn't complete the solution since the user still needs to manually correct the issue. This may cause users to waste valuable time and also creates the possibility of making additional errors while trying to manually fix the reported problem. Schematron Quick Fixes provide automatic actions to fix validation errors, thus offering a complete solution, while saving time and avoiding the potential for causing other issues.
Covered topics:
- Using Schematron to automatically check business rules.
- Fix proposals for business rules using Schematron QuickFix language (SQF).
- How SQF integrates with Schematron.
- Introduction to SQF with examples.
- SQF use-cases (error correction, refactoring, automatic tagging, and more).
Windows Server AppFabric Caching - What it is & when you should use it?Robert MacLean
This is from my Tech-Ed Africa 2010 talk. For more information see: http://www.sadev.co.za/content/teched-africa-2010-slides-scripts-and-demos-my-talks
This session looks at what AppFabric Caching is from start to deep dive.
JChem Microservices provide microservices in small separate modules for different areas of ChemAxon functionalities like chemical dataset searching, conversion between chemical file formats.
This presentation shows introduction to performance testing open source tool Gatling.
I am working on this tool from more than a year now and loved it's load testing features.
It uncovered many performance issues in our web based software service application.
I made and presented these slides to 20 QA people audience in our organization to show basics of Gatling tool. It also covers main facilities of Gatling for effective performance testing.
Thanks,
er.viral.jain@gmail.com
It is important to have documents without errors, but not all users know how to fix the errors from the documents. And even if they do know, ideally they should use a quick and automated solution.
oXygen does not only report errors, it also helps you correct them automatically through the Quick Fix support, which provides automatic fixes for XML documents validated against XSD, Relax NG, and Schematron schemas. In the case of Schematron, the schema developer takes full control over the Quick Fix actions, being able to offer custom solutions to any detected issue using the Schematron Quick Fix language.
The presentation includes:
- Generic Quick Fix support in oXygen
- Quick fix support for XML validated against XSD
- Quick fix support for XML validated against Relax NG
Schematron Quick Fix language
- Developing custom quick fixes in Schematron
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.
See how to create automatic business rule checks and how to develop fixes using the Schematron QuickFix (SQF) language. Using SQF, you can provide fix proposals for business rules, thus offering a complete solution while saving time and avoiding the potential for causing other issues.
Schematron solves certain limitations that other types of schema have when validating XML documents since it allows the schema developer to define the errors and control the messages that are presented to the user. Therefore, Schematron makes the validation errors more accessible to users and helps to ensures that they understand the problem. These messages may also include hints to help the user to fix the problem, but this doesn't complete the solution since the user still needs to manually correct the issue. This may cause users to waste valuable time and also creates the possibility of making additional errors while trying to manually fix the reported problem. Schematron Quick Fixes provide automatic actions to fix validation errors, thus offering a complete solution, while saving time and avoiding the potential for causing other issues.
Covered topics:
- Using Schematron to automatically check business rules.
- Fix proposals for business rules using Schematron QuickFix language (SQF).
- How SQF integrates with Schematron.
- Introduction to SQF with examples.
- SQF use-cases (error correction, refactoring, automatic tagging, and more).
Windows Server AppFabric Caching - What it is & when you should use it?Robert MacLean
This is from my Tech-Ed Africa 2010 talk. For more information see: http://www.sadev.co.za/content/teched-africa-2010-slides-scripts-and-demos-my-talks
This session looks at what AppFabric Caching is from start to deep dive.
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"Fwdays
The story is about how and why we decided to separate our frontend from a big python monolith.
Why we decided to separate and why we have used Node.js for server rendering?
What was the migration strategy (rewrite from scratch - was not an option)?
What was the value of GraphQL?
What are the results for developers and business?
REACT.JS : Rethinking UI Development Using JavaScriptDeepu S Nath
Isn't React that clear? Don't you fully understand how/why you should use it on your apps and why it gained all this attention? Do you want to learn the basics and to understand why it's so powerful?
This coffee@DBG will explore how this library works and you will discover and understand its main concepts in details. At the end of this session you'll learn main concepts like Components, Virtual DOM, One-way data binding etc.
Components
JSX
Data for component
The component lifecycle
Component Methods
Component Breakdown
Schematron can be used to identify elements of a document and make assumptions about them, providing a powerful boost when used in conjunction with OpenAI algorithms. Using OpenAI algorithms with Schematron and SQF (Schematron Quick Fix) can help to automate the verification of the correctness, completeness, and accuracy of content.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
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.
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.
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
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.
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, 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.
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.
3. Schematron QuickFixSchematron QuickFix
Fix Proposals
● Using fix proposals to solve errors:
– Better understanding of the problem
– Fewer (no) mistakes
– Saves time (money)
4. Schematron QuickFixSchematron QuickFix
XML Validation Errors
● From the user's perspective the validation error
is composed by three things
LocationLocation
How toHow to
fix it ?fix it ?
MessageMessage
5. Schematron QuickFixSchematron QuickFix
Fixing XML Validation Errors
● Predefined Errors - defined in the validation
engine
– Fixes generated from the validation engine
– Fixes based on the message (error code) and location
● Custom Errors - defined by the user
– Difficult to generate fixes based on message and location
– A language to create fixes is more appropriate
How toHow to
fix it ?fix it ?
6. Schematron QuickFixSchematron QuickFix
Schematron Fix Proposals
● User-defined fixes for Schematron errors
● Schematron QuickFix (SQF) language
– Extends the Schematron language
– SQF initiated by Nico Kutscherauer
www.schematron-quickfix.com
github.com/schematron-quickfix/sqf
8. Schematron QuickFixSchematron QuickFix
SQF Extension of the Schematron
● Associated with assert and report elements
● Added as Schematron annotations
<rule context="html">
<report test="//comment()" sqf:fix="removeComments">
Comments are not allowed in document.</report>
<sqf:fix id="removeComments" role="delete">
<sqf:description>
<sqf:title>Remove all comments</sqf:title>
<sqf:p>Remove all comment nodes from the current document</sqf:p>
</sqf:description>
<sqf:delete match="//comment()"/>
</sqf:fix>
</rule>
9. Schematron QuickFixSchematron QuickFix
Schematron QuickFix (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="text()"/>
</sqf:fix>
Operation
ID
Description
Title
12. Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
● Use the power of Schematron and XSLT
● Create refactoring actions using SQF
13. Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
● Use the power of Schematron and XSLT
● Create refactoring actions using SQF
● Fix problems in external documents
14. Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
● Use the power of Schematron and XSLT
● Create refactoring actions using SQF
● Fix problems in external documents
● Fixes for any XML documents
15. Schematron QuickFixSchematron QuickFix
Language Overview
● Small language
● Keep it easy, but extensible
● No knowledge of XSLT is needed for simple cases
● Integration of well-known standards for more
complex things
16. Schematron QuickFixSchematron QuickFix
Language Overview
● Small language
● Keep it easy, but extensible
● No knowledge of XSLT is needed for simple cases
● Integration of well-known standards for more
complex things
● Own Namespace with prefix sqf:
http://www.schematron-quickfix.com/validator/process
19. Schematron QuickFixSchematron QuickFix
Learning By Examples
● Five examples are shown
● All to find on
https://github.com/octavianN/SQFPresentation/tree/master/Samples
● Additional Examples
http://www.schematron-quickfix.com/examples.html
● Tutorial
http://www.schematron-quickfix.com/quickFix/guide.html
20. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
21. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
22. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
23. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
24. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
25. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
26. Schematron QuickFixSchematron QuickFix
1. Simple Replace
● Replace or unwrap a node
<sch:rule context="b">
<sch:report test="ancestor::b"
sqf:fix="italic unwrap">
Bold in bold is not allowed.</sch:report>
<sqf:fix id="italic">
<sqf:description>
<sqf:title>Change it to italic.</sqf:title>
</sqf:description>
<sqf:replace match="." node-type="element" target="i" select="node()"/>
</sqf:fix>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>Unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"/>
</sqf:fix>
</sch:rule>
27. Schematron QuickFixSchematron QuickFix
2. User Entries
● User Entry – parameter of the QuickFix
<sch:rule context="title">
<sch:assert test="normalize-space(.) != '' " sqf:fix="title"
>A title shouldn't be empty.</sch:assert>
<sqf:fix id="title">
<sqf:description>
<sqf:title>Set a title</sqf:title>
<sqf:p>This QuickFix will set a title by using a User Entry.</sqf:p>
</sqf:description>
<sqf:user-entry name="title" type="xs:string">
<sqf:description>
<sqf:title>Please enter the new title.</sqf:title>
</sqf:description>
</sqf:user-entry>
<sqf:replace target="{name()}" node-type="element"
select="$title" />
</sqf:fix>
</sch:rule>
28. Schematron QuickFixSchematron QuickFix
2. User Entries
● User Entry – parameter of the QuickFix
<sch:rule context="title">
<sch:assert test="normalize-space(.) != '' " sqf:fix="title"
>A title shouldn't be empty.</sch:assert>
<sqf:fix id="title">
<sqf:description>
<sqf:title>Set a title</sqf:title>
<sqf:p>This QuickFix will set a title by using a User Entry.</sqf:p>
</sqf:description>
<sqf:user-entry name="title" type="xs:string">
<sqf:description>
<sqf:title>Please enter the new title.</sqf:title>
</sqf:description>
</sqf:user-entry>
<sqf:replace target="{name()}" node-type="element"
select="$title" />
</sqf:fix>
</sch:rule>
29. Schematron QuickFixSchematron QuickFix
3. QuickFix Conditions
● Conditions – provide a QuickFix only if it makes
sense
<sch:rule context="head/title">
<sch:assert test="string-length(normalize-space(.)) le 20 "
sqf:fix="title">
A title shouldn't have more than 20 characters.</sch:assert>
<sqf:fix id="title" use-when="//h1[1][string-length(.) le 20]">
<sqf:description>
<sqf:title>
Set the title to "<sch:value-of select="//h1[1]"/>".
</sqf:title>
</sqf:description>
<sqf:replace target="title" node-type="element">
<sch:value-of select="//h1[1]"/>
</sqf:replace>
</sqf:fix>
</sch:rule>
30. Schematron QuickFixSchematron QuickFix
3. QuickFix Conditions
● Conditions – provide a QuickFix only if it makes
sense
<sch:rule context="head/title">
<sch:assert test="string-length(normalize-space(.)) le 20 "
sqf:fix="title">
A title shouldn't have more than 20 characters.</sch:assert>
<sqf:fix id="title" use-when="//h1[1][string-length(.) le 20]">
<sqf:description>
<sqf:title>
Set the title to "<sch:value-of select="//h1[1]"/>".
</sqf:title>
</sqf:description>
<sqf:replace target="title" node-type="element">
<sch:value-of select="//h1[1]"/>
</sqf:replace>
</sqf:fix>
</sch:rule>
31. Schematron QuickFixSchematron QuickFix
3. QuickFix Conditions
● Conditions – provide a QuickFix only if it makes
sense
<sch:rule context="head/title">
<sch:assert test="string-length(normalize-space(.)) le 20 "
sqf:fix="title">
A title shouldn't have more than 20 characters.</sch:assert>
<sqf:fix id="title" use-when="//h1[1][string-length(.) le 20]">
<sqf:description>
<sqf:title>
Set the title to "<sch:value-of select="//h1[1]"/>".
</sqf:title>
</sqf:description>
<sqf:replace target="title" node-type="element">
<sch:value-of select="//h1[1]"/>
</sqf:replace>
</sqf:fix>
</sch:rule>
32. Schematron QuickFixSchematron QuickFix
4. Dynamic QuickFixes
● Dynamic QuickFixes – in the future
<sch:rule context="head/title">
<sch:assert test="string-length(normalize-space(.)) le 20 "
sqf:fix="title">
A title shouldn't have more than 20 characters.</sch:assert>
<sqf:fix id="title" use-for-each="//h1[string-length(.) le 20]">
<sqf:description>
<sqf:title>
Set the title to "<sch:value-of select="$sqf:current"/>".
</sqf:title>
</sqf:description>
<sqf:replace target="title" node-type="element">
<sch:value-of select="$sqf:current"/>
</sqf:replace>
</sqf:fix>
</sch:rule>
33. Schematron QuickFixSchematron QuickFix
5. Call QuickFixes
<sqf:fix id="title">
<sqf:call-fix ref="createElementRowAsFirstChild">
<sqf:with-param name="match" select="."/>
<sqf:with-param name="el" select=" 'col' "/>
<sqf:with-param name="count" select="count(max(.//tr/count(td|th)))"/>
</sqf:call-fix>
</sqf:fix>
<sqf:fix id="createElementRowAsFirstChild">
<sqf:param name="match" type="node()*"/>
<sqf:param name="el" type="xs:QName"/>
<sqf:param name="count" type="xs:integer"/>
<sqf:description>
<sqf:title>Create a row of <sch:value-of select="$count"/>
<sch:name path="$el"/> elements as a first child of the
<sch:name path="$match"/> element(s).</sqf:title>
</sqf:description>
<sqf:add match="$match" position="first-child">
<xsl:for-each select="1 to $count">
<xsl:element name="{$el}"/>
</xsl:for-each>
</sqf:add>
</sqf:fix>
34. Schematron QuickFixSchematron QuickFix
Call QuickFixes
● In the first draft:
● Just a prototype
● Not really functional
● Improvements of the second draft:
● Multiple sqf:call-fix in one sqf:fix
● Use the description of the called fix
→ Open discussion
37. Schematron QuickFixSchematron QuickFix
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 producer
38. Schematron QuickFixSchematron QuickFix
Projects using SQF
● Dynamic Information Model (DIM) - an
implementation of an intelligent style guide
● Schematron for TEI - collection of Schematron
and SQF resources for TEI
● <oXygen/> DITA framework - built-in framework
in <oXygen/> XML Editor for DITA documents
● <oXygen/> XML userguide - the public version of
the <oXygen/> User Manual
39. Schematron QuickFixSchematron QuickFix
Conclusions and Future Plans
● SQF is a simple and useful language
● Helps users to solve the problems in less time
and with fewer (no) errors
● Update the SQF specification
● Publish the second draft of the Schematron
QuickFix specification