Skip to main content

BIN lhpWa Documentation

  • Author:

  • Version: 10

  • Description: "If A is true then also B must be present" with Constraints - XPath 2

  • Created: 2014-09-30

  • Modified: 2014-10-02

  • Source:

     Edit 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" with Constraints - XPath 2'>
        <field name='A' minOccurs='1' type='xs:boolean' node='attribute'/>
        <field name='B' minOccurs='0' type='xs:string' extra:form.maybenull='true' extra:ctrl.emptyisnull='true' node='attribute'/>
        <constraint name='If_A_ThenAlsoB_OtherwiseNoB' category='boolean' selector='.'>
            <expression grammar='xpath'
    	             path='(xs:boolean(A) and B) or not(xs:boolean(A) or B)' />
        </constraint>
    </complexType>