schematron

Validate XML with Schematron in PHP 5

与世无争的帅哥 提交于 2019-12-04 16:27:17
I have a problem with validating XML with schematron . In my code I load the XML and XSL as DOMDocument objects and I try to transform: $domSche = new DOMDocument(); $domSche->loadXML($message); $domXSLSche = new DOMDocument(); $domXSLSche->load("CI-SIS_StructurationCommuneCDAr2.xsl"); $xsltsche = new XSLTProcessor(); $xsltsche->importStylesheet($domXSLSche); $XSLValid = $xsltsche->transformToXml($domSche); But the function returns this error: XSLTProcessor::transformToXml(): No stylesheet associated to this object I don't understand, technically, the importStylesheet associates my XSL to the

Using SAXON 9.5 (nuget) with Schematron

坚强是说给别人听的谎言 提交于 2019-12-04 14:35:14
I am running this code: string path = AppDomain.CurrentDomain.BaseDirectory; // Uri schemaUri = new Uri(@"file:\\" + path + @"\sch\patient.sch"); Uri totransformEE = new Uri(@"file:\\" + path + @"\po\po-schema.sch"); Uri transformER = new Uri(@"file:\\" + path + @"\xsl\conformance1-5.xsl"); /////////////////////////////// // Crate Schemtron xslt to be applied /////////////////////////////// // Create a Processor instance. Processor processor = new Processor(); // Load the source document XdmNode input = processor.NewDocumentBuilder().Build(totransformEE); // Create a transformer for the

How can I validate documents against Schematron schemas in Java?

一个人想着一个人 提交于 2019-12-04 11:47:09
问题 As far as I can tell, JAXP by default supports W3C XML Schema and RelaxNG from Java 6. I can see a few APIs, mostly experimental or incomplete, on the schematron.com links page. Is there an approach on validating schematron in Java that's complete, efficient and can be used with the JAXP API? 回答1: Jing supports pre-ISO Schematron validation (note that Jing's implementation is based also on XSLT). There are also XSLT implementations that can be very easily invoked from Java. You need to decide

How can I validate documents against Schematron schemas in Java?

别等时光非礼了梦想. 提交于 2019-12-03 08:13:37
As far as I can tell, JAXP by default supports W3C XML Schema and RelaxNG from Java 6 . I can see a few APIs, mostly experimental or incomplete, on the schematron.com links page . Is there an approach on validating schematron in Java that's complete, efficient and can be used with the JAXP API? Jing supports pre-ISO Schematron validation (note that Jing's implementation is based also on XSLT). There are also XSLT implementations that can be very easily invoked from Java. You need to decide what version of Schematron you are interested in and then get the corresponding stylesheet - all of them

command line validator supporting relax ng Schemas with embedded iso Schematron

∥☆過路亽.° 提交于 2019-12-02 02:57:12
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. Rintze Zelle You can use Jing, as long as you first extract the Schematron rules, and then run a separate validation against

How to check in xPath if a type is equal to a type or derived from the type

佐手、 提交于 2019-12-02 01:45:30
问题 I'm working with xPath inside Schematron. I'm able to check that a type is equal to a target type. For example 'xsd:string eq xsd:string'. <sch:rule context="uis:variable/uis:dependency/uis:length"> <sch:assert test="**../../@type eq 'xsd:string'**"> Text </sch:assert> </sch:rule> How can I check if a type defined by the user, which has been derived from xsd:string? I've tried: <sch:rule context="uis:variable/uis:dependency/uis:length"> <sch:assert test="**../../@type instance of attribute (*

Validating XML with Schematron

这一生的挚爱 提交于 2019-12-01 10:45:24
I am trying to validate an XML file with Schematron, which is more complicated than XSD. I googled a lot and the best thing that came up is this Microsoft website . But that only shows how to validate with XSD with NMatrix.Schematron which is not what I need. I have the NMatrix.Schematron DLLs but I dont know how to use them. Does anyone know how to use it? I recommend that you instead use Rick Jelliffe's reference implementation of ISO Schematron using pure XSLT, preferably XSLT 2.0, with an established XSLT processor such as Michael Kay's Saxon . It would be better to use Saxon-HE from Nuget

How do I return Schematron validation results in a structured manner

橙三吉。 提交于 2019-12-01 09:42:04
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:DeliveryDetails/p1:ShippingDate"> <report test="."> <error> <errorMessage>My error message</errorMessage>

Validating XML with Schematron

送分小仙女□ 提交于 2019-12-01 08:42:22
问题 I am trying to validate an XML file with Schematron, which is more complicated than XSD. I googled a lot and the best thing that came up is this Microsoft website. But that only shows how to validate with XSD with NMatrix.Schematron which is not what I need. I have the NMatrix.Schematron DLLs but I dont know how to use them. Does anyone know how to use it? 回答1: I recommend that you instead use Rick Jelliffe's reference implementation of ISO Schematron using pure XSLT, preferably XSLT 2.0,

XML validation with Schematron/XSD in C#

纵饮孤独 提交于 2019-12-01 03:04:53
I've been looking around for at a way to make some more advanced business rule validation of XML documents. So far Schematron seems to be able to do, what I need. I've been looking around, and the few libraries I've found was very old and seemingly not supported any longer. Was Schematron only "hot" in 2002? Are there any libraries that can do the validation in C# - or how do I do it? Or are there others that can do the advanced validation and have C# libraries and are standardized? For what it's worth, this has been my experience... I've had moments where I wish schemas could do more along