<?xml version="1.0" encoding="UTF-8"?>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/"
xmlns:tns="http://www.w3.org/" elementFormDefault="qualified">
<xsi:element name="persons">
</xsi:element>
</xsi:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/family" xmlns:tns="http://www.example.org/family"
elementFormDefault="qualified">
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"></xs:element>
<xs:element name="lastname" type="xs:string"></xs:element>
</xs:sequence>
<xs:anyAttribute/><!-- <anyAttribute> 元素使我们有能力通过未被 schema 规定的属性来扩展XML文档! -->
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/children" xmlns:tns="http://www.example.org/children"
elementFormDefault="qualified">
<xs:attribute name="sex"><!-- 创建属性名称为sex的属性 -->
<xs:simpleType>
<xs:restriction base="xs:string"><!-- 创建的约束条件 -->
<xs:enumeration value="男"></xs:enumeration><!-- 规定属性值得范围 -->
<xs:enumeration value="女"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<persons xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.w3.org" xmlns:fm="http://www.example.org/family"
xmlns:ch="http://www.example.org/children"
xsi:schemaLocation="http://www.w3.org per.xsd http://www.example.org/family family.xsd http://www.example.org/children children.xsd">
<fm:person ch:sex="男">
<fm:firstname></fm:firstname>
<fm:lastname></fm:lastname>
</fm:person>
<fm:person ch:sex="女">
<fm:firstname></fm:firstname>
<fm:lastname></fm:lastname>
</fm:person>
</persons>
分享到:
相关推荐
<any>元素可以让我们使用没有在Schema中定义的元素去扩展XML文档。例如,在Schema family.xsd中使用了<any> <xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="firstname" type="xs:...
<attribute> 以对象的形式代表了 HTML 元素的标签属性或属性。 <B> 指定文本应以粗体渲染。 <base> 指定一个显示 URL 用于解析对于外部源的链接和引用,如图像和样式表。 <baseFont> 设置渲染文本时作为缺省字体的...
?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE taglib PUBLIC "-/... <attribute> <name>times</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> </taglib>
<th>Attribute Name</th> <th>Description</th> <tr> <td>app:colorSeeds="@array/colors"</td> <td>Set the colors of seekbar</td> </tr> <tr> <td>app:cornerRadius="4dp"</td> <td>Sets the corner ...
charset=UTF-8" language="java" %><br/><%@ taglib uri="/WEB-INF/Struts-bean.tld" prefix="bean" %><br/><%@ taglib uri="/WEB-INF/Struts-html.tld" prefix="html" %><br/><html:html locale="true"><br/><head>...
<param name="bAllowOptionalProperties">A boolean flag that specifies whether or not to return optional parameters in the PropertyAttribute array.</param> <returns>An array of PropertyAttributes are...
现在用struts的很多,但是对于struts的tld属性你有多少了解呢? 来看看这个吧,详细解释了一下struts的tld里面各...//rtexprvalue:"RUN-TIME EXPRESSION VALUE",是否可以动态赋值,在jsp中如value="<%=attributeName%>
<br><br>/**<br><br>* @author Holen Chen<br><br>*/<br><br>public class Dom4jDemo {<br> public Dom4jDemo() {<br> }<br><br> /**<br><br> * 建立一个XML文档,文档名由输入属性决定<br><br> * @param filename 需...
include <afxtempl.h><br><br>#include <stdarg.h><br><br> <br><br>#ifdef XML_DLL<br><br>#define DLL_API _declspec(dllexport)<br><br>#else<br><br>#define DLL_API _declspec(dllimport)<br><br>#endif<br><br...
04.zip<br>Outlook Style UI<br>Outlook风格的界面效果(16KB)<END><br>5,05.zip<br>Dynamic child window repositioning<br>动态改变对话框的大小, 对话框中的控件相应改变(15KB)<END><br>6,06.zip<br>Enhanced list...
249<br>31.4 数据结构 250<br>31.5 加密套件 251<br>31.6 密钥信息 252<br>31.7 SESSION 252<br>31.8 多线程支持 253<br>31.9 编程示例 253<br>31.10 函数 264<br>第三十二章 Openssl命令 267<br>32.1概述 267<br>...
<option name="ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES"> <value> <option name="FOREGROUND" value="ffd700" /> </value> </option> <option name="ANNOTATION_NAME_ATTRIBUTES"> <value> <option name=...
249<br>31.4 数据结构 250<br>31.5 加密套件 251<br>31.6 密钥信息 252<br>31.7 SESSION 252<br>31.8 多线程支持 253<br>31.9 编程示例 253<br>31.10 函数 264<br>第三十二章 Openssl命令 267<br>32.1概述 267<br>...
<br>}<br></script><br></head><br><body><br><form id="form1" runat="server"><br><asp:ScriptManager ID="ScriptManager1" runat="server"><br><Services><br><asp:ServiceReference Path="~/WebServices/...
The 80x86 MOV Instruction<br>4.8 - Some Final Comments on the MOV Instructions<br><br>4.9 Laboratory Exercises<br>4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers<br>4.9.2 ...
<div data-options="region:'... <th data-options="field:'attr1'" width="150">Attribute</th> <th data-options="field:'status',align:'center'" width="60">Status</th> </tr> </thead> </table> </div>
195<br>8.5.1 ANY. 195<br>8.5.2 #PCDATA. 195<br>8.5.3 子元素列表... 198<br>8.5.4 序列... 200<br>8.5.5 一个或多个子元素... 200<br>8.5.6 零或多个子元素... 201<br>8.5.7 零或一个子元素... 201<br>8.5.8 ...
例:p[attribute~=value],指的是attribute中包含value的值以及,并与其他内容通过空格隔开的p标签 2.3.4连字符标签 例:|=,属性为value或以value开头的 2.3.5前缀选择器 例:^=,属性以value开头的 2.3.6子串...
$("div#intro .head") id="intro" 的 <div> 元素中的所有 class="head" 的元素 三. jQuery 事件函数 jQuery 事件处理方法是 jQuery 中的核心函数。 事件处理程序指的是当 HTML 中发生某些事件时所调用的方法。术语...
alone<br>Tomcat install:<br><br>(1) The most common hiccup is when another web server (or any process for that<br> matter) has laid claim to port 8080. This is the default HTTP port that<br> Tomcat ...