总结:

1、schema本身就是一个XML文件

2、schema功能比DTD强大,正逐步替代DTD

3、schema的根元素固定为schema

4、schema文档定义完毕后,需要绑定到一个URI地址上,这个地址称为名称空间

5、定义XML文档时,

需要在Xml文档中的根结点中使用schemaLocation属性来指定它所遵循的Schema文件的具体位置。

schemaLocation此属性有两个值。第一个值是需要使用的命名空间。第二个值是供命名空间使

用的 XML schema 的位置,两者之间用空格分隔

6、定义XML文档时,可以使用默认的名称空间,声明方式为

<根元素 xmlns="uri">

<子元素></子元素>

</根元素>

7、根据schema书写xml的步骤

a、xml声明

<?xml version="1.0" encoding="gbk"?>

b、查看schema文档,找出根元素(第一个element声明),并编写根元素的起始标签

<?xml version="1.0" encoding="gbk"?>

<shiporder></shiporder>

c、在根元素的开始标签中用xmlns声明来源的名称空间(查看schema文档,找targetNamespace

的取值)

<?xml version="1.0" encoding="gbk"?>

<shiporder xmlns="http://www.itcast.cn"></shiporder>

d、用schemaLocation关联名称空间和xsd文件

<?xml version="1.0" encoding="gbk"?>

<shiporder xmlns="http://www.itcast.cn"

schemaLocation="http://www.itcast.cn shiporder.xsd"></shiporder>

e、schemaLocation从哪里来的,声明一个标准的名称空间

xmlns:xi="http://www.w3.org/2001/XMLSchema-instance"

<?xml version="1.0" encoding="gbk"?>

<shiporder xmlns="http://www.itcast.cn"

xmlns:xi="http://www.w3.org/2001/XMLSchema-instance"

xi:schemaLocation="http://www.itcast.cn shiporder.xsd">

.....

</shiporder>

f、编写其他的子元素

(转)Schema的更多相关文章

  1. [MySQL Reference Manual] 23 Performance Schema结构

    23 MySQL Performance Schema 23 MySQL Performance Schema 23.1 性能框架快速启动 23.2 性能框架配置 23.2.1 性能框架编译时配置 2 ...

  2. Referenced file contains errors (http://www.springframework.org/schema...错误

    Referenced file contains errors (http://www.springframework.org/schema...错误 Referenced file contains ...

  3. jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the install tool.

    jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the ...

  4. 高性能MySQL(四):schema陷阱

    一.schema陷阱 二.缓存表和汇总表 三.范式和反范式

  5. XmlValidationHelper XSD、Schema(XmlSchemaSet)、XmlReader(XmlValidationSettings)、XmlDocument、XDocument Validate

    namespace Test { using Microshaoft; using System; using System.Xml; using System.Xml.Linq; class Pro ...

  6. solr schema.xml文档节点配置

    首先,讲解一下/usr/local/solr/collection1/conf/schema.xml的配置,此文档功能类似于配置索引数据库. Field:类似于数据库字段的属性(此文统一使用用“字段” ...

  7. Referenced file contains errors (http://www.springframework.org/schema/context). For more information, right click on the message in the Problems

    spring 配置文件的DTD或schema出问题,一般两种情况: 1.当前网络环境不稳定,按住ctrl+"http://www.springframework.org/schema/con ...

  8. DAC Usage2:通过DAC实现DB Schema的Migration和Upgrade

    一,Introduce Extract DAC 是从现存的DB中创建DAC,抽取DB Object的definition 和 与之相关的实例级别的元素,比如Login,以及Login 和User之间的 ...

  9. Security3: Schema 和 Permission

    Schema是Object的容器,授予对Schema访问的权限,就是授予对Schema下所有object的访问权限. 一,Schema 是object的container The new schema ...

  10. 无法为目标平台“Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider”创建扩展管理器

    很久没写博客了,这段时间情绪不那么稳定,还是心态的问题... 就简单写个问题的解决方法吧,其实最近遇到的问题蛮多的,就拿这个解决过后又遇到的来写吧. 正如标题一样:VS2013 无法为目标平台“Mic ...

随机推荐

  1. 仿flash轮播

    <!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title> ...

  2. [Lucene]-Lucene基本概述以及简单实例

    一.Lucene基本介绍: 基本信息:Lucene 是 Apache 软件基金会的一个开放源代码的全文检索引擎工具包,是一个全文检索引擎的架构,提供了完整的查询引擎和索引引擎,部分文本分析引擎.Luc ...

  3. Step by Step 用Azure Automation 来开虚机(ARM)

    使用Azure Automation来自动化处理各种重复的耗时的云管理任务从而帮助云运维人员提升效率,帮助降低运营成本. 具体相关的介绍以及怎样利用Azure Automation来完成定期开关虚拟机 ...

  4. ionic+AnjularJs实现省市县三级联动效果

    建议对ionic和AnjularJs有一定了解的人可以用到,很多时候我们要用到选择省份.城市.区县的功能,现在就跟着我来实现这个功能吧,用很少的代码(我这里是根据客户的要求,只显示想要显示的部分省份和 ...

  5. ecshop循环计数

    循环依次递增+1 <!-- {foreach from=$comments item=comment name=comment} --> {$smarty.foreach.comment. ...

  6. js返回顶部封装 简洁

    js返回顶部封装 简洁: 加入html页面body最后面即可. <script> a(); function a() { $(function() { if ($(".j-to- ...

  7. php数组根据某键值,把相同键值的合并最终生成一个新的二维数组

    <?php $a=array( '0'=>array( 'id'=>'1', 'names'=>'jack', '0'=>'sendone' ), '1'=>arr ...

  8. linux服务器load的含义

    Linux的Load(系统负载),是一个让新手不太容易了解的概念.load的就是一定时间内计算机有多少个active_tasks,也就是说是计算机的任务执行队列的长度,cpu计算的队列. top/up ...

  9. 【LeetCode】327. Count of Range Sum

    题目: Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusiv ...

  10. Sublime text3插件安装方法

    一.安装sublime text3插件的方法: 1.Ctrl+~键,调出console,将下面代码复制到底部命令行,回车: import urllib.request,os; pf = 'Packag ...