schematron

Finding all XPaths in a XQuery using Saxon-HE with C#

 ̄綄美尐妖づ 提交于 2020-12-07 04:57:26
问题 Situational Background: XSD with SCH XML Schema (XSD) I have an XML schema definition ("the schema") that includes several other XSDs, all in the same namespace. Some of those import other XSDs from foreign namespaces. All in all, the schema declares several global elements that can be instantiated as XML documents. Let's call them Global_1 , Global_2 and Global_3 . Business Rules (SCH) The schema is augmented by a Schematron file that defines the "business rules". It defines a number of

Caching file content inside ExecuteScript processor of Apache NiFi

旧城冷巷雨未停 提交于 2020-01-25 07:06:55
问题 I have an ExecuteScript processor that does an XML flow file validation against schematron. I'd like the content of the schematron file to be cached somewhere rather than read from the disk for every flow file again and again. What is the best option for doing this? Do I need yet another script that puts the content of the schematron into context.stateManager or PutDistributedMapCache or what? 回答1: I was about to answer NO but it seems that it is possible . You are able to cache variables

Identify xml text elements with Schematron

吃可爱长大的小学妹 提交于 2020-01-03 03:24:32
问题 Is it possible to make a rule in XPath which identifies xml elements like this one: <A>something...<A> ? I am using Schematron and I need to specify that some elements must not have children like the one in the example, that's why I need to identify them. Thanks in advance 回答1: For the following input: <?xml version="1.0" encoding="utf-8"?> <root> <a>Only Text</a> <a><b>Child node</b></a> <a><b>Child node</b>Mixed content</a> </root> These Schematron rules should do what you want: <?xml

Validating XSD Schema with Schematron and xsltproc

痞子三分冷 提交于 2020-01-02 09:55:36
问题 I'm having difficulty validating an SXD schema combined with Schematron. Following the steps described in this guide I've incorporated schematron between the <xs:appinfo> tags in an XSD document as follows: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Test"> <xs:annotation> <xs:appinfo> <sch:pattern name="Testing schematron" xmlns:sch="http://purl.oclc.org/dsdl/schematron"> <sch:rule context="Test"> <sch:assert test="

command line validator supporting relax ng Schemas with embedded iso Schematron

青春壹個敷衍的年華 提交于 2019-12-31 03:08:08
问题 Are there any command line-validators that can cope with relax ng-Schemas with embedded iso schematron? I've got a couple of relax ng-schemas with embedded iso-schematron rules which I have to be able to validate on the command line. As it seems, jing, our usual validator, only works with schematron 1.5. Surfing the web, I haven't been able to find any validator supporting embedded iso schematron but I use oXygen as an xml editor and I can validate just fine from there. 回答1: You can use Jing,

Saxon produces empty XML from Schematron

社会主义新天地 提交于 2019-12-25 03:08:37
问题 I am trying to compile Schematron file through the XSLT file (iso_svrl_for_xslt2.xsl) with help of Saxon9HE as described here and there. Here I am calling Saxon with 3 arguments: -o:schema-compiled.xsl is the output file (XSLT script) -s:example_schematron.xsl is the source file iso-schematron-xslt2/iso_svrl_for_xslt2.xsl is the stylesheet file, used to compile schematron file into XSLT script java -jar saxon9he.jar -o:schema-compiled.xsl -s:example_schematron.sch iso-schematron-xslt2/iso

Check for duplicated attribute data in sibling elements - Schematron

旧时模样 提交于 2019-12-25 01:55:35
问题 I'm trying to write a check in Schematron that will ensure no elements contain duplicated attribute data. These elements are at a specific location in the XML document, I have the XPATH that locates them. For example: should fail because it has duplicate foo and bar attribute values. <id foo="test1" bar="abc" /> <id foo="test1" bar="abc" /> This should pass as the foo attributes are not the same. <id foo="test1" bar="abc" /> <id foo="test2" bar="abc" /> I'm not sure if this is too complicated

How do I return Schematron validation results in a structured manner

牧云@^-^@ 提交于 2019-12-19 09:24:09
问题 I have created several Schematron assertations and they are all running fine against my XML instances. However, I would like to structure the output of my error messages in such a way, that I later can post-process them, with e.g., Java. The output of my assertion error message should be <error> <errorMessage>My error message</errorMessage> <violatingElement>The violating element</violatingElement> </error> However, a construct such as: <pattern> <rule context="/p1:Document/p1:Delivery/p1

Schematron validation with lxml in Python: how to retrieve validation errors?

拥有回忆 提交于 2019-12-12 10:56:52
问题 I'm trying to do some Schematron validation with lxml. For the specific application I'm working at, it's important that any tests that failed the validation are reported back. The lxml documentation mentions the presence of the validation_report property object. I think this should contain the info I'm looking for, but I just can't figure out how work with it. Here's some example code that demonstrates my problem (adapted from http://lxml.de/validation.html#id2; tested with Python 2.7.4):

Generate HTML form from Schematron

廉价感情. 提交于 2019-12-12 10:06:02
问题 is it possible to generate HTML form from a Schematron? I have a bunch of schemas described in Schematron files. I have to create HTML forms which allow to input data which will be transformed into an XML documents compatible with Schematrons. Instead of a manual development of forms I would like to generate them in any way. Is it possible? Do you know tools for this? I found similar tools for generating HTML forms from XSD, for example https://github.com/davidmoten/xsd-forms . 回答1: Very