By this framework, you can plug your own schematron validation rule to BTT Validation Tool easily. What you need to do is to add your own rule in schematron format. The user-defined rule can be interpreted by the BTT Grammar Validator, and the errors will be detected and reported to the WTP validation framework.
<?xml version="1.0" encoding="UTF-8"?> <sch:schema xmlns:sch="http://www.ibm.com.cn/BTT612/schematron"> <sch:pattern name="classpath and classtable"> <sch:rule context="field"> <sch:assert test="not(@id) or not(@id='initializer') or not(@value!='com.ibm.btt.config.impl.GlobalSettings') or not(@value!='com.ibm.btt.base.TraceInitializer') or not(@value!='com.ibm.btt.channel.ChannelInitializer') or name(preceding-sibling::*[@id='extFile'])='field' or name(following-sibling::*[@id='extFile'])='field'"> class=com.ibm.btt.tools.validator.schematron.customrule.MessageAttributeValueHandler attribute=id message=The extFile is mandatory. type=2 </sch:assert> </sch:rule> </sch:pattern> </sch:schema>The schematron rules engine support the following rule format:
class=com.ibm.btt.tools.validator.schematron.customrule.MessageAttributeValueHandler attribute=id message=The extFile is mandatory type=2where:
<sch:rule context="context"> <sch:assert test="not(@id) or current()/@id != 'test_context'"> class=com.ibm.btt.tools.validator.schematron.customrule.MessageAttributeValueHandler attribute=id message=Its id is not 'test_context' type=2 </sch:assert> </sch:rule>