Hi all.

I recently bought a Saxon-EE license (using 9.5.1.4J) and am trying to get up to speed on current XML technologies such as XML Schema 1.1, XSLT 2.0, XPath 2.0, XInclude, and XProc.

The problem that I am having is that I cannot determine if Saxon is giving me a spurious warning or whether there is actually something wrong with my schema.  Here's a stripped down version of the schema that exhibits the problem:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:items="file://localhost/items"
    version="1.1"
    elementFormDefault="qualified"
    targetNamespace="file://localhost/items">
   
    <xs:complexType name="item" final="#all">
        <xs:attribute name="id" type="xs:string" use="required"/>
        <xs:attribute name="index" type="xs:positiveInteger" default="1"/>
    </xs:complexType>
   
    <xs:element name="items">
        <xs:complexType>
            <xs:sequence>
                <xs:element
                    name="item"
                    type="items:item"
                    minOccurs="0"
                    maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
        <xs:key name="item-id">
            <xs:selector xpath="items:item"/>
            <xs:field xpath="@id"/>
            <xs:field xpath="@index"/>
        </xs:key>
    </xs:element>

</xs:schema>

and here is a sample instance document:

<?xml version="1.0" encoding="UTF-8"?>
<items
    xmlns="file://localhost/items"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="file://localhost/items items.xsd">

    <item id="A"/>

</items>

Saxon keeps issuing this warning:

Warning: on line 27 of items.xsd:
  The field expression may select no nodes, which would make the instance document invalid

Which I assume has something to do with the use of the index attribute which is non-required and has a default value.  I have tried all sorts of ways to try to make an invalid instance document, but all that happens is this warning.

Is something wrong with what I am doing?  Is it just a Saxon quirk?

Regards,
Paul Mensonides