Chinaunix首页 | 论坛 | 博客
  • 博客访问: 13888
  • 博文数量: 12
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 125
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-19 15:05
文章分类

全部博文(12)

文章存档

2011年(1)

2009年(11)

我的朋友
最近访客

分类: 系统运维

2009-08-28 10:45:17

XML Schema choice 元素


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 浏览:1391 :: ::

Definition and Usage
定义和用法

XML Schema choice element allows only one of the elements contained in the declaration to be present within the containing element.
XML Schema choice 元素允许使用通过声明的嵌套元素中一个元素。

Element Information
元素信息

  • Parent elements: group, choice, sequence, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent)
    父类元素:group[组]、choice[选项]、sequence[序列]、complexType[符合类型]、restriction[限制] (包括simpleContent[单一内容]和complexContent[复合内容])、extension[扩展] (包括simpleContent[单一内容]和complexContent[复合内容])

Syntax
语法

any attributes
>
(annotation?,(element|group|choice|sequence|any)*)

(The ? sign declares that the element can occur zero or one time, and the * sign declares that the element can occur zero or more times inside the choice element)
“?”符号用于声明元素可以出现的次数(0次或1次),“*”符号用于声明元素可以在choice元素中出现的次数(0次或多次)。

属性 描述
id Optional. Specifies a unique ID for the element
可选参数。为元素指定一个独立的ID
maxOccurs Optional. Specifies the maximum number of times the choice element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1
可选参数。指定choice元素在父类元素中出现的最大次数。其值可以大于等于0;或者,如果你不希望对最大值进行限制,可以使用“unbounded”。默认值是1
minOccurs Optional. Specifies the minimum number of times the choice element can occur in the parent the element. The value can be any number >= 0. Default value is 1
可选参数。指定choice元素在父类元素中出现的最小次数。其值可以大于等于0。默认值是1
any attributes Optional. Specifies any other attributes with non-schema namespace
可选参数。指定非schema命名空间的其它属性

Example 1
案例1


  
    
      
      
    
  

The example above defines an element named "person" which must contain either a "employee" element or a "member" element.
上述案例定义了一个名为“person”的元素,它必须包含一个“employee”元素或一个“member”元素。

阅读(416) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~