SlideShare a Scribd company logo
1 of 40
Download to read offline
Schematron QuickFix
Nico Kutscherauer
contact@schematron-quickfix.com
@nkutsche
Octavian Nadolu
octavian_nadolu@oxygenxml.com
@OctavianNadolu
Schematron QuickFixSchematron QuickFix
Error Fixes
● Fixing errors has always been a challenge
● Solutions offered by IDEs
Schematron QuickFixSchematron QuickFix
Fix Proposals
● Using fix proposals to solve errors:
– Better understanding of the problem
– Fewer (no) mistakes
– Saves time (money)
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
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 ?
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
Schematron QuickFixSchematron QuickFix
Schematron Quick Fixes Spec
www.w3.org/community/quickfix
schematron-quickfix.github.io/sqf
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>
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
Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
● Use the power of Schematron and XSLT
Schematron QuickFixSchematron QuickFix
SQF Benefits
● Create custom quick fixes for errors
● Use the power of Schematron and XSLT
● Create refactoring actions using SQF
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
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
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
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
Schematron QuickFixSchematron QuickFix
Language Structure
● Reference / structure
● User interface
● Activity Elements (operations)
Schematron QuickFixSchematron QuickFix
Language Structure
● Reference / structure
● User interface
● Activity Elements (operations)
● Generic features
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
Schematron QuickFixSchematron QuickFix
Review
● Structure / Reference
● sqf:fix, @id, @use-when, @sqf:fix, sqf:group, sqf:fixes
● Description
● sqf:description, sqf:title, sqf:p
● Activity
● sqf:delete, sqf:replace, sqf:add, sqf:keep, sqf:stringReplace
● Generic
● sqf:call-fix, sqf:with-param, sqf:param, sqf:user-entry,
@use-for-each
→ Only 15 Elements (XSLT 2: 49, Schematron: 21)
Schematron QuickFixSchematron QuickFix
SQF Implementations
● <oXygen/> XML Editor validation engine
http://www.oxygenxml.com
● Escali Schematron engine
http://schematron-quickfix.com/escali_xsm.html
– Escali Schematron command line tool
– Oxygen plugin for invoking Escali Schematron
Schematron 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
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
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
Schematron QuickFixSchematron QuickFix
Thank you!
Questions?
contact@schematron-quickfix.com
@nkutsche
octavian_nadolu@oxygenxml.com
@OctavianNadolu

More Related Content

What's hot (10)

JChem Microservices
JChem MicroservicesJChem Microservices
JChem Microservices
 
Sql plsql online training
Sql plsql online trainingSql plsql online training
Sql plsql online training
 
Gatling overview
Gatling overviewGatling overview
Gatling overview
 
Module Owb External Execution
Module Owb External ExecutionModule Owb External Execution
Module Owb External Execution
 
Gatling Performance Workshop
Gatling Performance WorkshopGatling Performance Workshop
Gatling Performance Workshop
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara Anjargolian
 
Plsql commons
Plsql commons Plsql commons
Plsql commons
 
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
Javantura v4 - Java and lambdas and streams - are they better than for loops ...Javantura v4 - Java and lambdas and streams - are they better than for loops ...
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
 
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
 

Similar to Schematron QuickFix

Schematron 2016 and SQF Update
Schematron 2016 and SQF Update Schematron 2016 and SQF Update
Schematron 2016 and SQF Update Octavian Nadolu
 
The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019Octavian Nadolu
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=HibernateJay Shah
 
Enforcing Business Rules - Automatic Fixes
Enforcing Business Rules - Automatic FixesEnforcing Business Rules - Automatic Fixes
Enforcing Business Rules - Automatic FixesOctavian Nadolu
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-HibernateJay Shah
 
Jboss World 2011 Infinispan
Jboss World 2011 InfinispanJboss World 2011 Infinispan
Jboss World 2011 Infinispancbo_
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagySkills Matter
 
Tuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on MobicentsTuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on MobicentsJean Deruelle
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Robert MacLean
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java DevelopersYakov Fain
 
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"Fwdays
 
REACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScriptREACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScriptDeepu S Nath
 
Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solrlucenerevolution
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxbobmcwhirter
 
