Skip to main content

BIN v7vFf Documentation

  • Author:

  • Version: 5

  • Description: Required choice with constraints. You must insert either A or B, not both

  • Created: 2015-12-19

  • Modified: 2015-12-19

  • Source:

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

    Printers Embed Responsive

    <complexType name='ExampleRequiredChoice' description='Required choice with constraints. You must insert either A or B, not both'>
    	<field name='A' minOccurs='0' type='xs:int' node='attribute' extra:ctrl.emptyisnull='true' extra:form.maybenull='true'></field>
    	<field name='B' minOccurs='0' type='xs:string' node='attribute' extra:ctrl.emptyisnull='true' extra:form.maybenull='true'></field>
    	<constraint name='xor_ab_constraint' extra:form.error='You must insert either A or B' category='boolean' selector='.'>
    			<expression grammar='xpath' path='(A or B) and not(A and B)'></expression>
    			
    		</constraint>	
    </complexType>