📜  XSD-复杂类型

📅  最后修改于: 2020-11-09 05:46:34             🧑  作者: Mango


复杂元素是一个XML元素,可以包含其他元素和/或属性。我们可以通过两种方式创建复杂元素-

  • 定义复杂类型,然后使用type属性创建元素

  • 通过命名直接定义复杂类型

定义复杂类型,然后使用type属性创建元素。


   
      
      
      
      
   
   


             

通过命名直接定义复杂类型。


      
      
         
         
         
         
      
   
   

以下是XSD支持的复杂类型列表。

S.No. Simple Type & Description
1

Empty

Complex Empty complex type element can only have attributes but no contents.

2

Elements Only

Elements-Only complex type element can only contain elements

3

Text Only

Text-Only complex type element can only contain attribute and text.

4

Mixed

Mixed complex type element can contain element, attribute and text.

5

Indicators

Indicators controls the ways how elements are to be organized in an XML document.

6

The element is used for elements which are not defined by schema

7

The attribute is used for attribute which are not defined by schema.