Schema
来源:互联网 发布:医院智能化软件厂家 编辑:程序博客网 时间:2024/04/30 10:05
Schema
此文档中同时引入了三个约束文档,
一个默认的名字空间:xmlns="http://www.it315.org/xmlbook/schema
一个叫demo的名字空间:xmlns:demo=http://www.it315.org/demo/schema
一个著名的名字空间:xsi:schemaLocation="http://www.it315.org/xmlbook/schema
举例:
<书架 xmlns="http://www.class3g.org/xmlbook/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=“http://www.class3g.cn book.xsd">
<书>
<书名>JavaScript网页开发</书名>
<作者>张孝祥</作者>
<售价>28.00元</售价>
</书>
</书架>
在XML文档中使用已经编写好的schema文件的一般格式如下:
“class”表示根元素,其中xmlns:xsi是在文档中声明“XML 模式实例”名称空间,以授予对引用XML模式时需要的属性的访问权。当然,要添加前缀映射(xsi)和相关URL。xmlns是为所有没有前缀的元素提供缺省命名空间。
attributeGroup类型与group类型相似,attributeGroup类型主要用于把一组属性组合在一起,以便在复合类型中应用。attributeGroup类型的属性主要的:name、id和ref,“name”属性指示该属性组的名称,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:attributeGroup name="myGroup">
<xs:attribute name="id" type="xs:int"/>
<xs:attribute name="status" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
- Schema
- schema
- Schema
- schema
- Schema
- Schema
- Schema
- Schema
- Schema
- schema
- Schema
- Schema
- Schema
- Schema
- Schema
- schema
- schema
- schema
- 工厂模式之commons-pool
- 解决Apache2.2安装之后启动出现“the requested operation has failed”
- PHP中单引号和双引号具有不同的含义
- Ubuntu_安装rar工具
- 12个球问题(不知轻重)
- Schema
- empty()和isset
- poj2777-线段树应用(线段覆盖)
- HDU武汉大学第五届E鸣杯程序设计大赛 解题报告
- 黑马程序员---反射
- 《Java编程思想》学习笔记17——注解Annotation
- 成功创业小成靠智,大成靠德
- Java:二进制方式读取文件
- 资治通鉴,卷一百,诸葛恪的仁义