So I went back and actually read the details (instead of skimming)...
1 An instance of the [XDM] data model is constructed as follows:
1.1 An information set is constructed by copying the base information set
properties (and not any of the properties specific to ·post-schema-
validation infoset·) of the following information items:
1.1.1 E itself.
1.1.2 E's [attributes] (but not its [children]).
So it appears that it doesn't allow you to test against its text node (or any other children).
Solution
Here's how I ended up solving my problem:
<xs:element name="width" type="heightWidthType" />
<xs:element name="height" type="heightWidthType" />
<xs:complexType name="heightWidthType">
<xs:simpleContent>
<xs:extension base="positionType">
<!-- These are actually only valid if the value of the element is auto -->
<xs:attribute name="min" type="xs:unsignedInt" />
<xs:attribute name="max" type="xs:unsignedInt" />
<xs:assert test="not((@min or @max)) or ((@min or @max) and $value eq 'auto')" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="positionType">
<xs:restriction base="xs:string">
<!-- If an "r" is included (eg 180r) then the measurement is taken from the parent's right edge (in the left direction). -->
<xs:pattern value="-?\d+(\.\d+)?(r|%)?" />
<xs:pattern value="auto" />
</xs:restriction>
</xs:simpleType>