Pages: 1
Print
Author Topic: Schemtron example that can be used with XMetaL 10  (Read 1545 times)
tmakita
Member

Posts: 26



WWW
« on: March 16, 2015, 06:58:57 AM »

Hi,

I want evaluate the XMetaL 10 function for schematron validation.
Are there any examples that can be used with XMetaL?
I found no .sch extension files in XMetaL install folder.

There is open source schematron file for DITA.

jelovirt/dita-schematron
https://github.com/jelovirt/dita-schematron

But I cannot get any effective result when I invoke "Tools" - "Validate using Schematron" and specify this .sch file from dialog.

Please give me any suggestion.

Toshihiko Makita
Antenna House, Ina branch
Logged

Toshihiko Makita
Development Section
Antenna House, Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2570



WWW
« Reply #1 on: March 16, 2015, 12:31:21 PM »

Try this example:

Code:
<schema xmlns="http://purl.oclc.org/dsdl/schematron" >
     <title>dita schematron</title>
     <pattern name="TestForTaskAsRoot">
          <rule context="/*">
               <assert test="name()='task'">Root element <name/> is not task</assert>
               <report test="name()='task'">Root element is task</report>
          </rule>
     </pattern>
</schema>

If you run it against an XML file (DITA or any other document type) that does not have <task> as the root element then the text from the assert should display. If it does have <task> as the root element then the text from the report should display.
« Last Edit: March 16, 2015, 12:45:11 PM by Derek Read » Logged
Pages: 1
Print
Jump to:  

email us