Does MarkLogic provides schematron support?

谁说我不能喝 提交于 2020-01-14 03:17:12

问题


I am using MarkLogic 8.0-8 version.

Is it possible to validate an XML using schematron?

Please help me with an example.


回答1:


Yes, as of MarkLogic 9.0.7, there is built-in support for Schematron.

http://docs.marklogic.com/schematron

To use the schematron XQuery library module as part of your own XQuery module, include the following lines in your XQuery prolog:

    import module namespace schematron = "http://marklogic.com/xdmp/schematron"
        at "/MarkLogic/schematron/schematron.xqy";

For more information and usage examples, see the Validating Schemas Using Schematron section in the Application Developers Guide.




回答2:


There are XSLT stylesheets that are publicly available here to run Schematron validation:

https://github.com/Schematron/schematron

You can run these within MarkLogic. Though a little dated, here a project that shows how you could do it. It might still work:

https://github.com/ndw/ML-Schematron

HTH!




回答3:


MarkLogic also packages a version of the Schematron validator with the appservices libraries. You can simply import it into a module:

import module namespace sch = "http://marklogic.com/validate" 
at "/MarkLogic/appservices/utils/validate.xqy"; 

sch:schematron($document, $schema)


来源:https://stackoverflow.com/questions/49192344/does-marklogic-provides-schematron-support

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!