semi-sleep

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  17 Posts :: 0 Stories :: 1 Comments :: 0 Trackbacks
1.<unique> acts much like <key> except that <unique> allow value to be null, both require values to be unique with specific scope (under the element which <unique> or <key> is defined). <keyref> can refer to <unique> or <key>, it dose not aware to any scope, so it can be placed anywhere (as long as you can specify <selector>'s xpath). <selector> is used to specify a xpath related to current element to select a list of elements, these elements are in turn used by <field> to extract value. Note that there can be several <field>s, which look like complex primary key in relational database. The "type" and "ref" attribute are namespace awared?

2.Notice the "ref" mode for <element>, <attribute>, <group> and <attributeGroup>, aslo, for <group> the "minOccurs" and "maxOccurs" can only apply to "ref" mode.

3.Notice the "default", "fixed", "form" and "use" attributes of <attribute>

4.About "elementFormDefault", "attributeFormDefault" and "form" attributes, note that these attributes do not apply to global elements or attributes, they should always be qualified with a namespace (either through a prefix or through a default namespace declaration). For local attributes and elements, if "unqualified" is used, they can either be qualified with a namespace or not, but if "qualified" is used, they should always be qualified with correct namespace.

5.Notice the "targetNamespace" of <schema> (what it will affect <include>?) and also the "namespace" of <import>. <import>'s schema location can be omitted? <redefine> acts like <include> expect that it can redefine datatypes and group, note that datatype should always derived from itself, while group should always have exactly one reference to itself. Note that <include>, <redefine>, <import> should be placed in front of other definition.

6.<notation> is same as dtd's notation, and is it useless?

7.The XML Schema Instance namespace (http://www.w3.org/2001/XMLSchema-instance), is different from XML Schema namespace http://www.w3.org/2001/XMLSchema), notice the use of nil, type, schemaLocation, noNamespaceSchemaLocation. These attributes can appear anywhere as long as they are before (or at) the first element to validate, note that if the root element dose not contains schemaLocation attribute, the root element's content is consider to be "skip" (refer to the "processContent" attribute of <any> and <anyAttribute>).

8.Different between prefixed / default / blank namespace.

9.The schemaLocation and noNamespaceSchemaLocation are just suggestion, xml processor can choose to validate any element with any schema it wants.

10.There' no way to force which element should be the root element using schema, specify this information to xml processor.

11.You can use anyType, anySimpleType in "type" or "base" attribute (may others?), anyType allow any content and attribute, while anySimpleType allow any text content. These are called ur-type (ur prefix means origin in German).

12.Schema can be used together with DTD, note that schema can not define entity like dtd.
posted on 2009-01-02 09:51 semi-sleep 阅读(254) 评论(0)  编辑  收藏 所属分类: xml

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


网站导航: