jeff00seattle
Programmer
Hi am a relative newbie in XML, so forgive me.
I am tring to put together a validation script using XML Schema, but I cannot determine how to define that the child of an element can have a choice of elements but can only have one.
For example, my XML contents are as follows (if it is total wrong, let me know):
<configuration>
<applicationSettings>
<setting name="Market">
<value>
<string>English (United States)</string>
</value>
</setting>
<setting name="BingSearchEnabled">
<value>
<boolean>True</boolean>
</value>
</setting>
<setting name="MaximumResultsCount">
<value>
<integer>10</integer>
</value>
</setting>
<setting name="FileTypeFilter">
<value>
<stringarray>
<string>js</string>
<string>gif</string>
<string>jpg</string>
</stringarray>
</value>
</setting>
</applicationSettings>
</configuration>
I am trying to create a validation XML Schema that states that is OK for <value> to be only ONE of <string> or <boolean> or <integer> or <stringarray>.
How would I do this?
Thanks
Jeff in Seattle
I am tring to put together a validation script using XML Schema, but I cannot determine how to define that the child of an element can have a choice of elements but can only have one.
For example, my XML contents are as follows (if it is total wrong, let me know):
<configuration>
<applicationSettings>
<setting name="Market">
<value>
<string>English (United States)</string>
</value>
</setting>
<setting name="BingSearchEnabled">
<value>
<boolean>True</boolean>
</value>
</setting>
<setting name="MaximumResultsCount">
<value>
<integer>10</integer>
</value>
</setting>
<setting name="FileTypeFilter">
<value>
<stringarray>
<string>js</string>
<string>gif</string>
<string>jpg</string>
</stringarray>
</value>
</setting>
</applicationSettings>
</configuration>
I am trying to create a validation XML Schema that states that is OK for <value> to be only ONE of <string> or <boolean> or <integer> or <stringarray>.
How would I do this?
Thanks
Jeff in Seattle