3

I have a WSDL with some types defined. Some elements accept lists of elements and on the service return I also have elements with list of values (or other elements).

As a result I have some magic numbers in the XSD (e.g. minOccurs="10", maxOccurs="250" etc). These values 10, 250 etc are repeated throughout the XSD types.

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

tweety
  • 31
  • 2

2 Answers2

1

No there isn't. The only thing you could do is to pre-process the schema using some sort of template processor before loading.

xcut
  • 6,219
  • 1
  • 33
  • 27
0

XSD is XML so you could use entities defined in a DTD:

minOccurs="&minOccurs;"
Michael Kay
  • 156,231
  • 11
  • 92
  • 164