In XML Schema 1.1, xs:alternative can specify attribute-dependent types, as shown at your link (Restrict XSD attribute value based on another attribute value).
For your example, a schema might look like the following:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsv="http://www.w3.org/2007/XMLSchema-versioning"
elementFormDefault="qualified"
xsv:minVersion="1.1">
<xs:element name="List">
<xs:complexType>
<xs:sequence>
<xs:element name="Config" minOccurs="0" maxOccurs="unbounded">
<xs:alternative test="@key='foo'" type="ConfigKeyFooType"/>
<xs:alternative test="@key='baz'" type="ConfigKeyBazType"/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="ConfigTypeAttributeGroup">
<xs:attribute name="key" type="xs:ID" use="required" />
</xs:attributeGroup>
<xs:complexType name="ConfigKeyFooType">
<xs:simpleContent>
<xs:extension base="ConfigKeyFooContentType">
<xs:attributeGroup ref="ConfigTypeAttributeGroup"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="ConfigKeyFooContentType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="bar"/>
<xs:enumeration value="bar2"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ConfigKeyBazType">
<xs:simpleContent>
<xs:extension base="ConfigKeyBazContentType">
<xs:attributeGroup ref="ConfigTypeAttributeGroup"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="ConfigKeyBazContentType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="boom"/>
<xs:enumeration value="box"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
A valid xml…
<?xml version="1.0" encoding="utf-8"?>
<List>
<Config key="foo">bar</Config>
<Config key="baz">boom</Config>
</List>
…is assessed as valid.
An invalid xml due to duplicate keys…
<?xml version="1.0" encoding="utf-8"?>
<List>
<Config key="foo">bar</Config>
<Config key="baz">boom</Config>
<Config key="foo">bar2</Config>
<Config key="baz">box</Config>
</List>
…is assessed as invalid with messages:
[Error] sample-bad-dup-keys.xml:5:21:cvc-id.2: There are multiple occurrences of ID value 'foo'.
[Error] sample-bad-dup-keys.xml:5:21:cvc-attribute.3: The value 'foo' of attribute 'key' on element 'Config' is not valid with respect to its type, 'ID'.
[Error] sample-bad-dup-keys.xml:6:21:cvc-id.2: There are multiple occurrences of ID value 'baz'.
[Error] sample-bad-dup-keys.xml:6:21:cvc-attribute.3: The value 'baz' of attribute 'key' on element 'Config' is not valid with respect to its type, 'ID'.
An invalid xml due to invalid values…
<?xml version="1.0" encoding="utf-8"?>
<List>
<Config key="foo">bar3</Config>
<Config key="baz">boox</Config>
</List>
…is assessed as invalid with messages:
[Error] sample-bad-values.xml:3:34:cvc-enumeration-valid: Value 'bar3' is not facet-valid with respect to enumeration '[bar, bar2]'. It must be a value from the enumeration.
[Error] sample-bad-values.xml:3:34:cvc-complex-type.2.2: Element 'Config' must have no element [children], and the value must be valid.
[Error] sample-bad-values.xml:4:34:cvc-enumeration-valid: Value 'boox' is not facet-valid with respect to enumeration '[boom, box]'. It must be a value from the enumeration.
[Error] sample-bad-values.xml:4:34:cvc-complex-type.2.2: Element 'Config' must have no element [children], and the value must be valid.
Tested with Online Schema Validator service (linked from Xerces Using XML Schemas) running "Apache Xerces-J (v 2.12.2) XML Schema validator".