Reputation: 1792
For example, I have the following XSD line:
<xs:element name="child_name" type="xs:string" maxOccurs="10"/>
The child_name
tag is maxed to have 10
instances. Is it possible to have that 10
referred as some sort of variable and then defined it elsewhere? (The following code not legit, but just showing if possible to have something like some_variable
, and then have some_variable
defined elsewhere?)
<xs:element name="child_name" type="xs:string" maxOccurs="some_variable"/>
Upvotes: 2
Views: 1430
Reputation: 111571
No, element/@maxOccurs
may only be a nonNegativeInteger or unbounded
.
There are no provisions for allowing it to be a variable, nor are there provisions for declaring or setting variables.
These probably aren't the sort of XSD-level support you're seeking, but here are a couple work-around alternatives:
element/@maxOccurs
.Upvotes: 2