Is there a way to remove magic numbers from an XML schema?

I have a WSDL with certain types. Some items accept item lists and service returns. I also have items with a list of values ​​(or other items).

As a result, I have some magic numbers in XSD (for example, minOccurs = "10", maxOccurs = "250", etc.). These values ​​are 10, 250, etc. Repeated in all XSD types.

Is there a way to declare them as a kind of constant? and then reuse them by name for the minOccurs and maxOccurs attributes?

+3
source share
2 answers

, . , , - .

+1

XSD - XML, , DTD:

minOccurs="&minOccurs;"
0

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


All Articles