semi-sleep

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  17 Posts :: 0 Stories :: 1 Comments :: 0 Trackbacks

1.The anySimpleType are quite special as all primitive type is considered as derived by restriction from anySimpleType, but they are call "primitive" (normally, primitive types don't derive from other). The anySimpleType is the base type for anySimpleType, also for those complex types, note that complex type may be derived by restriction or extension.

2.There are 3 approaches to derive a simple type, by restriction, by list and by union.

3.Finally it says that constraining facet can apply to lexical space.

4.Built-in datatypes contain built-in primitive and built-in derived datatype. Datatypes defined by schema author is call user-derived datatype.

5.Built-in datatypes are put together with other xml schema definitions inside namespace "http://www.w3.org/2001/XMLSchema", also, they are separated and put in namespace "http://www.w3.org/2001/XMLSchema-datatypes".

6.String is consider to have the following aspect:
    normalized - contains return, line feed or tab (preserve or replace)?
    tokenized - is normalized, contains leading or trialing spaces, contains internal sequences of two or more spaces (collapse)?
    contains only name characters (not whitespace) - Name and NMTOKEN
    name characters fall into the following groups: letter, number, other character(. : _ -)
    the first character of a string, : Name(:, _ and letters), NCName (non-colonized name, so only _ and letters), NMTOKEN(any name character is ok)
    string may have external constrains, like ID should be unique, IDREF should refer to an existing ID, ENTITY should refer to an external unparsed entity, QName(qualified name, should has a prefix and a postfix separated by a colon, both prefix and postfix should be NCName, also prefix should be declared as a namespace prefix before)

7.Numbers are falled into 2 groups: finite (float, double, and [unsigned](long|int|short|byte) ), infinite (decimal and [[non]positive|negative]integer). Note that decimal can be any number, why float and double are not derived from decimal?

8.Datatype base64Binary and hexBinary are the same in value space (they are both byte array), but different in lexical space (one is base64 coded, another is hexadecimal coded).

9.For datatypes regarding to time, dateTime, time, date, gYearMonth and gYear represent a exact period, duration represent the length of some period, gMonthDay, gDay and gMonth represents some period that will recur.

10.The built-in datatype hierachy.


11.Fundamental facets describe some properties of a datatype which is readonly, that means each datatype has such properties but you can not modify them, I believe is only useful for describing those built-in datatypes so that they can be mapped to other languages. Here's the fundamental facets: equal, ordered, bounded, cardinality, numeric.

12.Restriction facets are placed inside the <restriction> tag, several facets can be used together. All facets except pattern and enumeration facet have a fixed attribute which denote whether derived datatype can override this attribute. All facets have a value attribute to specify the value. All facets's content text are ignored and used as annotation. Some facets can appear more than once, like pattern and enumeration.
<restriction base="xxx">
    <facet_xxx fix="true|false" value="xxx">annotation</facet_xxx>
</restriction>

13.The whitespace, enumeration and pattern facets apply to all datatypes. The maxExclusive, maxInclusive, minExclusive, minInclusive, totalDigits and fractionDigits apply to number. The length, maxLength, minLength apply to string, list and byte array.

14.Notice the phase base type (for derived by XXX).

For "XML Schema Part 2: Datatypes Second Edition", started at "2.5.2 Primitive vs. derived datatypes", ended before "5 Conformance"

posted on 2008-12-26 16:18 semi-sleep 阅读(248) 评论(0)  编辑  收藏 所属分类: xml

只有注册用户登录后才能发表评论。


网站导航: