XML Schema: "use='required'" with default value
In an XML Schema, is it possible to have an element which has use='required'
and a default value (e.g. <xs:attribute name="Version" type="U8" use="required" default="02"/开发者_Go百科>
)?
At least XMLSpy chokes on this one:
[...] In attribute declaration 'Version', 'use' must have the value 'optional' because the attribute 'default' is present.
A look into XML Schema Part 1: Structures Second Edition yields 3.2.3 Constraints on XML Representations of Attribute Declarations:
[...] If
default
anduse
are both present,use
must have the ·actual value·optional
. [...]
So the answer obviously is: NO
精彩评论