Angular 2 at solutions.hamburg
Angular 2 at solutions.hamburgAngular 2 at solutions.hamburg
Angular 2 at solutions.hamburgBaqend
 
Fast federated SQL with Apache Calcite
Fast federated SQL with Apache CalciteFast federated SQL with Apache Calcite
Fast federated SQL with Apache CalciteChris Baynes
 
SamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentationSamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentationYi Pan
 

Similar to Schematron QuickFix (20)

XML Quick Fixes
XML Quick FixesXML Quick Fixes
XML Quick Fixes
 
Schematron 2016 and SQF Update
Schematron 2016 and SQF Update Schematron 2016 and SQF Update
Schematron 2016 and SQF Update
 
The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019The Power Of Schematron Quick Fixes - XML Prague 2019
The Power Of Schematron Quick Fixes - XML Prague 2019
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
 
Varnish - PLNOG 4
Varnish - PLNOG 4Varnish - PLNOG 4
Varnish - PLNOG 4
 
Enforcing Business Rules - Automatic Fixes
Enforcing Business Rules - Automatic FixesEnforcing Business Rules - Automatic Fixes
Enforcing Business Rules - Automatic Fixes
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-Hibernate
 
Jboss World 2011 Infinispan
Jboss World 2011 InfinispanJboss World 2011 Infinispan
Jboss World 2011 Infinispan
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
 
Tuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on MobicentsTuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on Mobicents
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
 
REACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScriptREACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScript
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solr
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBox
 
Angular 2 at solutions.hamburg
Angular 2 at solutions.hamburgAngular 2 at solutions.hamburg
Angular 2 at solutions.hamburg
 
Fast federated SQL with Apache Calcite
Fast federated SQL with Apache CalciteFast federated SQL with Apache Calcite
Fast federated SQL with Apache Calcite
 
SamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentationSamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentation
 

More from Octavian Nadolu

YAML Editing and Validation In Oxygen
YAML Editing and Validation In OxygenYAML Editing and Validation In Oxygen
YAML Editing and Validation In OxygenOctavian Nadolu
 
Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...Octavian Nadolu
 
OpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in OxygenOpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in OxygenOctavian Nadolu
 
Validating XML and JSON Documents Using Oxygen Scripting
 Validating XML and JSON Documents Using Oxygen Scripting Validating XML and JSON Documents Using Oxygen Scripting
Validating XML and JSON Documents Using Oxygen ScriptingOctavian Nadolu
 
OpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and DocumentingOpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and DocumentingOctavian Nadolu
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIOctavian Nadolu
 
Create an Design JSON Schema
Create an Design JSON SchemaCreate an Design JSON Schema
Create an Design JSON SchemaOctavian Nadolu
 
Compare And Merge Scripts
Compare And Merge ScriptsCompare And Merge Scripts
Compare And Merge ScriptsOctavian Nadolu
 
Schematron For Non-XML Languages
Schematron For Non-XML LanguagesSchematron For Non-XML Languages
Schematron For Non-XML LanguagesOctavian Nadolu
 
JSON and JSON Schema in Oxygen
JSON and JSON Schema in OxygenJSON and JSON Schema in Oxygen
JSON and JSON Schema in OxygenOctavian Nadolu
 
HTML5 Editing Validation
HTML5 Editing ValidationHTML5 Editing Validation
HTML5 Editing ValidationOctavian Nadolu
 
Documentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO SchematronDocumentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO SchematronOctavian Nadolu
 
Introduction to Schematron
Introduction to SchematronIntroduction to Schematron
Introduction to SchematronOctavian Nadolu
 
JSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and ConvertJSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and ConvertOctavian Nadolu
 
Collaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation ProcessCollaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation ProcessOctavian Nadolu
 
Exploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - DevelopmentExploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - DevelopmentOctavian Nadolu
 

More from Octavian Nadolu (20)

YAML Editing and Validation In Oxygen
YAML Editing and Validation In OxygenYAML Editing and Validation In Oxygen
YAML Editing and Validation In Oxygen
 
Oxygen JSON Editor
Oxygen JSON EditorOxygen JSON Editor
Oxygen JSON Editor
 
Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...Leveraging the Power of AI and Schematron for Content Verification and Correc...
Leveraging the Power of AI and Schematron for Content Verification and Correc...
 
OpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in OxygenOpenAPI/AsyncAPI Support in Oxygen
OpenAPI/AsyncAPI Support in Oxygen
 
Validating XML and JSON Documents Using Oxygen Scripting
 Validating XML and JSON Documents Using Oxygen Scripting Validating XML and JSON Documents Using Oxygen Scripting
Validating XML and JSON Documents Using Oxygen Scripting
 
OpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and DocumentingOpenAPI Editing, Testing, and Documenting
OpenAPI Editing, Testing, and Documenting
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPI
 
Create an Design JSON Schema
Create an Design JSON SchemaCreate an Design JSON Schema
Create an Design JSON Schema
 
Compare And Merge Scripts
Compare And Merge ScriptsCompare And Merge Scripts
Compare And Merge Scripts
 
JSON Schema Design
JSON Schema DesignJSON Schema Design
JSON Schema Design
 
Schematron For Non-XML Languages
Schematron For Non-XML LanguagesSchematron For Non-XML Languages
Schematron For Non-XML Languages
 
JSON and JSON Schema in Oxygen
JSON and JSON Schema in OxygenJSON and JSON Schema in Oxygen
JSON and JSON Schema in Oxygen
 
HTML5 Editing Validation
HTML5 Editing ValidationHTML5 Editing Validation
HTML5 Editing Validation
 
Documentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO SchematronDocumentation Quality Assurance with ISO Schematron
Documentation Quality Assurance with ISO Schematron
 
Introduction to Schematron
Introduction to SchematronIntroduction to Schematron
Introduction to Schematron
 
Hands on JSON
Hands on JSONHands on JSON
Hands on JSON
 
JSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and ConvertJSON Edit, Validate, Query, Transform, and Convert
JSON Edit, Validate, Query, Transform, and Convert
 
Collaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation ProcessCollaboration Tools to Help Improve Documentation Process
Collaboration Tools to Help Improve Documentation Process
 
Schematron step-by-step
Schematron step-by-stepSchematron step-by-step
Schematron step-by-step
 
Exploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - DevelopmentExploring the new features in Oxygen XML Editor 20 - Development
Exploring the new features in Oxygen XML Editor 20 - Development
 

Recently uploaded

The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerkumenegertelayegrama
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...university
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxAsifArshad8
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxRoquia Salam
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SESaleh Ibne Omar
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 

Recently uploaded (19)

The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeeger
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptx
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SE
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 

Schematron QuickFix

  • 2. Schematron QuickFixSchematron QuickFix Error Fixes ● Fixing errors has always been a challenge ● Solutions offered by IDEs
  • 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
  • 7. Schematron QuickFixSchematron QuickFix Schematron Quick Fixes Spec www.w3.org/community/quickfix schematron-quickfix.github.io/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
  • 10. Schematron QuickFixSchematron QuickFix SQF Benefits ● Create custom quick fixes for errors
  • 11. Schematron QuickFixSchematron QuickFix SQF Benefits ● Create custom quick fixes for errors ● Use the power of Schematron and XSLT
  • 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
  • 17. Schematron QuickFixSchematron QuickFix Language Structure ● Reference / structure ● User interface ● Activity Elements (operations)
  • 18. Schematron QuickFixSchematron QuickFix Language Structure ● Reference / structure ● User interface ● Activity Elements (operations) ● Generic features
  • 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
  • 35. Schematron QuickFixSchematron QuickFix Review ● Structure / Reference ● sqf:fix, @id, @use-when, @sqf:fix, sqf:group, sqf:fixes ● Description ● sqf:description, sqf:title, sqf:p ● Activity ● sqf:delete, sqf:replace, sqf:add, sqf:keep, sqf:stringReplace ● Generic ● sqf:call-fix, sqf:with-param, sqf:param, sqf:user-entry, @use-for-each → Only 15 Elements (XSLT 2: 49, Schematron: 21)
  • 36. Schematron QuickFixSchematron QuickFix 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
  • 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
  • 40. Schematron QuickFixSchematron QuickFix Thank you! Questions? contact@schematron-quickfix.com @nkutsche octavian_nadolu@oxygenxml.com @OctavianNadolu