The xs:time
type will validate the timespan fields. For the other fields, you can use a restriction to the xs:string
type with a regexp. This XSD will validate the example XML you posted:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:simpleType name="CsvType">
<xs:restriction base="xs:string">
<xs:pattern value="\w+,\w+,(true|false),(true|false),\w*,\w*,[A-Fa-f0-9]{7,8}(-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{11,12}"></xs:pattern>
</xs:restriction>
</xs:simpleType>
<xs:element name="MyAttributes">
<xs:complexType>
<xs:attribute name="Att1" type="xs:time" />
<xs:attribute name="Att2" type="xs:time" />
<xs:attribute name="Att3" type="xs:time" />
<xs:attribute name="Att4" type="CsvType" />
<xs:attribute name="Att5" type="CsvType" />
</xs:complexType>
</xs:element>
</xs:schema>
You don't really need XSD 1.1 assertions, unless you want to validate contents of one attribute in relation to the contents of the other.