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
1 answer

Compiling schema to XSLT in Android

My goal is to validate some XML document against Schematron file in Android. At the moment I am trying to use this library for Java. So far, it doesn't seem to be working at all, I simply get empty array as the result of transform. This is piece of…
Jugo
  • 66
  • 8
0
votes
2 answers

Schematron for fetching xml contents along with validation

I need to validate an xml content and also fetch the valid tags and their values. I had known that I Is it possible to use schematron to validate tags and their contents. Can I use schematron itself for fetching all valid tags and their values and…
rbm
  • 1
  • 2
0
votes
2 answers

Is it possible to write this generally? XPATH 2.0

Is it possible to write this test more generally. I´ve sat on it for hours and I can´t figure out :D. Pravidla pro měnu(CZK/USD)
Buteo Mausjäger
  • 123
  • 1
  • 11
0
votes
2 answers

Schematron check for unique values among multiple elements

I need to check that siteId contains unique record id's throughout the document. For example: site 11111 submits record with id 1 & 2 and 3 & 4. site 2222 submits records 3 &…
jorge
  • 1
  • 1
0
votes
1 answer

how to combine these two xsl file

I have a schematron file which has abstract pattern,I want to use a xsl file to tranform this file to a file which does not have abstract pattern,all of abstract patterns are instances. the problem is when I instance the abstract pattern ,if I…
edwin_uestc
  • 169
  • 2
  • 11
0
votes
1 answer

Mandatory and Optional Attributes in Schematron

I need to specify a rule in Schematron where I say that every element must have attributes x and y and all the other attributes it eventually has must be z or w. So let's say I have the following element: This is a wrong…
Daniel
  • 95
  • 8
0
votes
2 answers

Schematron calculation error

I have the following xml file: 31003 516.7 3
ErikL
  • 2,031
  • 6
  • 34
  • 57
0
votes
1 answer

How do I test for special characters using Schematron tests?

I am trying to set up a schematron test for validating special characters in XML... More specifically, I would like to throw a warning where there is an occurrence of the copyright symbol (Unicode U+00A9). It seems that schematron xml files cannot…
Michael K
  • 439
  • 3
  • 13
0
votes
1 answer

Count number of attributes with schematron

i am trying to check the existence of an attribute with Schematron.
Patrick
  • 6,537
  • 1
  • 13
  • 7
0
votes
1 answer

Unexpected behaviour in Schematron checks

i have the following checks No typeElement with someAttribute=type1 found
Dennis Ich
  • 3,585
  • 6
  • 27
  • 44
-1
votes
1 answer

Does XmlPrime support .net core?

While porting a solution from .net framework 4.6 to .net core. I am stuck with xml validation using schematron part and I am using xmlPrime for that, Seems like xmlprime does not support .net core. Any suggestion.
Ihtsham Minhas
  • 1,415
  • 1
  • 19
  • 31
-1
votes
3 answers

Is there any XQuery code out there to translate an XPath expression to something business people can understand?

I am working on an XQuery script that takes the context of the Schematron rule and the body of the assert to generate a report as an excel spreadsheet. It is so that what the Schematron validates actually meets the business requirements. Does…
Loren Cahlander
  • 1,257
  • 1
  • 10
  • 24
-1
votes
1 answer

Meta language to generate Schematron

I am considering writing a piece of code (script if possible). To convert a human readable specification (DICOM) into a machine parsable validation. The DICOM standard uses DocBook (XML) to define relationship for its elements and attributes, for…
malat
  • 12,152
  • 13
  • 89
  • 158
-1
votes
2 answers

Validating XML against Schematron in browsers

Internet browsers support validating XML against XSD, but do there exist any plugins that can augment these capabilities to include Schematron or RELAX NG? I'm looking for one that works with Internet Explorer.
Melab
  • 2,594
  • 7
  • 30
  • 51
-2
votes
1 answer

Creating a schematron to flag latinisms (etc, i.e, e.g) but its also flagging words with those letters in them

I have a schematron created to flag latinisms in a topic. It works a little too well. It's also flagging words that have that combination of letters in them. For example, it needs to flag "etc" but it is also flagging "ketchup" because ketchup has…
google
  • 13
  • 3
1 2 3
16
17