XPath assertion in an xsd schema

Here is an example a bit simplified but similar to your needs, with a list type and an assertion: <?xml version=”1.0″ encoding=”UTF-8″?> <xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema” elementFormDefault=”qualified” xmlns:vc=”http://www.w3.org/2007/XMLSchema-versioning” vc:minVersion=”1.1″> <xs:element name=”root”> <xs:complexType> <xs:sequence> <xs:element ref=”parts”/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=”parts”> <xs:complexType> <xs:sequence> <xs:element maxOccurs=”unbounded” ref=”part”/> </xs:sequence> <xs:assert id=”test-reference-id” test=”every $part in part satisfies every $id in $part/data(@next) … Read more