当前位置: 首页 > 网络学院 > XML相关教程 > Schema (XSD) > XML Schema 参考
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) 指定了应用程序所使用的信息(必须写在注释里) |
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 在包含混合内容和元素的复合类型中定义扩展或约束条件 |
complexType | Defines a complex type element 定义一个复合类型元素 |
documentation | Defines text comments in a schema (must go inside annotation) 定义一个位于schema内的文本注释(必须写在注释里) |
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 定义在所属范围内一个元素值或属性值必须是独立的(未重复的) |
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) 指定了数值上限(数值必须小于等于数值上限) |
maxLength | Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero 指定了允许使用的字符或列表项的最大个数。必须大于等于0 |
minExclusive | Specifies the lower bounds for numeric values (the value must be greater than this value) 指定了数值的下限(数值必须大于数值下限) |
minInclusive | Specifies the lower bounds for numeric values (the value must be greater than or equal to this value) 指定了数值的下限(数值要大于等于数值下限) |
minLength | Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero 指定了允许使用的字符和列表项的最小个数。必须大于等于0个 |
pattern | Defines the exact sequence of characters that are acceptable 定义了可接受字符的精确序列 |
totalDigits | Specifies the exact number of digits allowed. Must be greater than zero 定义了允许使用的阿拉伯数字的精确个数。必须大于0 |
whiteSpace | Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled 定义了各种空白符(包括:换行符、制表符、空格、回车符)的处理方法 |