<p>I have run across an XML Schema with the following definition:</p>

<pre><code>&lt;xs:simpleType name="ClassRankType"&gt;
    &lt;xs:restriction base="xs:integer"&gt;
        &lt;xs:totalDigits value="4"/&gt;
        &lt;xs:minInclusive value="1"/&gt;
        &lt;xs:maxInclusive value="9999"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
</code></pre>

<p>However, it seems to me that <code>totalDigits</code> is redundant.  I am somewhat new to XML Schema, and want to make sure I'm not missing something.</p>

<p>What is the actual behavior of <code>totalDigits</code> vs. <code>maxInclusive</code>?</p>

<p>Can <code>totalDigits</code> always be represented with a combination of <code>minInclusive</code> and <code>MaxInclusive</code>?  </p>

<p>How does <code>totalDigits</code> affect negative numbers?</p>

can totalDigits always be represented with a combination of minInclusive and MaxInclusive?
In this case, yes. As you're dealing with an integer, the value must be a whole number, so you have a finite set of values between
```
minInclusive
```
and
```
maxInclusive
```
. If you had decimal values,
```
totalDigits
```
would tell you how many numbers in total that value could have.
How does totalDigits affect negative numbers?
It is the total number of digits allowed in the number, and is not affected by decimal points, minus signs, etc. From
auxy.com
:
The number specified by the value attribute of the
```
<xsd:totalDigits>
```
facet will restrict the total number of digits that are allowed in the number, on both sides of the decimal point.