Questions tagged [schematron]

Schematron is a structural, rule-based validation language for XML documents. It uses XPath and XSLT to validate rules most other schemas can not.

Schematron is a rule-based validation language for XML documents. Schematron allows one to model complex relationships in XML content and to formulate rules that most other schema languages do not support. Schematron is not often used alone but is usually used along with another schema language. In this case, the other language is used to validate the grammar of the XML model and schematron is used to validate business rules.

One of its most powerful mechanisms is sch:assertion, that allows the author of the schema to assert arbitrary XPath expressions and report any content where this assertion failed. To date, XML Schema 1.1 is the only other schema language that supports assertions (while DTD, XML Schema 1.0 and RNG do not).

Although implementations exist that work directly with schematron schemas, the canonical model is to first transform the schema into an style sheet using stylesheets available at the schematron home page which can then be used to validate the input document by transforming it into Schematron Validation Report Language (SVRL), a language used for reporting the results of a schematron validation. Many of the implementations that work directly with schematron follow this canonical model internally.

An additional and highly positive feature of schematron is that the schema writer is free to write their own validation messages. This allows schematron to generate very clear explanatory error messages, a feature missing from other schema languages.

It was invented by Rick Jelliffe and is an ISO Standard. In addition to the main language, the same ISO standard defines the SVRL language used for reporting results of validations.

For a more thorough introduction to Schematron Erik Siegel's book "Schematron: A language for validating XML" might help.

255 questions
0
votes
2 answers

how to carry out XML Validation based on Attribute value

Facing issues with XML validation. My XML data look like this
0
votes
0 answers

Saxon-HE returns different SVRL results .Net

I am getting different SVRL result when I use to stream with dummy URI it doesn't return the correct SVRL and if I provide actual URI it return correct SVRL in Saxon 9.8.3 version. Processor processor = new Processor(); // Load the source…
0
votes
1 answer

Validating xml file against schematron (.sch) in .Net (Saxon)

I need to validate an XML file against Schematron (.sch file). I read that Saxon can do it. How can I use Schematron file directly as all the sample uses XSLT, not the Schematron file?
0
votes
1 answer

How to evaluate SOAP response using Schematron?

I have a SOAP response below
Satyam
  • 645
  • 2
  • 7
  • 20
0
votes
1 answer

C# .Net Xml Schematron Validation

I have a set of XMLs along with XSD/Schematron documents for validation. I had to validate my XMLs against XSD (for data types/structure/schema validation) and this is straightforward. The challenging part is Schematron validation which is a…
Ahmet
  • 1,045
  • 13
  • 28
0
votes
1 answer

OGC Filter Specification in Xpath

I've got some XML documents which conform to a known schema which include geometries in GML format. I'm looking to perform validation on the XML using XSD and Schematron validation, but I'll need some way of performing spatial queries within the…
GHC
  • 2,658
  • 5
  • 30
  • 35
0
votes
0 answers

Cannot define a key in Schematron

FFM Marketplace…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xslt" class="post-tag grid--cell" title="show questions tagged 'xslt'" rel="tag">xslt</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Sep 28 '17 at 17:12">asked Sep 28 '17 at 17:12</time> <a href="../../users/1461707/ihe-onwuka" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1461707.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Ihe Onwuka" /> </a> <div class="s-user-card--info"> <a href="../../users/1461707/ihe-onwuka" class="s-user-card--link">Ihe Onwuka</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">467</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="3 silver badge">3</li> <li class="s-award-bling s-award-bling__bronze" title="11 bronze badge">11</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-46050228"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/46050228/check-for-duplicated-data-with-multiple-attribute-in-sibling-elements-schematr" class="question-hyperlink">Check for duplicated data with multiple attribute in sibling elements - Schematron</a></h3> <div class="excerpt">As described in the title, I want to find a way to check duplicated attribute data in XML sibling elements. I already know the similar question [here] Check for duplicated attribute data in sibling elements - Schematron ,and i've tried through it,…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/validation" class="post-tag grid--cell" title="show questions tagged 'validation'" rel="tag">validation</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Sep 05 '17 at 08:23">asked Sep 05 '17 at 08:23</time> <a href="../../users/6691209/wang-ying-jun" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/6691209.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="王英俊" /> </a> <div class="s-user-card--info"> <a href="../../users/6691209/wang-ying-jun" class="s-user-card--link">王英俊</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">11</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-44331935"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/44331935/include-schema-validation-xsd-in-schematron-validation-sch-not-the-other-way-a" class="question-hyperlink">Include Schema validation (.xsd) in Schematron validation (.sch) [not the other way around]</a></h3> <div class="excerpt">Since it is easier and less verbose to enforce data structure in an XSD file than it is in a Schematron and since we already have working XSD files to validate single entities, I would like to include these as a first validation phase in my…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xsd" class="post-tag grid--cell" title="show questions tagged 'xsd'" rel="tag">xsd</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> <a href="../../questions/tagged/oxygenxml" class="post-tag grid--cell" title="show questions tagged 'oxygenxml'" rel="tag">oxygenxml</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 02 '17 at 15:00">asked Jun 02 '17 at 15:00</time> <a href="../../users/2620046/karmaedv" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2620046.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="KarmaEDV" /> </a> <div class="s-user-card--info"> <a href="../../users/2620046/karmaedv" class="s-user-card--link">KarmaEDV</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,631</li> <li class="s-award-bling s-award-bling__silver" title="16 silver badges">16</li> <li class="s-award-bling s-award-bling__bronze" title="27 bronze badges">27</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-44027644"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/44027644/validate-webservice-message-against-schematron" class="question-hyperlink">Validate WebService message against Schematron</a></h3> <div class="excerpt">I have generated a web service client using JAX-WS and wsimport. This is my client code: URL url = new URL("http://localhost:9999/ws/processstuff?wsdl"); QName qname = new QName("namespace", "ProcessStuffImplService"); Service service =…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/java" class="post-tag grid--cell" title="show questions tagged 'java'" rel="tag">java</a> <a href="../../questions/tagged/web-services" class="post-tag grid--cell" title="show questions tagged 'web-services'" rel="tag">web-services</a> <a href="../../questions/tagged/validation" class="post-tag grid--cell" title="show questions tagged 'validation'" rel="tag">validation</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked May 17 '17 at 14:26">asked May 17 '17 at 14:26</time> <a href="../../users/1766169/user1766169" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1766169.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user1766169" /> </a> <div class="s-user-card--info"> <a href="../../users/1766169/user1766169" class="s-user-card--link">user1766169</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,932</li> <li class="s-award-bling s-award-bling__gold" title="3 gold badges">3</li> <li class="s-award-bling s-award-bling__silver" title="22 silver badges">22</li> <li class="s-award-bling s-award-bling__bronze" title="44 bronze badges">44</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-43487411"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/43487411/schematron-net-structured-error-reporting" class="question-hyperlink">Schematron.net structured error reporting</a></h3> <div class="excerpt">I am using the Schematron.net nuget package and I want to know if it's possible to get the output of a call to Validate to give the results in a structured format that I can then process. My existing solution relies on a try catch block and the…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/c#" class="post-tag grid--cell" title="show questions tagged 'c#'" rel="tag">c#</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 19 '17 at 05:49">asked Apr 19 '17 at 05:49</time> <a href="../../users/1877752/greg-the-incredulous" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1877752.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Greg the Incredulous" /> </a> <div class="s-user-card--info"> <a href="../../users/1877752/greg-the-incredulous" class="s-user-card--link">Greg the Incredulous</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,676</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="29 silver badges">29</li> <li class="s-award-bling s-award-bling__bronze" title="42 bronze badges">42</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-43486209"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/43486209/how-do-i-get-schematron-net-to-trigger-diagnostic" class="question-hyperlink">How do I get Schematron.net to trigger diagnostic?</a></h3> <div class="excerpt">I am using the Schematron.net nuget package to validate some XML but I can't figure out how to use the diagnostic tag correctly. I have the following XML: <bk:books xmlns:bk="http://www.example.com/books"> <bk:book publisher="QUE"> …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/c#" class="post-tag grid--cell" title="show questions tagged 'c#'" rel="tag">c#</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 19 '17 at 04:11">asked Apr 19 '17 at 04:11</time> <a href="../../users/1877752/greg-the-incredulous" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1877752.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Greg the Incredulous" /> </a> <div class="s-user-card--info"> <a href="../../users/1877752/greg-the-incredulous" class="s-user-card--link">Greg the Incredulous</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,676</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="29 silver badges">29</li> <li class="s-award-bling s-award-bling__bronze" title="42 bronze badges">42</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-41808903"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/41808903/how-to-get-the-number-of-elements-in-xpath" class="question-hyperlink">How to get the number of elements in XPath</a></h3> <div class="excerpt">I have started with Schematron and XPath. In Schematron document I to provide context for validating m business rule so I am providing section/body/p. As I have provided p tag in context then How can I query to count total no of p tags? This is…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xpath" class="post-tag grid--cell" title="show questions tagged 'xpath'" rel="tag">xpath</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jan 23 '17 at 14:40">asked Jan 23 '17 at 14:40</time> <a href="../../users/2172547/sunil-garg" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2172547.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Sunil Garg" /> </a> <div class="s-user-card--info"> <a href="../../users/2172547/sunil-garg" class="s-user-card--link">Sunil Garg</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">14,608</li> <li class="s-award-bling s-award-bling__gold" title="25 gold badges">25</li> <li class="s-award-bling s-award-bling__silver" title="132 silver badges">132</li> <li class="s-award-bling s-award-bling__bronze" title="189 bronze badges">189</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-41342301"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/41342301/sxxp0003-error-reported-by-xml-parser-content-is-not-allowed-in-prolog-in-sche" class="question-hyperlink">SXXP0003: Error reported by XML parser: Content is not allowed in prolog in schematron xml</a></h3> <div class="excerpt">I am trying to run probatron4j. Here is the source project https://code.google.com/archive/p/probatron4j/downloads I build this project using ant and I got probatron.jar in dist folder. But when I try to verify my XML against Schematron schema this…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/java" class="post-tag grid--cell" title="show questions tagged 'java'" rel="tag">java</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 27 '16 at 09:19">asked Dec 27 '16 at 09:19</time> <a href="../../users/2172547/sunil-garg" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2172547.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Sunil Garg" /> </a> <div class="s-user-card--info"> <a href="../../users/2172547/sunil-garg" class="s-user-card--link">Sunil Garg</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">14,608</li> <li class="s-award-bling s-award-bling__gold" title="25 gold badges">25</li> <li class="s-award-bling s-award-bling__silver" title="132 silver badges">132</li> <li class="s-award-bling s-award-bling__bronze" title="189 bronze badges">189</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-40358136"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/40358136/is-it-possible-to-get-value-of-select-xpath-here-values-from-a-schematron-asse" class="question-hyperlink">Is it possible to get <value-of select=''xpath here''> values from a schematron assert with libxml2 C API?</a></h3> <div class="excerpt">Note: I'm a beginner with these technologies. I made a a.sch (schematron file) and b.xml which I'm validating with libxml2 C API. Everything is working good except that I don't see the values of <value-of select=''xpath here''> in my assert…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/c" class="post-tag grid--cell" title="show questions tagged 'c'" rel="tag">c</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xpath" class="post-tag grid--cell" title="show questions tagged 'xpath'" rel="tag">xpath</a> <a href="../../questions/tagged/libxml2" class="post-tag grid--cell" title="show questions tagged 'libxml2'" rel="tag">libxml2</a> <a href="../../questions/tagged/schematron" class="post-tag grid--cell" title="show questions tagged 'schematron'" rel="tag">schematron</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 01 '16 at 10:22">asked Nov 01 '16 at 10:22</time> <a href="../../users/7096812/michel-gauvin" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/7096812.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Michel Gauvin" /> </a> <div class="s-user-card--info"> <a href="../../users/7096812/michel-gauvin" class="s-user-card--link">Michel Gauvin</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=13" rel="prev" title="Go to page 13">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=16" rel="" title="Go to page 16">16</a> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=17" rel="" title="Go to page 17">17</a> <a class="s-pagination--item" href="../../questions/tagged/schematron_page=15" rel="next" title="Go to page 15"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>