Is it possible to override the minOccurs & maxOccurs attribute of an element in complexType by extension?

Is it possible to override the minOccurs and maxOccurs attribute of an element in complexType by extension?

I have xsd for application configuration, and I want to extend complextype to make attributes optional and get only those elements that have been changed by the user in the GUI. Since I do not want to send all the elements to the server for only one parameter change.

Please, help.

+4
source share
1 answer

The extension allows you to specify additional elements / attributes, it does not allow you to change the power / face, etc. child elements / attributes.

Constraint works differently, which allows you to further constrain existing elements / attributes, so if you want to make an optional element mandatory, you can do it with a constraint.

Thus, in principle, no - the extension will not allow you to modify existing child elements.

The only way to do this is to use the redefine construct - but this is randomly and not very well supported by some validation analyzers.

+2
source

Source: https://habr.com/ru/post/1395745/


All Articles