XML Schema帮助文档3
XML Schema attributeGroup 元素
定义和用法
attributeGroup 元素用于对属性声明进行组合,这样这些声明就能够以组合的形式合并到复杂类型中。
元素信息
出现次数
无限制
父元素
attributeGroup、complexType、schema、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)
内容
annotation、attribute、attributeGroup、anyAttribute
语法
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(? 符号声明在 attributeGroup 元素中,元素可出现零次或一次,* 符号声明元素可出现零次或多次。)
属性
描述
id
可选。规定该元素的唯一的 ID。
name
可选。规定属性组的名称。name 和 ref 属性不能同时出现。
ref
可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。
any attributes
可选。规定带有 non-schema 命名空间的任何其他属性。
实例
<xs:attributeGroup name="personattr">
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
上面的例子定义了一个名为 "personattr" 的属性组,在名为 "person" 的复杂类型中使用。
XML Schema choice 元素
定义和用法
XML Schema 的 choice 元素仅允许包含在 <choice> 声明中的元素之一出现在包含元素中。
元素信息
出现次数
在 group 和 complexType 元素中为一次;其他为无限制。
父元素
group、choice、sequence、complexType、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)
内容
annotation、any、choice、element、group、sequence
语法
<choice
id=ID
maxOccu
相关文档:
使用SAXReader需要导入dom4j-full.jar包。
dom4j是一个Java的XML API,类似于jdom,用来读写XML文件的。dom4j是一个非常非常优秀的Java XML API,具有性能优异、功能强大和极端易用使用的特点,同时它也是一个开放源代码的软件,可以在SourceForge上找到它。
&n ......
(一) 先讲一下XML中的物殊字符,手动填写时注意一下。
字符 字符实体
& ......
XML定义:由标记及其所标记的内容构成的文本文件。
XML作用:用来描述数据的结构,有效分离数据的结构和表示,可以作为数据交换的标准格式。
XML特点:1、可以自定义标记,标记名称是对所标记的数据内容含义的抽象,而不是数据的显示格式。
&n ......
C#
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this ......
XML Schema annotation 元素
定义和用法
annotation 元素是一个顶层元素,规定 schema 的注释。
注释:可以包含 appinfo 元素(由应用程序使用的信息)和 documentation 元素(由用户读取或使用的注释或文本)。
元素信息
项目
说明
出现次数
在父元素中一次。
......