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"/>
)?
views:
202answers:
1
+1
A:
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
Stefan Gehrig
2009-10-15 13:56:53