EDIT: this answer was wrong for 6 years. I initially claimed that adding the version
attribute declares that a schema adheres to the XML Schema 1.1 standard. However, this attribute has nothing to do with the XSD version, it can be used for any arbitrary user-defined versioning.
I have now removed the false information.
Indicating that your XML Schema document adheres to the XML Schema 1.1 specification means adding the following to the outermost element:
- Define the namespace for XML Schema versioning:
xmlns:vc=http://www.w3.org/2007/XMLSchema-versioning
- add the attribute
vc:minVersion = "1.1"
Here is an example for the xs:schema
element:
<xs:schema xmlns="http://www.mycompany.com/schema/app"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.mycompany.com/schema/app"
elementFormDefault="qualified"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
vc:minVersion="1.1">
Even if you add this information your schema processor might not be capable of processing XSD 1.1 constructs like assertions, and indicating version 1.1 does not magically enable 1.1 processing.
Put another way, "switching" to XSD 1.1 does not mean mentioning the version in your xs:schema
element, it means making sure your schema processor understands XML Schema 1.1. To find out, simply include an xs:assert
element in the schema and check if you get any error messages. Perhaps there is a setting for the schema version in your tool, as there is in Oxygen:

See the Oxygen documentation for more ways to set the XML schema version.
By the way: if XSD 1.1 is not supported, there might still be support for Schematron - a language that is very useful for assertions and similar rules.