Vai al contenuto principale

BIN 7L6lT Documentation

  • Author:

  • Version: 8

  • Description: "If A is true then also B must be present otherwise no B" with Constraints - Velocity

  • Created: 2014-09-30

  • Modified: 2014-12-01

  • Source:

     Modifica Bin W3C Schema Json-Schema Java Bean Code Default Value as XML

    Printers Embed Responsive

    <complexType name='ExampleIfAThenAlsoBOtherwiseNoB' description='"If A is true then also B must be present otherwise no B" with Constraints - Velocity'>
    	<field name='A' minOccurs='1' type='xs:boolean' node='attribute'/>
    	<field name='B' minOccurs='0' type='xs:string' node='attribute'/>
    	<constraint name='If_A_ThenAlsoB_OtherwiseNoB' category='boolean' selector='.'>
    		<expression grammar='velocity' 
    	             path='#if(($value.A==&#39;true&#39; &amp;&amp; !$value.B) || !($value.A==&#39;true&#39; || $value.B)) true #end' />
    	</constraint>
    </complexType>