Sunday 15 February 2015

xml - Value based conditional restriction in XSD 1.0 -



xml - Value based conditional restriction in XSD 1.0 -

below sample xml:

<rootelement attributename="value1"> <childelement>0</childelement> <childelement>1</childelement> <childelement>2</childelement> <childelement>3</childelement> </rootelement>

i want add together restriction based on value of attributename. value of attributename can value1|value2|value3. if value of attribute name value1 or value2 no kid element should present. if value of attribute name value3 there should min 1 , max 15 childelement occurrences. want accomplish xsd v1.0. found solutions xsd v1.1 can't utilize them because want accomplish in xsd v1.0. found solutions abstract , selection provide different kid elements names. can have "childelement". can't utilize other kid elements.

this kind of restriction not possible xsd 1.0. can accomplish same using assert or rule in xsd 1.1 or later.

xml xsd xsd-validation xsd-1.0

No comments:

Post a Comment