{"id":403,"date":"2008-12-09T14:58:40","date_gmt":"2008-12-09T21:58:40","guid":{"rendered":"https:\/\/dubinko.info\/blog\/?p=403"},"modified":"2008-12-09T14:58:40","modified_gmt":"2008-12-09T21:58:40","slug":"xml-2008-liveblog-introduction-to-schematron","status":"publish","type":"post","link":"https:\/\/dubinko.info\/blog\/2008\/12\/xml-2008-liveblog-introduction-to-schematron\/","title":{"rendered":"XML 2008 liveblog: Introduction to Schematron"},"content":{"rendered":"<p>Wendell Piez, Mulberry Technologies<\/p>\n<p>Assertion-based schema language. A way to test XML documents. Rule-based validation language. Cool report generator. Good for capturing edge cases.<\/p>\n<p>Same architecture as XSLT. (Schematron <em>specifies<\/em>, does not <em>perform<\/em>)<\/p>\n<pre>&lt;schema xmlns=\"http:\/\/purl.cclc.org\/dsdl\/schematron\"&gt;\r\n  &lt;title&gt;Check sections 12\/07&lt;\/title&gt;\r\n  &lt;pattern id=\"section-check\"&gt;\r\n    &lt;rule context=\"section\"&gt;\r\n      &lt;assert test=\"title\"&gt;This section has no title&lt;\/assert&gt;\r\n      &lt;report test=\"p\"&gt;This section has paragraphs&lt;\/report&gt;\r\n      ...\r\n<\/pre>\n<p>Demo. OxygenXML has support. Assert vs. Report &#8211; essentially opposites. Assert means &#8220;tell me if this if false&#8221;. Report means &#8220;tell me if this is true&#8221;.<\/p>\n<p>&#8220;Almost as if Schematron is a harness for XPath testing.&#8221;<\/p>\n<p>More examples:<\/p>\n<pre>&lt;rule context=\"note\"&gt;\r\n  &lt;report test=\"ancestor::note\"&gt;A note appears in a note. OK?&lt;\/report&gt;\r\n&lt;\/rule&gt;\r\n<\/pre>\n<p>Binding: Default is XSLT 1, but flexible enough to allow other query langauges via attribute @queryBinding at the top. Many processors allow mix-and-match between XSLT and Schematron. Examples showing just that.<\/p>\n<p>Some tests can be very useful:<\/p>\n<p>test=&#8221;every $line in tokenize(., $newline) satisfies string-length($line) le 72&#8243;<\/p>\n<p>Q: What if the destination is not a human, but another part of a pipeline? Varies by implementation, but SVRL is standardized as an annex in the ISO spec, part of DSDL.<\/p>\n<p>Use as little or as much as you want, at different times in the document lifecycle. &#8220;Schematron is a feather duster that reaches areas other schema languages cannot.&#8221; &#8211; Rick Jelliffe<\/p>\n<p>As time permits section of the talk:<\/p>\n<p>Other top-level elements: title, pattern, ns, let, p, include, phase, diagnostics.<\/p>\n<p>-m<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wendell Piez, Mulberry Technologies Assertion-based schema language. A way to test XML documents. Rule-based validation language. Cool report generator. Good for capturing edge cases. Same architecture as XSLT. (Schematron specifies, does not perform) &lt;schema xmlns=&#8221;http:\/\/purl.cclc.org\/dsdl\/schematron&#8221;&gt; &lt;title&gt;Check sections 12\/07&lt;\/title&gt; &lt;pattern id=&#8221;section-check&#8221;&gt; &lt;rule context=&#8221;section&#8221;&gt; &lt;assert test=&#8221;title&#8221;&gt;This section has no title&lt;\/assert&gt; &lt;report test=&#8221;p&#8221;&gt;This section has paragraphs&lt;\/report&gt; &#8230; Demo&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[27,4,32],"tags":[561,540,559,560,1153,534],"class_list":["post-403","post","type-post","status-publish","format-standard","hentry","category-languages","category-xml","category-xpath","tag-assertion","tag-schema","tag-schematron","tag-validation","tag-xml","tag-xml2008"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8eo8l-6v","_links":{"self":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/comments?post=403"}],"version-history":[{"count":0,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/403\/revisions"}],"wp:attachment":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/media?parent=403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/categories?post=403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/tags?post=403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}