Is it possible to declare an attribute which is valid on all elements, regardless of scope, without having to define it on every element/type (or having to include some global type within each element/type)?
I'm not sure where in XSD you would define such a thing, hence I suspect it cannot be done.
As you suspect, there is no way in XSD 1.0 to globally declare that an attribute may appear on all elements without in some way adjusting the declarations of those elements.
However, there are some alternatives to repeating a common attribute definition for every element:
@ref
it from every element.In XSD 1.1, you can specify a default attribute group via a defaultAttributes
declaration on the xsd:schema
element.