The application I work on has XML output that conforms to an XSD schema. As features are added to the application, the XSD changes and I would like to note the version of the schema in the XSD file.
Perhaps I’m missing something, but I haven’t found a built-in way to mark the version of the schema.
How do you do it?
You can use the namespace of your xsd document
As an example look at the xsd’s defined by w3.org, this is how they do it. Do note that changing the version number here would usually by definition be a breaking change for any consumers of your xsd (no matter how small the actual change was, or which part of the version number you changed).
For less impacting versioning, there seems to be an agreement about putting a version attribute at your root element: