加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

XML构架(转载) XML Schema总结

发布时间:2020-12-16 09:33:28 所属栏目:百科 来源:网络整理
导读:This tutorial has taught you how to describe the structure of an XML document. 这篇教程教你如何描述XML文档的结构 You have learned how to use an XML Schema is to define the legal elements of an XML document,just like a DTD. We think that ve
This tutorial has taught you how to describe the structure of an XML document.
这篇教程教你如何描述XML文档的结构

You have learned how to use an XML Schema is to define the legal elements of an XML document,just like a DTD. We think that very soon XML Schemas will be used in most Web applications as a replacement for DTDs.
你已经学习了怎样使用XML Schema(XML 公式),就是象DTD一样给XML文档定义合法元素。我们认为很快XML Schema(XML 公式)就会取代DTD而被大多数的网络应用程序所使用。
You have also learned that the XML Schema language is very rich. Unlike DTDs,it supports data types and namespaces.
你已经知道了 XML公式语言是很丰富的。和DTD不同,它支持数据类型和名称空间。
For more information on XML Schema,please look at our XML Schema reference.
想更多地了解XML Schema 的信息,请看我们的XML Schema 参考。
Now You Know XML Schema,What's Next?
现在你知道了XML Schema,那接着学什么呢?
The next step is to learn about WSDL.
下步是学习有关WSDL.
WSDL is a schema-based language for describing Web services and how to access them.
WSDL 是描述网络服务以及描述怎样访问它们的一种以schema为基础的语言
WSDL describes a web service,along with the message format and protocol details for the web service.
WSDL描述网络服务,以及与网络服务有关的信息格式和协议细节。
If you want to learn more about WSDL,please visit our WSDL tutorial.
想学习更多与WSDL有关的内容,请浏览我们的WSDL 教程.
XML Schema 参考
w3pop.com / 2006-09-21
XML Schema总结
XSD Elements
XSD元素
Element
元素 Explanation
解释
all Specifies that the child elements can appear in any order. Each child element can occur 0 or 1 time
指明了子元素可以以任意顺序出现,每个子元素出现0到1次
annotation Specifies the top-level element for schema comments
为schema注释指定了最高阶层的元素
any Enables the author to extend the XML document with elements not specified by the schema
让编者能够用没有被schema指定的元素来扩展XML文件
anyAttribute Enables the author to extend the XML document with attributes not specified by the schema
让编者能够用没有被schema指定的属性来扩展XML文件
appInfo Specifies information to be used by the application (must go inside annotation)
指定了将被应用程序所用到的信息(必须在annotation里)
attribute Defines an attribute
定义属性
attributeGroup Defines an attribute group to be used in complex type definitions
定义了用于复合种类定义的属性组
choice Allows only one of the elements contained in the <choice> declaration to be present within the containing element
只允许<choice>声明里的元素里的一个元素出现在所含的元素中。
complexContent Defines extensions or restrictions on a complex type that contains mixed content or elements only
在包含混合内容和元素的复合类型(complex type)上定义扩展或限制
complexType Defines a complex type element
定义了复合类型元素(complex type element)
documentation Defines text comments in a schema (must go inside annotation)
定义了schema里的文本注释(必须在annotation里)
element Defines an element
定义元素
extension Extends an existing simpleType or complexType element
扩展一个现存的简单类型或复合类型元素
field Specifies an XPath expression that specifies the value used to define an identity constraint
指明一个XPath表达式,以指明用于定义身份约束的值
group Defines a group of elements to be used in complex type definitions
定义了将用于复合类型说明的一组元素
import Adds multiple schemas with different target namespace to a document
用不同的目标名称空间把多项schema添加到一份文件
include Adds multiple schemas with the same target namespace to a document
用同一目标名称空间把多项schema添加到文件
key Specifies an attribute or element value as a key (unique,non-nullable,and always present) within the containing element in an instance document
在实例文档包含的元素里指明某属性或元素值,使它们成为“钥匙”(特殊的,非零的,经常是存在的)
keyref Specifies that an attribute or element value correspond to those of the specified key or unique element
定义用于回应已指明关键或特殊元素的属性或元素值
list Defines a simple type element as a list of values
一张值的列表的形式定义一个简单类型元素
notation Describes the format of non-XML data within an XML document
描述在XML文档里的非XML形式数据的格式
redefine Redefines simple and complex types,groups,and attribute groups from an external schema
从外部的schema中重新定义简单和复合类型,群,以及属性群
restriction Defines restrictions on a simpleType,simpleContent,or a complexContent
在简单类型,简单文本或复合文本上定义约束
schema Defines the root element of a schema
定义schema的根元素
selector Specifies an XPath expression that selects a set of elements for an identity constraint
指明一段可为身份约束选择一组节点的XPath表达
sequence Specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times
指明了子元素必须以一定顺序出现。每个子元素可以出现任意次
simpleContent Contains extensions or restrictions on a text-only complex type or on a simple type as content and contains no elements
包含着作为只有文本的复合类型或简单类型的文本的扩展和约束,不包含元素
simpleType Defines a simple type and specifies the constraints and information about the values of attributes or text-only elements
定义了简单类型,指定了关于属性值或只有文本的元素的信息
union Defines a simple type as a collection (union) of values from specified simple data types
从已指定的简单数据类型里定义简单种类,作为值的集合
unique Defines that an element or an attribute value must be unique within the scope
定义了在所属范围内一个元素或属性值必须是独特(没有重复的)
XSD Restrictions/Facets for Datatypes
XSD对各种数据类型的约束
Look at XSD Restrictions!
下面看一看关于XSD的约束
Constraint
约束 Description
描述
enumeration Defines a list of acceptable values
定义了一系列可接受的属性的值
fractionDigits Specifies the maximum number of decimal places allowed. Must be equal to or greater than zero
指明了所允许的最多小数位数。必须等于大于0
length Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero
指明了所允许的字符或列表项的确切个数。必须等于大于零
maxExclusive Specifies the upper bounds for numeric values (the value must be less than this value)
指明了最大数值(数值必须小于最大数值)
maxInclusive Specifies the upper bounds for numeric values (the value must be less than or equal to this value)
指明了数值

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读