Chinaunix首页 | 论坛 | 博客
  • 博客访问: 13895
  • 博文数量: 12
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 125
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-19 15:05
文章分类

全部博文(12)

文章存档

2011年(1)

2009年(11)

我的朋友
最近访客

分类: 系统运维

2009-08-28 10:56:58

XML Schema any 元素


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 浏览:1311 :: ::

Definition and Usage
定义和用法

The any element enables the author to extend the XML document with elements not specified by the schema.
any元素可以让代码设计者使用未被schema指定的元素来扩展XML文档。

Element Information
元素信息

  • Parent elements: choice, sequence
    父类信息:选择、序列

Syntax
语法

any attributes
>
(annotation?)

(The ? sign declares that the element can occur zero or one time inside the any element)
“?”符号用于声明元素在any元素中允许出现的次数(0次或1次)

属性 描述
id Optional. Specifies a unique ID for the element
可选参数。为元素指定一个独立的ID
maxOccurs Optional. Specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1
可选参数。指定any元素在父类元素中出现的最大次数。其值可以大于等于0;或者,如果你不希望对最大值进行限制,可以使用“unbounded”。默认值是1
minOccurs Optional. Specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1
可选参数。指定any元素在父类元素中出现的最小次数。其值可以大于等于0。默认值是1
namespace

Optional. Specifies the namespaces containing the elements that can be used. Can be set to one of the following:

可选参数。指定可以使用包含元素的命名空间。可以是下列值之一:

  • ##any - elements from any namespace is allowed (this is default)
    ##any - 允许来自于任何命名空间的元素(默认值)
  • ##other - elements from any namespace that is not the namespace of the parent element can be present
    ##other - 可以使用非父类元素命名空间中的元素
  • ##local - elements must come from no namespace
    ##local - 非命名空间元素
  • ##targetNamespace - elements from the namespace of the parent element can be present
    ##targetNamespace - 可以使用父类元素命名空间中的元素
  • List of {URI references of namespaces, ##targetNamespace, ##local} - elements from a space-delimited list of the namespaces can be present
    {URI 命名空间参数、##targetNamespace、##local} 列表 - 可以使用命名空间的空格定界符列表中的元素
processContents

Optional. Specifies how the XML processor should handle validation against the elements specified by this any element. Can be set to one of the following:

可选参数。指定XML处理器处理元素有效性的方式。可以是下列值之一:

  • strict - the XML processor must obtain the schema for the required namespaces and validate the elements (this is default)
    strict [严格] - XML处理器必须包含必要命名空间的schema,并验证元素的有效性(默认值)
  • lax - same as strict but; if the schema cannot be obtained, no errors will occur
    lax [不严格] - 功能于strict相同,但是,如果不能包含schema,也不会产生错误信息
  • skip - The XML processor does not attempt to validate any elements from the specified namespaces
    skip [跳过] - XML处理器不验证来自于指定命名空间的任何元素
any attributes Optional. Specifies any other attributes with non-schema namespace
可选参数。指定非schema命名空间的其它属性

Example 1
案例1

The following example shows a declaration for an element called "person". By using the element the author can extend (after ) the content of "person" with any element:
下面的案例声明了一个名为“person”的元素。通过使用元素,代码设计者可以(在元素之后)扩展所有元素中的“person”内容:


  
    
      
      
      
    
  

阅读(482) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~