Monday, 7 July 2014

XML Schema(XSD): Is it possible to create a rule/relation for an element based on another element?



I have 2 elements:



  1. Total number of connections

  2. Connections per second.


I would like to enforce the following rules:



  • Connections per second should be less than or equal to total connections.

  • Default value of connections per second should be equal to total connections


Currently I have total connections as following:



<xs:simpleType name="TotalConnections" use="optional" default=1>
<xs:restriction base="xs:positiveInteger">
<xs:minExclusive value="0" />
<xs:maxInclusive value="8000"/>
</xs:restriction>
</xs:simpleType>


How do I link total connections with cps in my schema?


No comments:

Post a Comment