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
相关文档:
XML是一种可扩展置标语言,又称可扩展的编辑语言。XML文档的定义格式有两种:DTD和Schema格式,由于Schema是xml本身的,所以应用的非常普遍。xml的作用是文件的读写,所以在web开发中也得到了广泛应用,作为一种配置文件,充分发挥了它读写的功能。XML的解析方式有四种:DOM,SAX,JDOM,DOM4J。 ......
本文示例源代码或素材下载
本节的内容:
如何在InfoPath中使用数据连接来从XML文件中获取数据
如何通过代码来修改数据连接中的XML文件路径
打开Visual Studio 2008,以“InfoPath 2007表单模板”为项目模板新建一个项目。
项目创建完后,就会看到一个空空如也的mainifest.xsf文件,这 ......
//读取XML文件
//1、LoadfromFile装入XML文件
//2、指定路径,激活读取
//3、从内存流读取
//4、从网络上直接获取
//1、LoadfromFile装入XML文件
procedure TForm1.Button1Click(Sender: TObject);
begin
XMLDocument1.LoadfromFile('c:\temp\test.xml');
// XMLDocument1.Active := True;
Memo1.Lines := X ......
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import org.dom4j.Documen ......
protected void Button1_Click(object sender, EventArgs e)
{
//为response(star)节点 和 Cabins(f) cabin节点分别添加个
&nbs ......