T
Tookelso
Hello,
I would like to have a group of elements which are *required* in one
context, but each one is *optional* in another context.
For example:
I have a configuration file which has a <defaults> element. There are
5 settings which *must* be defined in the <defaults> section.
The configuration file also has <database> elements. A database can
override any of the 5 settings in the <defaults> section.
I tried to define a type like this:
<def name="defaultsType">
<!-- The 5 default elements go here. All 5 elements *must* be
defined under the <defaults> element, but any of the elements
optionally be overridden by the <database> element-->
</def>
Then I tried to refer to the type as being *required* by the <defaults>
element.
<element name="defaults">
<ref name="defaultsType" />
</element
<!--And then each database can have the defaultsType as being
optional:-->
<element name="database">
<optional><ref name="defaultsType"/></optional>
</element>
However, if I only specify 1 override in my <database> element, instead
of all 5 overrides, I get a "required element missing" error.
Any ideas?
Thanks
--Took
I would like to have a group of elements which are *required* in one
context, but each one is *optional* in another context.
For example:
I have a configuration file which has a <defaults> element. There are
5 settings which *must* be defined in the <defaults> section.
The configuration file also has <database> elements. A database can
override any of the 5 settings in the <defaults> section.
I tried to define a type like this:
<def name="defaultsType">
<!-- The 5 default elements go here. All 5 elements *must* be
defined under the <defaults> element, but any of the elements
optionally be overridden by the <database> element-->
</def>
Then I tried to refer to the type as being *required* by the <defaults>
element.
<element name="defaults">
<ref name="defaultsType" />
</element
<!--And then each database can have the defaultsType as being
optional:-->
<element name="database">
<optional><ref name="defaultsType"/></optional>
</element>
However, if I only specify 1 override in my <database> element, instead
of all 5 overrides, I get a "required element missing" error.
Any ideas?
Thanks
--Took