XSD 混合内容的复合类型
来源:互联网 发布:数据魔方登录 编辑:程序博客网 时间:2024/04/27 21:46
A mixed complex type element can contain attributes, elements, and text.
混合内容的复合类型元素(XSD Complex Types Element With Mixed Content )可以含有属性,元素,和文本。
Complex Types with Mixed Content
混合内容的复合类型
An XML element, "letter", that contains both text and other elements:
一个XML元素,"letter",既含有文本又含有其他元素:
<letter>Dear Mr.<name>John Smith</name>.Your order <orderid>1032</orderid>will be shipped on <shipdate>2001-07-13</shipdate>.</letter>
The following schema declares the "letter" element:
下面的XML公式声明了"letter"元素:
<xs:element name="letter"> <xs:complexType mixed="true"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="orderid" type="xs:positiveInteger"/> <xs:element name="shipdate" type="xs:date"/> </xs:sequence> </xs:complexType></xs:element>
Note: To enable character data to appear between the child-elements of "letter", the mixed attribute must be set to "true". The <xs:sequence> tag means that the elements defined (name, orderid and shipdate) must appear in that order inside a "letter" element.
注意:为了使字符数据能出现在"letter"子元件之间,mixed属性必须设置为"true"。<xs:sequence>标签指出了已定义的元素(name, orderid 和shipdate)在"letter"元素里必须以指定的顺序出现
We could also give the complexType element a name, and let the "letter" element have a type attribute that refers to the name of the complexType (if you use this method, several elements can refer to the same complex type):
我们可以给这个complexType元素一个名称,并且让"letter"元素有一个引用了complexType的名称的种类属性(如果你用了这个方法,几个元素可以同时使用相同的复合类型):
<xs:element name="letter" type="lettertype"/>
<xs:complexType name="lettertype" mixed="true"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="orderid" type="xs:positiveInteger"/> <xs:element name="shipdate" type="xs:date"/> </xs:sequence></xs:complexType>
- XSD 混合内容的复合类型
- XML简介之Schema之 XSD 仅含文本复合元素 VS XSD 带有混合内容的复合类型
- XSD 指示器复合类型
- XSD 复合类型指示器
- XSD复合类型指示器
- XSD 复合类型 - 纯元素
- XML:XSD 复合类型指示器
- 9.XSD 复合类型指示器
- XML简介之Schema之XSD 复合空元素 VS XSD 复合类型 - 仅含元素
- XML简介之Schema之XSD 复合类型指示器 VS XSD <any> 元素
- 复合类型的混合使用--右左法则和替换规则
- 复合类型的声明
- XSD 复合元素
- XSD复合元素
- 8.XSD 复合元素
- XSD 复合元素
- 中英文数字混合的复合格式处理
- 理解复合类型的声明
- XSD 复合类型 - 纯元素
- 在线视频播放代码
- XSD 复合文字 - 纯元素
- 做人真的很难
- 自学java之路
- XSD 混合内容的复合类型
- web.config的配置
- 两分钟让你明白什么是ERP!
- 无组件生成缩略图
- Continue With Label Demo
- 调用约定 Calling convention
- 关于ehcache 配置
- XSD 指示器复合类型
- XSD 元素