XSD 混合内容的复合类型

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>
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
POOR_IN2000901UV.xsd文件内容比较复杂,包含了POOR_IN2000901UV消息类型的各个元素和属性,以及其他HL7 V3消息类型中使用的一些公共元素和数据类型。以下是该文件的主要内容: 1. 命名空间和导入声明 ``` <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns:its="http://www.hl7.org/schemas/HL7ITS-R1" xmlns:uv="urn:hl7-org:uv:mi" targetNamespace="urn:hl7-org:uv:poor_in2000901uv" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="urn:hl7-org:v3" schemaLocation="..."/> <xs:import namespace="urn:hl7-org:v3/mif" schemaLocation="..."/> <xs:import namespace="http://www.hl7.org/schemas/HL7ITS-R1" schemaLocation="..."/> <xs:import namespace="urn:hl7-org:v3/uv" schemaLocation="..."/> ``` 2. 消息头和消息体定义 ``` <xs:element name="POOR_IN2000901UV" type="UV_Poor_IN2000901UV"/> <xs:complexType name="UV_Poor_IN2000901UV"> <xs:sequence> <xs:element name="id" type="II" minOccurs="0"/> <xs:element name="creationTime" type="TS" minOccurs="0"/> <xs:element name="securityText" type="ST" minOccurs="0"/> <xs:element name="versionCode" type="CS" minOccurs="0"/> <xs:element name="interactionId" type="II"/> <xs:element name="processingCode" type="CS" minOccurs="0"/> <xs:element name="processingModeCode" type="CS" minOccurs="0"/> <xs:element name="acceptAckCode" type="CS" minOccurs="0"/> <xs:element name="receiver" type="MCCI_MT000100UV01Receiver" maxOccurs="unbounded"/> <xs:element name="sender" type="MCCI_MT000100UV01Sender"/> <xs:element name="controlActProcess" type="UV_Poor_IN2000901UV.ControlActProcess"/> </xs:sequence> </xs:complexType> ``` 3. 公共元素和数据类型定义 ``` <xs:element name="addr" type="AD"/> <xs:element name="code" type="CE"/> <xs:element name="effectiveTime" type="IVL_TS"/> <xs:element name="name" type="EN"/> <xs:element name="telecom" type="TEL"/> <xs:element name="value" type="ANY"/> <xs:complexType name="AD"> ... </xs:complexType> <xs:complexType name="CE"> ... </xs:complexType> <xs:complexType name="EN"> ... </xs:complexType> <xs:complexType name="IVL_TS"> ... </xs:complexType> <xs:complexType name="TEL"> ... </xs:complexType> ``` 以上是POOR_IN2000901UV.xsd文件的部分内容,它定义了POOR_IN2000901UV消息类型的各个元素和属性,以及其他HL7 V3消息类型中使用的一些公共元素和数据类型

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值