On 29 Sep 2016, at 16:07, Thomas Passin<list1@tompassin.net>
wrote:
I have always understood that the elementFormDefault only applies
to the way that the element names are written*in the schema*; if
there is a target namespace specified, then all elements defined
in the schema (and not otherwise namespaced or referenced) must
be in that namespace in an instance document, unrelated to the
value of elementFormDefault.
No, that's incorrect. If you specify form="unqualified", or by
implication elementFormDefault="unqualified", which is its default
value, then local element declarations describe elements whose names
are in no namespace.
Ah... I have probably in practice absorbed that bit without noticing ...
thanks.Chapter and verse: XSD 1.0 part 1 §3.3.2,
Element information items ·validated· by a top-level declaration must
be qualified with the {target namespace} of that declaration (if this
is ·absent·, the item must be unqualified). Control over whether
element information items ·validated· by a local declaration must be
similarly qualified or not is provided by the form [attribute], whose
default is provided by the elementFormDefault [attribute] on the
enclosing <schema>, via its determination of {target namespace}.
which says that if form=unqualified (explicitly or implicitly) the
element information item to be validated must be unqualified, which
is XSD's way of saying it must be in no namespace.