当前位置: 首页 > 网络学院 > XML相关教程 > Schema (XSD) > XSD 逻辑值数据类型

Schema (XSD)
Schema (XSD) 介绍
为何使用 XML Schemas?
如何定制 XSD
XSD - <schema>元素
XSD 简单元素
XSD 属性
XSD 约束面
XSD 复合元素
XSD 复合空元素
XSD 复合纯元素
XSD 复合纯文本
XSD 混合内容的复合类型
XSD 指示器复合类型
XSD <any> 元素
XSD <anyAttribute> 元素
XSD 元素替代
XSD 实例
XSD 字符串数据类型
XSD 日期数据类型
XSD 小数数据类型

Schema (XSD) 中的 XSD 逻辑值数据类型


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 673 ::
收藏到网摘: n/a

Other miscellaneous data types are boolean, base64Binary, hexBinary, float, double, anyURI, QName, and NOTATION.
其它混合数据类型包括逻辑值(boolean)、基本的64个二进制数、十六进制数、浮点精度小数、双精度数、anyURI、QName和符号。


Boolean Data Type
逻辑数据类型

The boolean data type is used to specify a true or false value.
逻辑数据类型用于指定值的真或假。

The following is an example of a boolean declaration in a schema:
下面列举了在schema中逻辑声明的案例:

<xs:attribute name="disabled" type="xs:boolean"/>

An element in your document might look like this:
在你的文档中或许包含下述这样的元素:

<prize disabled="true">999</prize>

Note: Legal values for boolean are true, false, 1 (which indicates true), and 0 (which indicates false).
注意:合法的逻辑值是真、假;1(表示真)、0(表示假)。


Binary Data Types
二进制数据类型

Binary data types are used to express binary-formatted data.
二进制数据用于表示二进制数据。

We have two binary data types:
我们拥有两种二进制数据类型:

  • base64Binary (Base64-encoded binary data)
    基础64二进制(基于64位码的二进制数据)
  • hexBinary (hexadecimal-encoded binary data)
    16进制(16进制编码的二进制数据)

The following is an example of a hexBinary declaration in a schema:
下面列举了十六进制数在schema中的声明方法:

<xs:element name="blobsrc" type="xs:hexBinary"/>

 


AnyURI Data Type
anyURI 数据类型

The anyURI data type is used to specify a URI.
anyURI 数据类型用于指定一个URI。

The following is an example of an anyURI declaration in a schema:
下面列举了关于anyURI在schema中的声明方法:

<xs:attribute name="src" type="xs:anyURI"/>

An element in your document might look like this:
在你的文档中可能包含下面这个元素:

<pic src="http://www.w3schools.com/images/smiley.gif" />

Note: If a URI has spaces, replace them with %20.
注意:如果URI包含空格,可以使用 “%20” 替代它们。


Miscellaneous Data Types
混合数据类型

Name
名称
Description
描述
anyURI  
base64Binary  
boolean  
double  
float  
hexBinary  
NOTATION  
QName  

 


Restrictions on Miscellaneous Data Types
混合数据类型的约束

Restrictions that can be used with the other data types:
可用于约束的其它数据类型如下:

  • enumeration (a Boolean data type cannot use this constraint)
    列举(不能用此约束逻辑数据类型)
  • length (a Boolean data type cannot use this constraint)
    长度(不能用此约束逻辑数据类型)
  • maxLength (a Boolean data type cannot use this constraint)
    最大长度(不能用此约束逻辑数据类型)
  • minLength (a Boolean data type cannot use this constraint)
    最短长度(不能用此约束逻辑数据类型)
  • pattern
    式样
  • whiteSpace
    空白

评论 (0) All

登陆 | 还没注册?