开发者

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 and use are both present, use must have the ·actual value· optional. [...]

So the answer obviously is: NO

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