<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="学生集合">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="学生"/>
<xs:element ref="老师" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="学生">
<xs:complexType>
<xs:sequence>
<xs:element name="姓名" type="xs:string"/>
<xs:element name="性别">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="男"/>
<xs:enumeration value="女"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="年龄">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="120"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="学号" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="老师">
<xs:complexType>
<xs:sequence>
<xs:element name="姓名" type="xs:string"/>
<xs:element name="性别">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="男"/>
<xs:enumeration value="女"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="年龄">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="120"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="教工号" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

一个student的schema验证规则

<?xml version="1.0" encoding="UTF-8"?>
<学生集合 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///C:/Users/Administrator/Documents/Altova/XMLSpy2011/Examples/studentNode.xsd">
<学生 学号="A1">
<姓名>CIACs</姓名>
<性别>男</性别>
<年龄>22</年龄>
</学生>
<老师 教工号="A8">
<姓名>lisi</姓名>
<性别>男</性别>
<年龄>15</年龄>
</老师>
<学生 学号="A1">
<姓名>CIACs</姓名>
<性别>男</性别>
<年龄>22</年龄>
</学生>
<学生 学号="A1">
<姓名>CIACs</姓名>
<性别>男</性别>
<年龄>22</年龄>
</学生>
</学生集合>

SCHema学习的更多相关文章

  1. spring自定义schema学习

    [转载请注明作者和原文链接,欢迎讨论,相互学习.] 一.前言 1. 最近在学习dubbo,里边很多如provider.consumer.registry的配置都是通过spring自定义Schema来实 ...

  2. XML&DTD&XML Schema学习

    XML(eXtensible Markup Language)可扩展的标记语言.xml在web service编程中尤为重要.在网络传输中可以作为传输数据的载体.xml作为元语言,它可以用来标记数据. ...

  3. XML Schema学习札记(1)——基础总览

    内容整理自:www.w3school.com.cn 转载自:http://www.xgezhang.com/xml_schema_1.html 什么是XML Schema? XML Schema 是基 ...

  4. Schema学习【一】

    XML Schema 是基于 XML 的 DTD 替代者. 什么是 XML Schema? XML Schema 的作用是定义 XML 文档的合法构建模块,类似 DTD. XML Schema: 定义 ...

  5. MySQL--performance schema学习

    启用performance schema 在MySQL 5.6.6版本后,performance schema被默认打开 通常MySQL的二进制版本都默认支持PS, 如果使用编译源码安装,在cmake ...

  6. Django 学习第三式

    1.Django请求生命周期 两种情况:最终返回的是字符串 1.-> URL对应关系(匹配) -> 视图函数 -> 返回用户字符串 2.-> URL对应关系(匹配) -> ...

  7. 关于django migrations的使用

    django 1.8之后推出的migrations机制使django的数据模式管理更方便容易,现在简单谈谈他的机制和一些问题的解决方法: 1.谈谈机制:migrations机制有两个指令,第一个是ma ...

  8. XML学习笔记(三) -- Schema

    标签(空格分隔): 学习笔记 Schema的格式 XML Schema文档是由元素.属性.命名空间和XML文档中的其他节点构成的. XML Schema有两种重要的Schema模型:Microsoft ...

  9. oracle学习笔记(1)-三级模式SCHEMA

    oracle三级模式及二级映像 模式(schema)是数据库的一个名词,大部分的数据库在结构上都有三级模式的特征,了解下基本的概念,有助于后续深入的学习. 用老罗坚果pro发布会的话说就是,不罗嗦,先 ...

随机推荐

  1. OBS输出设置

    参数建议来自虎牙 https://help.huya.com/284 3.输出: 1)编码器中x264相当于虎牙直播中的CPU H.264编码,NVENC H.264相当于虎牙直播中的NVIDIA H ...

  2. php 算法知识 冒泡排序

    function bubble_order($arr){ //得到长度 $count_num=count($arr); for($k=1;$k<$count_num;$k++){ //对长度越来 ...

  3. 从npz文件中读取图片并显示的小例子

    前提:我把自己的数据集存成了npz的形式,也就是npy的压缩形式.如果电脑上安装了解压软件,双击npz文件的话,会出现每一部分压缩文件的名字例如npz文件的名称为:mnist.npz文件,用好压解压软 ...

  4. c# 分页 PaginatedList<TResult>

    using System; using System.Collections.Generic; using System.Linq; namespace Microestc.PaginatedList ...

  5. Spring boot 启动图片

    生成工具:http://patorjk.com/software/taag/#p=testall&h=0&v=0&f=Graffiti&t=Type%20Somethi ...

  6. 【原】python常用模块

    1.os模块 对操作系统中文件/目录等进行操作 2.sys模块 对python版本进行操作 3.正则re模块 4.datetime,date,time模块 5.hashlib,md5模块 hashli ...

  7. Java面向对象编程 -1

    面向对象简介 C语言是面向过程开发的代表 C++ 或者Java 是面向对象的编程语言 所谓的面向过程指的是面对于一个问题的解决方案,更多的情况下是不会做出重用的设计思考的. 而面向对象的主要设计形式是 ...

  8. Educational Codeforces Round 72 (Rated for Div. 2)D(DFS,思维)

    #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;int n,m,k=1;int c[5007] ...

  9. [aac @ ...] more samples than frame size (avcodec_encode_audio2)

    在用FFmpeg对音频进行编码的时候报如下错误: [aac @ 000001cfc2717200] more samples than frame size (avcodec_encode_audio ...

  10. redis 之 redis主从复制

    Redis集群中的数据库复制是通过主从同步来实现的 主节点(Master)把数据分发给从节点(Slave) 主从同步的好处在于高可用,Redis节点有冗余设计 主从复制的原理:1. 从服务器向主服务器 ...