Short answer: no.
Medium answer, according to "XML Schema Part 1: Structures Second Edition", section "3.2.1 The Attribute Declaration Schema Component": "default specifies that the attribute is to appear unconditionally in the ·post-schema-validation infoset·, with the supplied value used whenever the attribute is not actually present"
Long and practical answer: the key is "post-schema-validation infoset". So ask yourself what you need the schema document for?
- if you need it to validate incoming XML documents, then just use
use="required"
for attribute b
- if you need it to build objects (e.g., using some (un)marshalling technologies such as Java's JAXB or .NET's
XmlSerializer
) then you must explicitely add some post-processing which satisifies this "post-schema-validation-infoset" term - you should detect if the value of b
wasn't set and set it yourself - that's your business requirement
- if you need to communicate your intent (*I/my app will treat empty
b
as having the same value as a
) add documentation. XML Schema doesn't have such concept. Using extrapolation - that would be the same requirement as "the value of b
will be the current USD/EUR ratio" - it's just computed value