2

I am not an expert on XML Schema so I am wondering how can the following be correct:

In emma (http://www.w3.org/TR/emma/) all examples given are using fully qualified emma (both at elements and attributes) like:

<emma:emma version="1.0" xmlns:emma="http://www.w3.org/2003/04/emma"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/2003/04/emma
    http://www.w3.org/TR/2009/REC-emma-20090210/emma.xsd"
    xmlns="http://www.example.com/example">
    <emma:interpretation id="r1" emma:medium="acoustic" emma:mode="voice">
        ...
    </emma:interpretation>
</emma:emma>

but the http://www.w3.org/TR/emma/emma.xsd defines:

elementFormDefault="unqualified" attributeFormDefault="unqualified"

And I don't see how prefixes are enabled on the element / attribute level either.

I wonder, how can that be correct? There must be a flaw in my understanding of XML Schema.

Jakob
  • 1,126
  • 3
  • 16
  • 38
  • [**See also this**](https://stackoverflow.com/a/46758277/290085) to understand `elementFormDefault`, – kjhughes Oct 15 '17 at 23:42

2 Answers2

2

Because in every complex type where an element is defined, it is a reference to a global element, hence qualified. The element form applies only to local elements, not global.

forty-two
  • 12,204
  • 2
  • 26
  • 36
0

elementFormDefault and attributeFormDefault are only defaults. It's always possible to specify form="qualified" on individual element and attribute declarations. And global element and attribute declarations are qualified by the target namespace unconditionally.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164