Network Working Group S. Legg Request for Comments: 4910 eB2Bcom Category: Experimental D. Prager July 2007
Network Working Group S. Legg Request for Comments: 4910 eB2Bcom Category: Experimental D. Prager July 2007
Robust XML Encoding Rules (RXER) for Abstract Syntax Notation One (ASN.1)
抽象语法表示法1(ASN.1)的健壮XML编码规则(RXER)
Status of This Memo
关于下段备忘
This memo defines an Experimental Protocol for the Internet community. It does not specify an Internet standard of any kind. Discussion and suggestions for improvement are requested. Distribution of this memo is unlimited.
这份备忘录为互联网社区定义了一个实验性协议。它没有规定任何类型的互联网标准。要求进行讨论并提出改进建议。本备忘录的分发不受限制。
Copyright Notice
版权公告
Copyright (C) The IETF Trust (2007).
版权所有(C)IETF信托基金(2007年)。
Abstract
摘要
This document defines a set of Abstract Syntax Notation One (ASN.1) encoding rules, called the Robust XML Encoding Rules or RXER, that produce an Extensible Markup Language (XML) representation for values of any given ASN.1 data type. Rules for producing a canonical RXER encoding are also defined.
本文档定义了一组抽象语法表示法1(ASN.1)编码规则,称为健壮XML编码规则或RXER,它为任何给定ASN.1数据类型的值生成可扩展标记语言(XML)表示。还定义了用于生成规范RXER编码的规则。
Table of Contents
目录
1. Introduction ....................................................3 2. Conventions .....................................................4 3. Definitions .....................................................5 4. Additional Basic Types ..........................................6 4.1. The Markup Type ............................................6 4.1.1. Self-Containment ....................................9 4.1.2. Normalization for Canonical Encoding Rules .........12 4.2. The AnyURI Type ...........................................13 4.3. The NCName Type ...........................................14 4.4. The Name Type .............................................14 4.5. The QName Type ............................................14 5. Expanded Names for ASN.1 Types .................................15 6. Encoding Rules .................................................17 6.1. Identifiers ...............................................19 6.2. Component Encodings .......................................20 6.2.1. Referenced Components ..............................20 6.2.2. Element Components .................................20 6.2.2.1. Namespace Properties for Elements .........22 6.2.2.2. Namespace Prefixes for Element Names ......24 6.2.3. Attribute Components ...............................25 6.2.3.1. Namespace Prefixes for Attribute Names ....26 6.2.4. Unencapsulated Components ..........................26 6.2.5. Examples ...........................................27 6.3. Standalone Encodings ......................................28 6.4. Embedded ASN.1 Values .....................................28 6.5. Type Referencing Notations ................................32 6.6. TypeWithConstraint, SEQUENCE OF Type, and SET OF Type .....33 6.7. Character Data Translations ...............................34 6.7.1. Restricted Character String Types ..................35 6.7.2. BIT STRING .........................................36 6.7.3. BOOLEAN ............................................38 6.7.4. ENUMERATED .........................................38 6.7.5. GeneralizedTime ....................................39 6.7.6. INTEGER ............................................41 6.7.7. NULL ...............................................42 6.7.8. ObjectDescriptor ...................................43 6.7.9. OBJECT IDENTIFIER and RELATIVE-OID .................43 6.7.10. OCTET STRING ......................................43 6.7.11. QName .............................................44 6.7.11.1. Namespace Prefixes for Qualified Names ...44 6.7.12. REAL ..............................................45 6.7.13. UTCTime ...........................................46 6.7.14. CHOICE as UNION ...................................47 6.7.15. SEQUENCE OF as LIST ...............................50 6.8. Combining Types ...........................................50 6.8.1. CHARACTER STRING ...................................51
1. Introduction ....................................................3 2. Conventions .....................................................4 3. Definitions .....................................................5 4. Additional Basic Types ..........................................6 4.1. The Markup Type ............................................6 4.1.1. Self-Containment ....................................9 4.1.2. Normalization for Canonical Encoding Rules .........12 4.2. The AnyURI Type ...........................................13 4.3. The NCName Type ...........................................14 4.4. The Name Type .............................................14 4.5. The QName Type ............................................14 5. Expanded Names for ASN.1 Types .................................15 6. Encoding Rules .................................................17 6.1. Identifiers ...............................................19 6.2. Component Encodings .......................................20 6.2.1. Referenced Components ..............................20 6.2.2. Element Components .................................20 6.2.2.1. Namespace Properties for Elements .........22 6.2.2.2. Namespace Prefixes for Element Names ......24 6.2.3. Attribute Components ...............................25 6.2.3.1. Namespace Prefixes for Attribute Names ....26 6.2.4. Unencapsulated Components ..........................26 6.2.5. Examples ...........................................27 6.3. Standalone Encodings ......................................28 6.4. Embedded ASN.1 Values .....................................28 6.5. Type Referencing Notations ................................32 6.6. TypeWithConstraint, SEQUENCE OF Type, and SET OF Type .....33 6.7. Character Data Translations ...............................34 6.7.1. Restricted Character String Types ..................35 6.7.2. BIT STRING .........................................36 6.7.3. BOOLEAN ............................................38 6.7.4. ENUMERATED .........................................38 6.7.5. GeneralizedTime ....................................39 6.7.6. INTEGER ............................................41 6.7.7. NULL ...............................................42 6.7.8. ObjectDescriptor ...................................43 6.7.9. OBJECT IDENTIFIER and RELATIVE-OID .................43 6.7.10. OCTET STRING ......................................43 6.7.11. QName .............................................44 6.7.11.1. Namespace Prefixes for Qualified Names ...44 6.7.12. REAL ..............................................45 6.7.13. UTCTime ...........................................46 6.7.14. CHOICE as UNION ...................................47 6.7.15. SEQUENCE OF as LIST ...............................50 6.8. Combining Types ...........................................50 6.8.1. CHARACTER STRING ...................................51
6.8.2. CHOICE .............................................51 6.8.3. EMBEDDED PDV .......................................52 6.8.4. EXTERNAL ...........................................52 6.8.5. INSTANCE OF ........................................52 6.8.6. SEQUENCE and SET ...................................52 6.8.7. SEQUENCE OF and SET OF .............................54 6.8.8. Extensible Combining Types .........................55 6.8.8.1. Unknown Elements in Extensions ............55 6.8.8.2. Unknown Attributes in Extensions ..........59 6.9. Open Type .................................................60 6.10. Markup ...................................................61 6.11. Namespace Prefixes for CRXER .............................63 6.12. Serialization ............................................65 6.12.1. Non-Canonical Serialization .......................65 6.12.2. Canonical Serialization ...........................68 6.12.3. Unicode Normalization in XML Version 1.1 ..........70 6.13. Syntax-Based Canonicalization ............................70 7. Transfer Syntax Identifiers ....................................71 7.1. RXER Transfer Syntax ......................................71 7.2. CRXER Transfer Syntax .....................................71 8. Relationship to XER ............................................71 9. Security Considerations ........................................73 10. Acknowledgements ..............................................74 11. IANA Considerations ...........................................75 12. References ....................................................75 12.1. Normative References .....................................75 12.2. Informative References ...................................77 Appendix A. Additional Basic Definitions Module ...................78
6.8.2. CHOICE .............................................51 6.8.3. EMBEDDED PDV .......................................52 6.8.4. EXTERNAL ...........................................52 6.8.5. INSTANCE OF ........................................52 6.8.6. SEQUENCE and SET ...................................52 6.8.7. SEQUENCE OF and SET OF .............................54 6.8.8. Extensible Combining Types .........................55 6.8.8.1. Unknown Elements in Extensions ............55 6.8.8.2. Unknown Attributes in Extensions ..........59 6.9. Open Type .................................................60 6.10. Markup ...................................................61 6.11. Namespace Prefixes for CRXER .............................63 6.12. Serialization ............................................65 6.12.1. Non-Canonical Serialization .......................65 6.12.2. Canonical Serialization ...........................68 6.12.3. Unicode Normalization in XML Version 1.1 ..........70 6.13. Syntax-Based Canonicalization ............................70 7. Transfer Syntax Identifiers ....................................71 7.1. RXER Transfer Syntax ......................................71 7.2. CRXER Transfer Syntax .....................................71 8. Relationship to XER ............................................71 9. Security Considerations ........................................73 10. Acknowledgements ..............................................74 11. IANA Considerations ...........................................75 12. References ....................................................75 12.1. Normative References .....................................75 12.2. Informative References ...................................77 Appendix A. Additional Basic Definitions Module ...................78
This document defines a set of Abstract Syntax Notation One (ASN.1) [X.680] encoding rules, called the Robust XML Encoding Rules or RXER, that produce an Extensible Markup Language (XML) [XML10][XML11] representation of ASN.1 values of any given ASN.1 type.
本文档定义了一组抽象语法表示法1(ASN.1)[X.680]编码规则,称为健壮XML编码规则或RXER,用于生成任何给定ASN.1类型的ASN.1值的可扩展标记语言(XML)[XML10][XML11]表示。
An ASN.1 value is regarded as analogous to the content and attributes of an XML element, or in some cases, just an XML attribute value. The RXER encoding of an ASN.1 value is the well-formed and valid content and attributes of an element, or an attribute value, in an XML document [XML10][XML11] conforming to XML namespaces [XMLNS10][XMLNS11]. Simple ASN.1 data types such as PrintableString, INTEGER, and BOOLEAN define character data content or attribute values, while the ASN.1 combining types (i.e., SET, SEQUENCE, SET OF, SEQUENCE OF, and CHOICE) define element content and attributes. The attribute and child element names are generally provided by the identifiers of the components in combining type definitions, i.e., elements and attributes correspond to the NamedType notation.
ASN.1值被视为类似于XML元素的内容和属性,或者在某些情况下,只是一个XML属性值。ASN.1值的RXER编码是符合XML名称空间[XMLNS10][XMLNS11]的XML文档[XML10][XML11]中元素或属性值的格式良好且有效的内容和属性。简单的ASN.1数据类型(如PrintableString、INTEGER和BOOLEAN)定义字符数据内容或属性值,而ASN.1组合类型(即SET、SEQUENCE、SET OF、SEQUENCE OF和CHOICE)定义元素内容和属性。属性和子元素名称通常由组合类型定义的组件标识符提供,即元素和属性对应于NamedType表示法。
RXER leaves some formatting details to the discretion of the encoder, so there is not a single unique RXER encoding for an ASN.1 value. However, this document also defines a restriction of RXER, called the Canonical Robust XML Encoding Rules (CRXER), which does produce a single unique encoding for an ASN.1 value. Obviously, the CRXER encoding of a value is also a valid RXER encoding of that value. The restrictions on RXER to produce the CRXER encoding are interspersed with the description of the rules for RXER.
RXER将一些格式细节留给编码器处理,因此ASN.1值没有一个唯一的RXER编码。但是,本文还定义了RXER的一个限制,称为规范健壮XML编码规则(CRXER),它确实为ASN.1值生成了一个唯一的编码。显然,值的CRXER编码也是该值的有效RXER编码。RXER生成CRXER编码的限制与RXER规则的描述相互交织。
Note that "ASN.1 value" does not mean a Basic Encoding Rules (BER) [X.690] encoding. The ASN.1 value is an abstract concept that is independent of any particular encoding. BER is just one possible way to encode an ASN.1 value. This document defines an alternative way to encode an ASN.1 value.
请注意,“ASN.1值”并不意味着基本编码规则(BER)[X.690]编码。ASN.1值是一个抽象概念,独立于任何特定编码。BER只是编码ASN.1值的一种可能方式。本文档定义了一种对ASN.1值进行编码的替代方法。
A separate document [RXEREI] defines encoding instructions [X.680-1] that may be used in an ASN.1 specification to modify how values are encoded in RXER, for example, to encode a component of a combining ASN.1 type as an attribute rather than as a child element. A pre-existing ASN.1 specification will not have RXER encoding instructions, so any mention of encoding instructions in this document can be ignored when dealing with such specifications. Encoding instructions for other encoding rules have no effect on RXER encodings.
单独的文档[RXEREI]定义了编码指令[X.680-1],可在ASN.1规范中使用该指令来修改RXER中值的编码方式,例如,将组合ASN.1类型的组件编码为属性而不是子元素。预先存在的ASN.1规范不会有RXER编码指令,因此在处理此类规范时,可以忽略本文档中提及的任何编码指令。其他编码规则的编码指令对RXER编码没有影响。
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in BCP 14, RFC 2119 [BCP14]. The key word "OPTIONAL" is exclusively used with its ASN.1 meaning.
本文件中的关键词“必须”、“不得”、“要求”、“应”、“不得”、“应”、“不应”、“建议”和“可”应按照BCP 14、RFC 2119[BCP14]中的说明进行解释。关键词“可选”仅用于其ASN.1含义。
A reference to an ASN.1 production [X.680] (e.g., Type, NamedType) is a reference to the text in an ASN.1 specification corresponding to that production.
对ASN.1产品[X.680](例如,Type,NamedType)的引用是对ASN.1规范中与该产品对应的文本的引用。
The specification of RXER makes use of definitions from the XML Information Set (Infoset) [INFOSET]. In particular, information item property names follow the Infoset convention of being shown in square brackets, e.g., [local name]. Literal values of Infoset properties are enclosed in double quotes; however, the double quotes are not part of the property values. In the sections that follow, "information item" will be abbreviated to "item", e.g., "element information item" is abbreviated to "element item". The term "element" or "attribute" (without the "item") is referring to an element or attribute in an XML document, rather than an information item.
RXER规范使用XML信息集(Infoset)[Infoset]中的定义。特别是,信息项属性名称遵循信息集惯例,即显示在方括号中,例如[local name]。信息集属性的文字值用双引号括起来;但是,双引号不是属性值的一部分。在接下来的章节中,“信息项”将缩写为“项”,例如,“要素信息项”缩写为“要素项”。术语“元素”或“属性”(不带“项”)指的是XML文档中的元素或属性,而不是信息项。
Literal character strings to be used in an RXER encoding appear within double quotes; however, the double quotes are not part of the literal value and do not appear in the encoding.
RXER编码中使用的文字字符串出现在双引号内;但是,双引号不是文字值的一部分,也不会出现在编码中。
This document uses the namespace prefix [XMLNS10][XMLNS11] "asnx:" to stand for the namespace name "urn:ietf:params:xml:ns:asnx", uses the namespace prefix "xs:" to stand for the namespace name "http://www.w3.org/2001/XMLSchema", and uses the namespace prefix "xsi:" to stand for the namespace name "http://www.w3.org/2001/XMLSchema-instance". However, in practice, any valid namespace prefixes are permitted in non-canonical RXER encodings (namespace prefixes are deterministically generated for CRXER).
本文档使用名称空间前缀[XMLNS10][XMLNS11]“asnx:”表示名称空间名称“urn:ietf:params:xml:ns:asnx”,使用名称空间前缀“xs:”表示名称空间名称”http://www.w3.org/2001/XMLSchema,并使用命名空间前缀“xsi:”表示命名空间名称http://www.w3.org/2001/XMLSchema-instance". 然而,在实践中,在非规范RXER编码中允许使用任何有效的名称空间前缀(名称空间前缀是为CRXER确定生成的)。
The encoding instructions [X.680-1] referenced by name in this specification are encoding instructions for RXER [RXEREI].
本规范中名称引用的编码指令[X.680-1]是RXER[RXEREI]的编码指令。
Throughout this document, references to the Markup, AnyURI, NCName, Name, and QName ASN.1 types are references to the types described in Section 4 and consolidated in the AdditionalBasicDefinitions module in Appendix A. Any provisions associated with the reference do not apply to types defined in other ASN.1 modules that happen to have these same names.
在本文档中,对标记、AnyURI、NCName、Name、,和QName ASN.1类型是对第4节所述类型的引用,并合并在附录A的AdditionalBasicDefinitions模块中。与引用相关的任何规定不适用于其他ASN.1模块中定义的碰巧具有相同名称的类型。
Code points for characters [UCS][UNICODE] are expressed using the Unicode convention U+n, where n is four to six hexadecimal digits, e.g., the space character is U+0020.
字符[UCS][UNICODE]的代码点使用UNICODE约定U+n表示,其中n是四到六个十六进制数字,例如,空格字符是U+0020。
Definition (white space character): A white space character is a space (U+0020), tab (U+0009), carriage return (U+000D), or line feed (U+000A) character.
定义(空白字符):空白字符是空格(U+0020)、制表符(U+0009)、回车符(U+000D)或换行符(U+000A)。
Definition (white space): White space is a sequence of one or more white space characters.
定义(空白):空白是一个或多个空白字符的序列。
Definition (line break): A line break is any sequence of characters that is normalized to a line feed by XML End-of-Line Handling [XML10][XML11].
定义(换行符):换行符是由XML行尾处理[XML10][XML11]规范化为换行符的任何字符序列。
Definition (serialized white space): Serialized white space is a sequence of one or more white space characters and/or line breaks.
定义(序列化空白):序列化空白是一个或多个空白字符和/或换行符的序列。
Definition (declaring the default namespace): A namespace declaration attribute item is declaring the default namespace if the [prefix] of the attribute item has no value, the [local name] of the attribute item is "xmlns" and the [normalized value] is not empty.
定义(声明默认名称空间):如果属性项的[prefix]没有值,属性项的[local name]为“xmlns”,并且[normalized value]不为空,则名称空间声明属性项声明默认名称空间。
Definition (undeclaring the default namespace): A namespace declaration attribute item is undeclaring the default namespace if the [prefix] of the attribute item has no value, the [local name] of the attribute item is "xmlns" and the [normalized value] is empty (i.e., xmlns="").
定义(取消声明默认名称空间):如果属性项的[prefix]没有值,属性项的[local name]为“xmlns”,且[normalized value]为空(即xmlns=”“),则名称空间声明属性项取消声明默认名称空间。
Definition (canonical namespace prefix): A canonical namespace prefix is an NCName [XMLNS10] beginning with the letter 'n' (U+006E) followed by a non-negative number string. A non-negative number string is either the digit character '0' (U+0030), or a non-zero decimal digit character (U+0031-U+0039) followed by zero, one, or more of the decimal digit characters '0' to '9' (U+0030-U+0039).
定义(规范名称空间前缀):规范名称空间前缀是一个NCName[XMLNS10],以字母“n”(U+006E)开头,后跟一个非负数字符串。非负数字符串是数字字符“0”(U+0030)或非零十进制数字字符(U+0031-U+0039),后跟零、一个或多个十进制数字字符“0”至“9”(U+0030-U+0039)。
For convenience, a CHOICE type where the ChoiceType is subject to a UNION encoding instruction will be referred to as a UNION type, and a SEQUENCE OF type where the SequenceOfType is subject to a LIST encoding instruction will be referred to as a LIST type.
为方便起见,ChoiceType服从联合编码指令的选择类型将被称为联合类型,SequenceOfType服从列表编码指令的类型序列将被称为列表类型。
This section defines an ASN.1 type for representing markup in abstract values, as well as basic types that are useful in encoding instructions [RXEREI] and other related specifications [ASN.X].
本节定义了一个ASN.1类型,用于在抽象值中表示标记,以及在编码指令[RXEREI]和其他相关规范[ASN.X]时有用的基本类型。
The ASN.1 definitions in this section are consolidated in the AdditionalBasicDefinitions ASN.1 module in Appendix A.
本节中的ASN.1定义合并在附录A的附加基本定义ASN.1模块中。
A value of the Markup ASN.1 type holds the [prefix], [attributes], [namespace attributes], and [children] of an element item, i.e., the content and attributes of an element.
Markup ASN.1类型的值包含元素项的[prefix]、[attributes]、[namespace attributes]和[children],即元素的内容和属性。
RXER has special provisions for encoding values of the Markup type (see Section 6.10). For other encoding rules, a value of the Markup type is encoded according to the following ASN.1 type definition (with AUTOMATIC TAGS):
RXER对标记类型的编码值有特殊规定(见第6.10节)。对于其他编码规则,标记类型的值根据以下ASN.1类型定义(使用自动标记)进行编码:
Markup ::= CHOICE { text SEQUENCE { prolog UTF8String (SIZE(1..MAX)) OPTIONAL, prefix NCName OPTIONAL, attributes UTF8String (SIZE(1..MAX)) OPTIONAL, content UTF8String (SIZE(1..MAX)) OPTIONAL } }
Markup ::= CHOICE { text SEQUENCE { prolog UTF8String (SIZE(1..MAX)) OPTIONAL, prefix NCName OPTIONAL, attributes UTF8String (SIZE(1..MAX)) OPTIONAL, content UTF8String (SIZE(1..MAX)) OPTIONAL } }
The text alternative of the Markup CHOICE type provides for the [prefix], [attributes], [namespace attributes], and [children] of an element item to be represented as serialized XML using the UTF-8 character encoding [UTF-8].
标记选择类型的文本替代方案提供了元素项的[prefix]、[attributes]、[namespace attributes]和[children],这些元素项使用UTF-8字符编码[UTF-8]表示为序列化XML。
Aside: The CHOICE allows for one or more alternative compact representations of the content and attributes of an element to be supported in a future specification.
旁白:该选项允许在将来的规范中支持元素的内容和属性的一个或多个替代紧凑表示。
With respect to some element item whose content and attributes are represented by a value of the text alternative of the Markup type:
对于某些元素项,其内容和属性由标记类型的文本替代值表示:
(1) the prolog component of the value contains text that, after line break normalization, conforms to the XML prolog production [XML10][XML11],
(1) 值的prolog组件包含在换行规范化后符合XML prolog产品[XML10][XML11]的文本,
(2) the prefix component is absent if the [prefix] of the element item has no value; otherwise, the prefix component contains the [prefix] of the element item,
(2) 如果元素项的[prefix]没有值,则前缀组件不存在;否则,前缀组件包含元素项的[前缀],
(3) the attributes component of the value contains an XML serialization of the [attributes] and [namespace attributes] of the element item, if any, with each attribute separated from the next by serialized white space, and
(3) 值的attributes组件包含元素项的[attributes]和[namespace attributes]的XML序列化(如果有),每个属性与下一个属性之间用序列化的空格分隔,以及
(4) the content component is absent if the [children] property of the element item is empty; otherwise, the content component of the value contains an XML serialization of the [children] of the element item.
(4) 如果元素项的[children]属性为空,则不存在内容组件;否则,值的内容组件包含元素项的[子项]的XML序列化。
All the components of a value of the Markup type MUST use the same version of XML, either version 1.0 [XML10] or version 1.1 [XML11]. If XML version 1.1 is used, then the prolog component MUST be present and MUST have an XMLDecl for version 1.1. If the prolog component is absent, then XML version 1.0 is assumed.
标记类型的值的所有组件必须使用相同版本的XML,版本1.0[XML10]或版本1.1[XML11]。如果使用XML版本1.1,则prolog组件必须存在,并且对于版本1.1必须具有XMLDecl。如果缺少prolog组件,则假定XML版本为1.0。
If the prefix component is present, then there MUST be a namespace declaration attribute in the attributes component that defines that namespace prefix (since an element whose content and attributes are described by a value of Markup is required to be self-contained; see Section 4.1.1).
如果存在前缀组件,则定义该名称空间前缀的属性组件中必须有名称空间声明属性(因为其内容和属性由标记值描述的元素必须是自包含的;请参见第4.1.1节)。
Note that the prefix component is critically related to the NamedType that has Markup as its type. If a Markup value is extracted from one enclosing abstract value and embedded in another enclosing abstract value (i.e., becomes associated with a different NamedType), then the prefix may no longer be appropriate, in which case it will need to be revised. It may also be necessary to add another namespace
请注意,前缀组件与以标记作为其类型的NamedType密切相关。如果从一个封闭的抽象值中提取标记值并嵌入另一个封闭的抽象值(即,与不同的NamedType关联),则前缀可能不再合适,在这种情况下,需要修改前缀。可能还需要添加另一个名称空间
declaration attribute to the attributes component so as to declare a new namespace prefix.
属性组件的声明属性,以便声明新的命名空间前缀。
Leading and/or trailing serialized white space is permitted in the attributes component. A value of the attributes component consisting only of serialized white space (i.e., no actual attributes) is permitted.
属性组件中允许前导和/或尾随序列化空格。允许属性组件的值仅包含序列化的空白(即,没有实际属性)。
The attributes and content components MAY contain entity references [XML10][XML11]. If any entity references are used (other than references to the predefined entities), then the prolog component MUST be present and MUST contain entity declarations for those entities in the internal or external subset of the document type definition.
属性和内容组件可能包含实体引用[XML10][XML11]。如果使用了任何实体引用(预定义实体的引用除外),则prolog组件必须存在,并且必须在文档类型定义的内部或外部子集中包含这些实体的实体声明。
Example
实例
Given the following ASN.1 module:
给定以下ASN.1模块:
MyModule DEFINITIONS AUTOMATIC TAGS ::= BEGIN
MyModule DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Message ::= SEQUENCE { messageType INTEGER, messageValue Markup }
Message ::= SEQUENCE { messageType INTEGER, messageValue Markup }
ENCODING-CONTROL RXER
编码控制RXER
TARGET-NAMESPACE "http://example.com/ns/MyModule"
TARGET-NAMESPACE "http://example.com/ns/MyModule"
COMPONENT message Message -- a top-level NamedType
组件消息消息——顶级名称类型
END
终止
consider the following XML document:
考虑下面的XML文档:
<?xml version='1.0'?> <!DOCTYPE message [ <!ENTITY TRUE 'true'> ]> <message> <messageType>1</messageType> <messageValue xmlns:ns="http://www.example.com/ABD" ns:foo="1" bar="0"> <this>&TRUE;</this> <that/>
<?xml version='1.0'?> <!DOCTYPE message [ <!ENTITY TRUE 'true'> ]> <message> <messageType>1</messageType> <messageValue xmlns:ns="http://www.example.com/ABD" ns:foo="1" bar="0"> <this>&TRUE;</this> <that/>
</messageValue> </message>
</messageValue> </message>
A Markup value corresponding to the content and attributes of the <messageValue> element is, in ASN.1 value notation [X.680] (where "lf" represents the line feed character):
在ASN.1值表示法[X.680]中,与<messageValue>元素的内容和属性相对应的标记值是(其中“lf”表示换行符):
text:{ prolog { "<?xml version='1.0'?>", lf, "<!DOCTYPE message [", lf, " <!ENTITY TRUE 'true'>", lf, "]>", lf }, attributes { " xmlns:ns=""http://www.example.com/ABD""", lf, " ns:foo=""1"" bar=""0""" }, content { lf, " <this>&TRUE;</this>", lf, " <that/>", lf, " " } }
text:{ prolog { "<?xml version='1.0'?>", lf, "<!DOCTYPE message [", lf, " <!ENTITY TRUE 'true'>", lf, "]>", lf }, attributes { " xmlns:ns=""http://www.example.com/ABD""", lf, " ns:foo=""1"" bar=""0""" }, content { lf, " <this>&TRUE;</this>", lf, " <that/>", lf, " " } }
The following Markup value is an equivalent representation of the content and attributes of the <messageValue> element:
以下标记值是<messageValue>元素的内容和属性的等效表示形式:
text:{ attributes { "bar=""0"" ns:foo=""1"" ", "xmlns:ns=""http://www.example.com/ABD""" }, content { lf, " <this>true</this>", lf, " <that/>", lf, " " } }
text:{ attributes { "bar=""0"" ns:foo=""1"" ", "xmlns:ns=""http://www.example.com/ABD""" }, content { lf, " <this>true</this>", lf, " <that/>", lf, " " } }
By itself, the Markup ASN.1 type imposes no data type restriction on the markup contained by its values and is therefore analogous to the XML Schema anyType [XSD1].
就其本身而言,Markup ASN.1类型不对其值所包含的标记施加数据类型限制,因此类似于XML模式anyType[XSD1]。
There is no ASN.1 basic notation that can directly impose the constraint that the markup represented by a value of the Markup type must conform to the markup allowed by a specific type definition. However, certain encoding instructions (i.e., the reference encoding instructions [RXEREI]) have been defined to have this effect.
没有ASN.1基本表示法可以直接施加约束,即标记类型的值表示的标记必须符合特定类型定义允许的标记。然而,某些编码指令(即,参考编码指令[RXEREI])已被定义为具有此效果。
An element, its attributes and its content, including descendent elements, may contain qualified names [XMLNS10][XMLNS11] as the names of elements and attributes, in the values of attributes, and as character data content of elements. The binding between namespace
元素、其属性及其内容(包括子元素)可能包含限定名[XMLNS10][XMLNS11],作为元素和属性的名称、属性值以及元素的字符数据内容。命名空间之间的绑定
prefix and namespace name for these qualified names is potentially determined by the namespace declaration attributes of ancestor elements (which in the Infoset representation are inherited as namespace items in the [in-scope namespaces]).
这些限定名称的前缀和名称空间名称可能由祖先元素的名称空间声明属性决定(在Infoset表示中,祖先元素作为名称空间项继承到[范围内名称空间])。
In the absence of complete knowledge of the data type of an element item whose content and attributes are described by a value of the Markup type, it is not possible to determine with absolute certainty which of the namespace items inherited from the [in-scope namespaces] of the [parent] element item are significant in interpreting the Markup value. The safe and easy option would be to assume that all the namespace items from the [in-scope namespaces] of the [parent] element item are significant and need to be retained within the Markup value. When the Markup value is re-encoded, any of the retained namespace items that do not appear in the [in-scope namespaces] of the enclosing element item in the new encoding could be made to appear by outputting corresponding namespace declaration attribute items in the [namespace attributes] of the enclosing element item.
In the absence of complete knowledge of the data type of an element item whose content and attributes are described by a value of the Markup type, it is not possible to determine with absolute certainty which of the namespace items inherited from the [in-scope namespaces] of the [parent] element item are significant in interpreting the Markup value. The safe and easy option would be to assume that all the namespace items from the [in-scope namespaces] of the [parent] element item are significant and need to be retained within the Markup value. When the Markup value is re-encoded, any of the retained namespace items that do not appear in the [in-scope namespaces] of the enclosing element item in the new encoding could be made to appear by outputting corresponding namespace declaration attribute items in the [namespace attributes] of the enclosing element item.
From the perspective of the receiver of the new encoding, this enlarges the set of attribute items in the [namespace attributes] represented by the Markup value.
从新编码的接收者的角度来看,这扩大了标记值表示的[namespace attributes]中的属性项集。
In addition, there is no guarantee that the sender of the new encoding has recreated the original namespace declaration attributes on the ancestor elements, so the [in-scope namespaces] of the enclosing element item is likely to have new namespace declarations that the receiver will retain and pass on in the [namespace attributes] when it in turn re-encodes the Markup value.
此外,不能保证新编码的发送方已在祖先元素上重新创建了原始名称空间声明属性,因此封闭元素项的[范围内名称空间]可能具有接收方将保留并在[名称空间属性]中传递的新名称空间声明当它依次对标记值重新编码时。
This unbounded growth in the set of attribute items in the [namespace attributes] defeats any attempt to produce a canonical encoding.
[namespace attributes]中属性项集合的无限增长挫败了任何产生规范编码的尝试。
The principle of self-containment is introduced to avoid this problem. An element item (the subject element item) is self-contained if the constraints of Namespaces in XML 1.0 [XMLNS10] are satisfied (i.e., that prefixes are properly declared) and none of the following bindings are determined by a namespace declaration attribute item in the [namespace attributes] of an ancestor element item of the subject element item:
为了避免这个问题,引入了自包容原理。如果满足XML 1.0[XMLNS10]中名称空间的约束(即正确声明前缀),并且[namespace attributes]中的名称空间声明属性项不确定以下绑定,则元素项(主题元素项)是自包含的主题元素项的祖先元素项的名称:
(1) the binding between the [prefix] and [namespace name] of the subject element item,
(1) 主题元素项的[prefix]和[namespace name]之间的绑定,
(2) the binding between the [prefix] and [namespace name] of any descendant element item of the subject element item,
(2) 主题元素项的任何子元素项的[prefix]和[namespace name]之间的绑定,
(3) the binding between the [prefix] and [namespace name] of any attribute item in the [attributes] of the subject element item or the [attributes] of any descendant element item of the subject element item,
(3) 主题元素项的[attributes]中任何属性项的[prefix]和[namespace name]之间的绑定,或主题元素项的任何子元素项的[attributes]之间的绑定,
(4) the binding between the namespace prefix and namespace name of any qualified name in the [normalized value] of any attribute item in the [attributes] of the subject element item or the [attributes] of any descendant element item of the subject element item, or
(4) 主题元素项的[attributes]中任何属性项的[normalized value]中任何限定名称的命名空间前缀和命名空间名称之间的绑定,或主题元素项的任何子元素项的[attributes]之间的绑定,或
(5) the binding between the namespace prefix and namespace name of any qualified name represented by a series of character items (ignoring processing instruction and comment items) in the [children] of the subject element item or the [children] of any descendant element item of the subject element item.
(5) 主题元素项的[children]或主题元素项的任何后代元素项的[children]中由一系列字符项(忽略处理指令和注释项)表示的任何限定名称的命名空间前缀和命名空间名称之间的绑定。
Aside: If an element is self-contained, then separating the element from its parent does not change the semantic interpretation of its name and any names in its content and attributes.
旁白:如果元素是自包含的,那么将元素与其父元素分离不会改变其名称及其内容和属性中任何名称的语义解释。
A supposedly self-contained element in a received RXER encoding that is in fact not self-contained SHALL be treated as an ASN.1 constraint violation.
在接收到的RXER编码中,一个假定为自包含的元素实际上不是自包含的,应被视为ASN.1约束冲突。
Aside: ASN.1 does not require an encoding with a constraint violation to be immediately rejected; however, the constraint violation must be reported at some point, possibly in a separate validation step.
旁白:ASN.1不要求立即拒绝违反约束的编码;但是,必须在某个时候报告约束冲突,可能在单独的验证步骤中。
Implementors should note that an RXER decoder will be able to detect some, but not all, violations of self-containment. For example, it can detect element and attribute names that depend on namespace declarations appearing in the ancestors of a supposedly self-contained element. Similarly, where type information is available, it can detect qualified names in character data that depend on the namespace declarations of ancestor elements. However, type information is not always available, so some qualified names will escape constraint checking. Thus, the onus is on the creator of the original encoding to ensure that element items required to be self-contained really are completely self-contained.
实现者应该注意,RXER解码器将能够检测到一些(但不是全部)违反自包含的情况。例如,它可以检测依赖于假定自包含元素的祖先中出现的命名空间声明的元素和属性名称。类似地,在类型信息可用的情况下,它可以检测依赖于祖先元素的命名空间声明的字符数据中的限定名。但是,类型信息并不总是可用的,因此一些限定名称将逃避约束检查。因此,原始编码的创建者有责任确保需要自包含的元素项实际上是完全自包含的。
An element item whose content and attributes are described by a value of the Markup type MUST be self-contained.
其内容和属性由标记类型的值描述的元素项必须是自包含的。
Aside: The procedures in Section 6 take account of the requirements for self-containment so that an RXER encoder following these procedures will not create violations of self-containment.
旁白:第6节中的程序考虑了自我遏制的要求,因此遵循这些程序的RXER编码器不会违反自我遏制。
Implementations are given some latitude in how the content and attributes of an element are represented as an abstract value of the Markup type, in part because an Infoset can have different equivalent serializations. For example, the order of attributes and the amount and kind of white space characters between attributes are irrelevant to the Infoset representation. The content can also include one or more elements corresponding to an ASN.1 top-level NamedType or having a data type that is an ASN.1 type. It is only necessary to preserve the abstract value for such elements, and a particular abstract value can have different Infoset representations.
实现在如何将元素的内容和属性表示为标记类型的抽象值方面有一定的自由度,部分原因是信息集可以具有不同的等效序列化。例如,属性的顺序以及属性之间空白字符的数量和种类与信息集表示无关。内容还可以包括一个或多个元素,这些元素对应于ASN.1顶级NamedType或具有ASN.1类型的数据类型。只需要为这些元素保留抽象值,特定的抽象值可以具有不同的信息集表示形式。
These two characteristics mean that when an RXER encoded value of the Markup type is decoded, the components of the recovered Markup value may not be exactly the same, character for character, as the original value that was encoded, though the recovered value will be semantically equivalent.
这两个特征意味着,当对标记类型的RXER编码值进行解码时,恢复的标记值的组成部分可能与编码的原始值不完全相同,尽管恢复的值在语义上是等效的。
However, canonical ASN.1 encoding rules such as the Distinguished Encoding Rules (DER) and the Canonical Encoding Rules (CER) [X.690], which encode Markup values according to the ASN.1 definition of the Markup type, depend on character-for-character preservation of string values. This requirement can be accommodated if values of the Markup type are normalized when they are encoded according to a set of canonical encoding rules.
但是,根据标记类型的ASN.1定义对标记值进行编码的规范ASN.1编码规则(如区分编码规则(DER)和规范编码规则(CER)[X.690])依赖于字符串值的字符保留。如果标记类型的值在根据一组规范化编码规则进行编码时被规范化,则可以满足此要求。
Aside: The RXER encoding and decoding of a Markup value might change the character string components of the value from the perspective of BER, but there will be a single, repeatable encoding for DER.
旁白:标记值的RXER编码和解码可能会从BER的角度改变该值的字符串成分,但DER将使用单一的、可重复的编码。
A value of the Markup type will appear as the content and attributes of an element in an RXER encoding. When the value is encoded using a set of ASN.1 canonical encoding rules other than CRXER, the components of the text alternative of the value MUST be normalized as follows, by reference to the element as it would appear in a CRXER encoding:
标记类型的值将显示为RXER编码中元素的内容和属性。当使用一组ASN.1规范编码规则(而非CRXER)对值进行编码时,必须通过引用CRXER编码中出现的元素,按如下方式规范化值的文本替代项的组件:
(1) The value of the prolog component SHALL be the XMLDecl <?xml version="1.1"?> with no other leading or trailing characters.
(1) prolog组件的值应为XMLDecl<?xml version=“1.1”>,无其他前导或尾随字符。
(2) If the element's name is unprefixed in the CRXER encoding, then the prefix component SHALL be absent; otherwise, the value of the prefix component SHALL be the prefix of the element's name in the CRXER encoding.
(2) 如果元素的名称在CRXER编码中是不固定的,则前缀组件应不存在;否则,前缀组件的值应为CRXER编码中元素名称的前缀。
(3) Take the character string representing the element's attributes, including namespace declarations, in the CRXER encoding. If the first attribute is a namespace declaration that undeclares the default namespace (i.e., xmlns=""), then remove it. Remove any leading space characters. If the resulting character string is empty, then the attributes component SHALL be absent; otherwise, the value of the attributes component SHALL be the resulting character string.
(3) 以CRXER编码中表示元素属性(包括命名空间声明)的字符串为例。如果第一个属性是取消声明默认名称空间的名称空间声明(即xmlns=“”),则将其删除。删除所有前导空格字符。如果结果字符串为空,则属性组件应不存在;否则,属性组件的值应为结果字符串。
Aside: Note that the attributes of an element can change if an RXER encoding is re-encoded in CRXER.
旁白:请注意,如果RXER编码在CRXER中重新编码,则元素的属性可能会更改。
(4) If the element has no characters between the start-tag and end-tag [XML11] in the CRXER encoding, then the content component SHALL be absent; otherwise, the value of the content component SHALL be identical to the character string in the CRXER encoding bounded by the element's start-tag and end-tag.
(4) 如果元素在CRXER编码中的开始标记和结束标记[XML11]之间没有字符,则内容组件应不存在;否则,内容组件的值应与CRXER编码中由元素的开始标记和结束标记限定的字符串相同。
Aside: A consequence of invoking the CRXER encoding is that any nested element corresponding to an ASN.1 top-level NamedType, or indeed the element itself, will be normalized according to its ASN.1 value rather than its Infoset representation. Likewise for an element whose data type is an ASN.1 type. Section 6.4 describes how these situations can arise.
旁白:调用CRXER编码的结果是,与ASN.1顶级NamedType对应的任何嵌套元素,或者实际上是元素本身,都将根据其ASN.1值而不是其信息集表示进行规范化。对于数据类型为ASN.1类型的元素也是如此。第6.4节描述了这些情况是如何发生的。
Aside: It is only through values of the Markup type that processing instructions and comments can appear in CRXER encodings.
旁白:只有通过标记类型的值,处理指令和注释才能出现在CRXER编码中。
If an application uses DER, but has no knowledge of RXER, then it will not know to normalize values of the Markup type. If RXER is deployed into an environment containing such applications, then Markup values SHOULD be normalized, even when encoding using non-canonical encoding rules.
如果应用程序使用DER,但不知道RXER,那么它将不知道如何规范化标记类型的值。如果将RXER部署到包含此类应用程序的环境中,则应规范化标记值,即使在使用非规范编码规则进行编码时也是如此。
A value of the AnyURI ASN.1 type is a character string conforming to the format of a Uniform Resource Identifier (URI) [URI].
AnyURI ASN.1类型的值是符合统一资源标识符(URI)[URI]格式的字符串。
AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- })
AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- })
A value of the NCName ASN.1 type is a character string conforming to the NCName production of Namespaces in XML 1.0 [XMLNS10].
NCName ASN.1类型的值是符合XML 1.0[XMLNS10]中名称空间的NCName生成的字符串。
NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML 1.0 -- })
NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML 1.0 -- })
Aside: The NCName production for Namespaces in XML 1.1 [XMLNS11] allows a wider range of characters than the NCName production for Namespaces in XML 1.0. The NCName type for ASN.1 is currently restricted to the characters allowed by Namespaces in XML 1.0, though this may change in a future specification of RXER.
旁白:XML 1.1[XMLNS11]中名称空间的NCName产品比XML 1.0中名称空间的NCName产品允许更广泛的字符范围。ASN.1的NCName类型目前仅限于XML1.0中名称空间所允许的字符,尽管这可能会在RXER的未来规范中发生变化。
A value of the Name ASN.1 type is a character string conforming to the Name production of XML version 1.0 [XML10].
名称ASN.1类型的值是符合XML版本1.0[XML10]的名称生成的字符串。
Name ::= UTF8String (CONSTRAINED BY { -- conforms to the Name production of XML -- })
Name ::= UTF8String (CONSTRAINED BY { -- conforms to the Name production of XML -- })
A value of the QName ASN.1 type describes an expanded name [XMLNS10], which appears as a qualified name [XMLNS10] in an RXER encoding.
QName ASN.1类型的值描述扩展名[XMLNS10],它在RXER编码中显示为限定名[XMLNS10]。
RXER has special provisions for encoding values of the QName type (see Section 6.7.11). For other encoding rules, a value of the Qname type is encoded according to the following ASN.1 type definition (with AUTOMATIC TAGS):
RXER对QName类型的编码值有特殊规定(见第6.7.11节)。对于其他编码规则,Qname类型的值根据以下ASN.1类型定义进行编码(带有自动标记):
QName ::= SEQUENCE { namespace-name AnyURI OPTIONAL, local-name NCName }
QName ::= SEQUENCE { namespace-name AnyURI OPTIONAL, local-name NCName }
The namespace-name component holds the namespace name of the expanded name. If the namespace name of the expanded name has no value, then the namespace-name component is absent.
名称空间名称组件保存扩展名称的名称空间名称。如果扩展名称的名称空间名称没有值,则名称空间名称组件不存在。
Aside: A namespace name can be associated with ASN.1 types and top-level NamedType instances by using the TARGET-NAMESPACE encoding instruction.
旁白:命名空间名称可以通过使用TARGET-namespace编码指令与ASN.1类型和顶级NamedType实例相关联。
The local-name component holds the local name of the expanded name.
本地名称组件保存扩展名称的本地名称。
A TypeAssignment in ASN.1 associates a typereference with a Type. For RXER and Abstract Syntax Notation X (ASN.X) [ASN.X], a TypeAssignment is also regarded as associating an expanded name [XMLNS10] with the Type. The local name of the expanded name is the typereference on the left-hand side of the TypeAssignment. If the target namespace [RXEREI] of the ASN.1 module in which the TypeAssignment is defined is not absent, then the namespace name of the expanded name is that target namespace; otherwise, the namespace name of the expanded name has no value.
ASN.1中的类型分配将类型引用与类型相关联。对于RXER和抽象语法符号X(ASN.X)[ASN.X],类型赋值也被视为将扩展名[XMLNS10]与类型关联。扩展名称的本地名称是TypeAssignment左侧的typereference。如果定义了TypeAssignment的ASN.1模块的目标名称空间[RXEREI]不存在,则扩展名称的名称空间名称就是该目标名称空间;否则,扩展名称的命名空间名称没有值。
A Type that is a BuiltinType or ReferencedType that is one of the productions in Table 1 is regarded as a reference to a built-in ASN.1 type. These built-in types also have expanded names. In each case, the local name of the expanded name is as indicated in Table 1, and the namespace name of the expanded name is "urn:ietf:params:xml:ns:asnx".
作为表1中产品之一的内置类型或ReferencedType的类型被视为对内置ASN.1类型的引用。这些内置类型还具有扩展名称。在每种情况下,扩展名称的本地名称如表1所示,扩展名称的命名空间名称为“urn:ietf:params:xml:ns:asnx”。
Table 1: Local Names for Built-in Types
表1:内置类型的本地名称
+------------------------------------+-------------------+ | ASN.1 Production | Local Name | +====================================+===================+ | BitStringType | | | without a NamedBitList | BIT-STRING | +------------------------------------+-------------------+ | BooleanType | BOOLEAN | +------------------------------------+-------------------+ | CharacterStringType | | | RestrictedCharacterStringType | | | BMPString | BMPString | | GeneralString | GeneralString | | GraphicString | GraphicString | | IA5String | IA5String | | ISO646String | ISO646String | | NumericString | NumericString | | PrintableString | PrintableString | | TeletexString | TeletexString | | T61String | T61String | | UniversalString | UniversalString | | UTF8String | UTF8String | | VideotexString | VideotexString | | VisibleString | VisibleString | | UnrestrictedCharacterStringType | CHARACTER-STRING | +------------------------------------+-------------------+ | EmbeddedPDVType | EMBEDDED-PDV | | ExternalType | EXTERNAL | +------------------------------------+-------------------+ | IntegerType | | | without a NamedNumberList | INTEGER | +------------------------------------+-------------------+ | NullType | NULL | | ObjectIdentifierType | OBJECT-IDENTIFIER | | OctetStringType | OCTET-STRING | | RealType | REAL | | RelativeOIDType | RELATIVE-OID | +------------------------------------+-------------------+ | UsefulType | | | GeneralizedTime | GeneralizedTime | | UTCTime | UTCTime | | ObjectDescriptor | ObjectDescriptor | +------------------------------------+-------------------+
+------------------------------------+-------------------+ | ASN.1 Production | Local Name | +====================================+===================+ | BitStringType | | | without a NamedBitList | BIT-STRING | +------------------------------------+-------------------+ | BooleanType | BOOLEAN | +------------------------------------+-------------------+ | CharacterStringType | | | RestrictedCharacterStringType | | | BMPString | BMPString | | GeneralString | GeneralString | | GraphicString | GraphicString | | IA5String | IA5String | | ISO646String | ISO646String | | NumericString | NumericString | | PrintableString | PrintableString | | TeletexString | TeletexString | | T61String | T61String | | UniversalString | UniversalString | | UTF8String | UTF8String | | VideotexString | VideotexString | | VisibleString | VisibleString | | UnrestrictedCharacterStringType | CHARACTER-STRING | +------------------------------------+-------------------+ | EmbeddedPDVType | EMBEDDED-PDV | | ExternalType | EXTERNAL | +------------------------------------+-------------------+ | IntegerType | | | without a NamedNumberList | INTEGER | +------------------------------------+-------------------+ | NullType | NULL | | ObjectIdentifierType | OBJECT-IDENTIFIER | | OctetStringType | OCTET-STRING | | RealType | REAL | | RelativeOIDType | RELATIVE-OID | +------------------------------------+-------------------+ | UsefulType | | | GeneralizedTime | GeneralizedTime | | UTCTime | UTCTime | | ObjectDescriptor | ObjectDescriptor | +------------------------------------+-------------------+
When the expanded name for an ASN.1 type is used in an RXER encoding, it appears as a qualified name [XMLNS10][XMLNS11]. The namespace prefix for the qualified name is determined according to Section 6.7.11.1.
当ASN.1类型的扩展名用于RXER编码时,它将显示为限定名[XMLNS10][XMLNS11]。限定名称的名称空间前缀根据第6.7.11.1节确定。
If a compatible XML Schema translation of an ASN.1 specification is provided (see Section 6.4), then that schema SHOULD associate the same expanded name with the XML Schema translation of an ASN.1 type.
如果提供了ASN.1规范的兼容XML模式翻译(参见第6.4节),则该模式应将相同的扩展名与ASN.1类型的XML模式翻译相关联。
Definition (namespace-qualified reference): An ASN.1 Type is a namespace-qualified reference if one of the following applies:
定义(命名空间限定引用):ASN.1类型是命名空间限定引用,如果以下情况之一适用:
(1) the Type is a typereference (not a DummyReference) or an ExternalTypeReference in a DefinedType in a ReferencedType, the ASN.1 module in which the referenced type is defined has a TARGET-NAMESPACE encoding instruction, the referenced type is not directly or indirectly an open type [X.681], and the referenced type is not directly or indirectly the Markup type (Section 4.1), or
(1) 该类型是ReferencedType中DefinedType中的typereference(不是DummyReference)或ExternalTypeReference,在其中定义引用类型的ASN.1模块具有目标命名空间编码指令,引用类型不是直接或间接的开放类型[X.681],并且引用类型不是直接或间接的标记类型(第4.1节),或者
(2) the Type is a BuiltinType or ReferencedType that is one of the productions in Table 1.
(2) 该类型是表1中的产品之一的内置类型或引用类型。
The type definition referenced by a namespace-qualified reference will have an expanded name with a value for the namespace name.
命名空间限定引用引用的类型定义将具有一个扩展名称,该名称空间名称具有一个值。
With respect to RXER, ASN.1 abstract values are uniformly regarded as analogous to the content and attributes of an element, or just an attribute value, not complete elements or attributes in their own right. Elements and attributes in an RXER encoding are defined by ASN.1 NamedType notation. Since elements are the fundamental discrete structures of an XML document, the notion of a NamedType having a value that can be encoded is useful for descriptive purposes (particularly for describing the RXER encoding of values of the ASN.1 combining types). There is no conceptual basis in X.680 [X.680] for talking about the value of a NamedType, or its encoding, so the terminology is introduced here.
对于RXER,ASN.1抽象值被一致地视为类似于元素的内容和属性,或者只是属性值,而不是完整的元素或属性本身。RXER编码中的元素和属性由ASN.1 NamedType表示法定义。由于元素是XML文档的基本离散结构,因此具有可编码值的NamedType的概念对于描述目的非常有用(特别是对于描述ASN.1组合类型的值的RXER编码)。在X.680[X.680]中,对于谈论NamedType的值或其编码没有概念基础,因此这里介绍了术语。
Definition (value of a NamedType): An abstract value of the Type in a NamedType is also a value of that NamedType. The RXER encoding of the value of a NamedType is the RXER encoding of the abstract value of the Type encapsulated according to the definition of that NamedType.
定义(NamedType的值):NamedType中类型的抽象值也是该NamedType的值。NamedType值的RXER编码是根据该NamedType的定义封装的类型的抽象值的RXER编码。
This document does not refer to a value of a NamedType as being an abstract value so as to remain consistent with X.680. An abstract value is exclusively a value of an ASN.1 type.
本文档未将NamedType的值称为抽象值,以便与X.680保持一致。抽象值是ASN.1类型的唯一值。
A complete ASN.1 encoding is traditionally the encoding of an abstract value, but it is more natural to think of an XML document as being the RXER encoding of a value of a NamedType (because an XML document has a single root element that contains all the other elements and attributes). The ASN.1 basic notation does not allow a NamedType to appear on its own, outside of an enclosing combining type. That is, the basic notation does not have a concept analogous to a global element or attribute definition. However, an ASN.1 specification may use an RXER encoding control section [RXEREI] to define global elements and attributes using the NamedType notation. A NamedType that is not contained in an ASN.1 type definition is called a top-level NamedType [RXEREI]. Thus, an RXER encoding would typically be described as the encoding of a value of a top-level NamedType.
完整的ASN.1编码传统上是对抽象值的编码,但更自然的做法是将XML文档视为对NamedType值的RXER编码(因为XML文档有一个包含所有其他元素和属性的根元素)。ASN.1基本表示法不允许NamedType单独出现在封闭组合类型之外。也就是说,基本符号没有类似于全局元素或属性定义的概念。但是,ASN.1规范可以使用RXER编码控制部分[RXEREI]来使用NamedType表示法定义全局元素和属性。ASN.1类型定义中不包含的NamedType称为顶级NamedType[RXEREI]。因此,RXER编码通常被描述为顶级NamedType值的编码。
Section 6.2 describes how a value of a NamedType is encoded. Section 6.3 defines an alternative method for encoding the document element of an XML document when a top-level NamedType is not specified. Section 6.4 describes how the encodings of ASN.1 values can be embedded in an XML document where the other parts of the document are validated by an XML Schema.
第6.2节描述了NamedType值的编码方式。第6.3节定义了在未指定顶级NamedType时对XML文档的文档元素进行编码的替代方法。第6.4节描述了如何将ASN.1值的编码嵌入到XML文档中,文档的其他部分由XML模式验证。
The RXER encoding of an abstract value, or the encoding of a value of a NamedType, is described as a translation into a synthetic Infoset, which is then serialized as XML. This separation has been chosen for descriptive convenience and is not intended to impose any particular architecture on RXER implementations. An RXER encoder is free to encode an ASN.1 value directly to XML provided the result is equivalent to following the two stage procedure described in this document.
抽象值的RXER编码或NamedType值的编码被描述为转换为合成信息集,然后将其序列化为XML。选择这种分离是为了便于描述,并不打算将任何特定的体系结构强加给RXER实现。RXER编码器可以自由地将ASN.1值直接编码为XML,前提是其结果相当于遵循本文档中描述的两阶段过程。
The process of translating an abstract value into an Infoset is described as producing either:
将抽象值转换为信息集的过程被描述为产生以下任一结果:
(1) a string of characters that either becomes part of the [normalized value] of an attribute item or becomes character items among the [children] of an enclosing element item, or
(1) 成为属性项[标准化值]的一部分或成为封闭元素项[子项]中的字符项的字符串,或
(2) a collection of zero or more attribute items contributing to the [attributes] of an enclosing element item, plus a series of zero or more character, element, processing instruction (PI), or comment items contributing to the [children] of the enclosing element item.
(2) 构成封闭元素项[属性]的零个或多个属性项的集合,加上构成封闭元素项[子项]的一系列零个或多个字符、元素、处理指令(PI)或注释项。
NamedType notation in the ASN.1 specification controls whether the translation of an abstract value is encapsulated in an element item or in an attribute item.
ASN.1规范中的NamedType表示法控制抽象值的转换是封装在元素项中还是封装在属性项中。
Sections 6.5 to 6.10 describe the translation of abstract values into an Infoset for each of the ASN.1 type notations.
ASN.6将每种类型的信息翻译成一组值。
Section 6.11 describes post-processing of namespace prefixes for CRXER encodings.
第6.11节描述了CRXER编码的命名空间前缀的后处理。
Section 6.12 specifies how the Infoset translation is serialized as XML.
第6.12节指定了如何将信息集翻译序列化为XML。
This specification assumes that the COMPONENTS OF transformation specified in X.680, Clause 24.4 [X.680] has already been applied to all relevant types.
本规范假设X.680第24.4条[X.680]中规定的转换组件已应用于所有相关类型。
Examples of RXER encodings in the following sections use a <value> start-tag and </value> end-tag to hold attributes and delimit the content. These start-tags and end-tags are for illustration only and are not part of the encoding of an abstract value. In normal use, the name of the enclosing element is provided by the context of the type of the abstract value, e.g., a NamedType in an enclosing SEQUENCE type.
以下部分中的RXER编码示例使用<value>开始标记和<value>结束标记来保存属性和分隔内容。这些开始标记和结束标记仅用于说明,不是抽象值编码的一部分。在正常使用中,封闭元素的名称由抽象值类型的上下文提供,例如,封闭序列类型中的NamedType。
An RXER decoder is a conforming XML processor [XML10][XML11].
RXER解码器是一种一致的XML处理器[XML10][XML11]。
An identifier, as defined in ASN.1 notation (Clause 11.3 of X.680 [X.680]), is a character string that begins with a Latin lowercase letter (U+0061-U+007A) and is followed by zero, one or more Latin letters (U+0041-U+005A, U+0061-U+007A), decimal digits (U+0030- U+0039), and hyphens (U+002D). A hyphen is not permitted to be the last character, and a hyphen is not permitted to be followed by another hyphen. The case of letters in an identifier is always significant.
ASN.1符号(X.680[X.680]第11.3条)中定义的标识符是以拉丁小写字母(U+0061-U+007A)开头的字符串,后跟零、一个或多个拉丁字母(U+0041-U+005A、U+0061-U+007A)、十进制数字(U+0030-U+0039)和连字符(U+002D)。不允许连字符作为最后一个字符,也不允许一个连字符后跟另一个连字符。标识符中字母的大小写总是重要的。
ASN.1 identifiers are used for the [local name] of attribute and element items, and may also appear in the character data content of elements or the values of attributes. RXER encoding instructions can be used to substitute an NCName [XMLNS10] for an identifier.
ASN.1标识符用于属性和元素项的[本地名称],也可能出现在元素的字符数据内容或属性值中。RXER编码指令可用于用NCName[XMLNS10]替换标识符。
The translation of the value of a NamedType is the translation of the abstract value of the Type of the NamedType encapsulated according to the definition of that NamedType. This section specifies the form of this encapsulation.
NamedType值的转换是根据该NamedType的定义封装的NamedType类型的抽象值的转换。本节指定此封装的形式。
A value of a NamedType that is subject to a COMPONENT-REF encoding instruction is translated as a value of the top-level NamedType referenced by the encoding instruction.
受COMPONENT-REF编码指令约束的NamedType的值被转换为编码指令引用的顶级NamedType的值。
A value of a NamedType that is not subject to an ATTRIBUTE, ATTRIBUTE-REF, GROUP, or SIMPLE-CONTENT encoding instruction is translated as an element item, either as a child element item added to the [children] of the enclosing element item or as the document element item added to the [children] and [document element] of the document item. If the element item is a child element item, then the [parent] is the enclosing element item; otherwise, the [parent] is the document item.
不受属性、ATTRIBUTE-REF、GROUP或SIMPLE-CONTENT编码指令约束的NamedType的值被转换为元素项,或者被转换为添加到封闭元素项的[children]的子元素项,或者被转换为添加到文档项的[children]和[document element]的文档元素项。如果元素项是子元素项,则[parent]是封闭的元素项;否则,[父项]就是文档项。
The [local name] of the element item is the local name of the expanded name of the NamedType (see [RXEREI]).
元素项的[local name]是NamedType的扩展名的本地名(请参见[RXEREI])。
Aside: If there are no NAME, ATTRIBUTE-REF, COMPONENT-REF, ELEMENT-REF, or REF-AS-ELEMENT encoding instructions, then the local name of the expanded name of a NamedType is the same as the identifier of the NamedType.
旁白:如果没有名称、ATTRIBUTE-REF、COMPONENT-REF、ELEMENT-REF或REF-AS-ELEMENT编码指令,则NamedType扩展名称的本地名称与NamedType的标识符相同。
If the namespace name of the expanded name has no value, then the [namespace name] of the element item has no value (i.e., the element's name is not namespace qualified); otherwise, the [namespace name] is the namespace name of the expanded name.
如果扩展名称的名称空间名称没有值,则元素项的[名称空间名称]没有值(即,元素的名称没有名称空间限定);否则,[名称空间名称]是扩展名称的名称空间名称。
If the type of the NamedType is directly or indirectly the Markup type, then the [in-scope namespaces] and [namespace attributes] of the element item are constructed as specified in Section 6.10; otherwise, the [in-scope namespaces] and [namespace attributes] of the element item are constructed as specified in Section 6.2.2.1.
如果NamedType的类型直接或间接为标记类型,则元素项的[in-scope namespaces]和[namespace attributes]按照第6.10节的规定构造;否则,元素项的[范围内名称空间]和[名称空间属性]将按照第6.2.2.1节的规定构造。
If the [namespace name] of the element item has no value, then the [prefix] of the element item has no value; else if the type of the NamedType is not directly or indirectly the Markup type, then the
如果元素项的[namespace name]没有值,则元素项的[prefix]没有值;否则,如果NamedType的类型不是直接或间接的标记类型,则
[prefix] of the element item is determined as specified in Section 6.2.2.2; otherwise, the [prefix] is determined by the Markup value as specified in Section 6.10.
根据第6.2.2.2节的规定确定元素项的[前缀];否则,[前缀]由第6.10节规定的标记值确定。
The element item becomes the enclosing element item for the translation of the value of the Type of the NamedType.
元素项成为转换NamedType类型值的封闭元素项。
For a non-canonical RXER encoding, if the type of the NamedType is not directly or indirectly the Markup type, then PI and comment items MAY be added to the [children] of the element item (before or after any other items). The element item becomes the [parent] for each PI and comment item. These particular PI and comment items in a received RXER encoding MAY be discarded by an application.
对于非规范RXER编码,如果NamedType的类型不是直接或间接的标记类型,则可以将PI和注释项添加到元素项的[子项](在任何其他项之前或之后)。元素项成为每个PI和注释项的[parent]。应用程序可能会丢弃接收到的RXER编码中的这些特定PI和注释项。
Aside: There is no provision for representing comments and PIs in ASN.1 abstract values of types other than the Markup type. These items will be lost if the abstract value is re-encoded using a different set of encoding rules.
旁白:ASN.1中没有表示除标记类型以外的类型的抽象值的注释和PI的规定。如果使用一组不同的编码规则对抽象值重新编码,则这些项将丢失。
For a non-canonical RXER encoding, an attribute item with the [local name] "type" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance" (i.e., xsi:type [XSD1]) SHOULD be added to the [attributes] of the element item if the corresponding NamedType is subject to a TYPE-AS-VERSION encoding instruction and MAY be added to the [attributes] of the element item if the Type of the corresponding NamedType is a namespace-qualified reference (see Section 5). The [prefix] of this attribute item is determined as specified in Section 6.2.3.1. The [normalized value] of this attribute item is a qualified name for the expanded name of the referenced type, with the namespace prefix determined as specified in Section 6.7.11.1. The element item is the [owner element] for the attribute item.
对于非规范RXER编码,使用[local name]“type”和[namespace name]的属性项http://www.w3.org/2001/XMLSchema-instance(即,如果对应的NamedType遵循类型转换编码指令,并且可以添加到元素项的[attributes]中,则应将xsi:type[XSD1])添加到元素项的[attributes]中如果对应NamedType的类型是命名空间限定引用(参见第5节),则元素项的[属性]。此属性项的[前缀]根据第6.2.3.1节的规定确定。[标准化值]此属性项的名称是引用类型的扩展名称的限定名称,名称空间前缀按照第6.7.11.1节的规定确定。元素项是属性项的[owner element]。
Aside: Where a compatible XML Schema translation of the ASN.1 specification has been provided, the xsi:type attribute indicates to an XML Schema validator which type definition it should use for validating the RXER encoding.
旁白:如果提供了ASN.1规范的兼容XML模式转换,xsi:type属性会向XML模式验证器指示它应该使用哪个类型定义来验证RXER编码。
Aside: An xsi:type attribute is generally not permitted in a CRXER encoding. Section 6.4 describes some circumstances where it is required in a CRXER encoding. An xsi:type attribute might also appear in a CRXER encoding if it is contained in a value of the Markup type.
旁白:在CRXER编码中通常不允许使用xsi:type属性。第6.4节描述了CRXER编码中需要的一些情况。如果xsi:type属性包含在标记类型的值中,则它也可能出现在CRXER编码中。
For a non-canonical RXER encoding, if the type of the NamedType is not directly or indirectly the Markup type, then attribute items with the [local name] "schemaLocation" or "noNamespaceSchemaLocation" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance"
对于非规范RXER编码,如果NamedType的类型不是直接或间接的标记类型,则使用[local name]“schemaLocation”或“noNamespaceSchemaLocation”和[namespace name]属性项http://www.w3.org/2001/XMLSchema-instance"
[XSD1] MAY be added to the [attributes] of the element item. The [prefix] for each of these attribute items is determined as specified in Section 6.2.3.1. The [normalized value] of these attribute items MUST reference a compatible XML Schema translation of the ASN.1 specification. The element item is the [owner element] for the attribute items.
[XSD1]可以添加到元素项的[attributes]中。根据第6.2.3.1节的规定确定每个属性项的[前缀]。这些属性项的[normalized value]必须引用ASN.1规范的兼容XML模式转换。元素项是属性项的[所有者元素]。
This section describes how the [in-scope namespaces] and [namespace attributes] of an element item are constructed when the content and attributes of the element item are not described by a value of the Markup type (otherwise, see Section 6.10).
本节描述了当元素项的内容和属性不是由标记类型的值描述时,如何构造元素项的[范围内命名空间]和[命名空间属性](否则,请参见第6.10节)。
The [in-scope namespaces] property of the element item initially contains only the mandatory namespace item for the "xml" prefix [INFOSET].
元素项的[in-scope namespaces]属性最初仅包含“xml”前缀[INFOSET]的必需名称空间项。
For a CRXER encoding, if the element item is not the [document element] of the document item and the [in-scope namespaces] property of the element item's [parent] contains a namespace item for the default namespace, then a namespace declaration attribute item that undeclares the default namespace (see Section 3) SHALL be added to the element item's [namespace attributes].
对于CRXER编码,如果元素项不是文档项的[document element],并且元素项的[parent]的[in-scope namespaces]属性包含默认名称空间的名称空间项,则是取消声明默认名称空间的名称空间声明属性项(参见第3节)应添加到元素项的[名称空间属性]。
Definition (default namespace restricted): With respect to an element item, the default namespace is restricted if:
定义(默认命名空间受限):对于元素项,默认命名空间在以下情况下受限:
(1) the [namespace name] of the element item has no value (i.e., the element's name is not namespace qualified), or
(1) 元素项的[namespace name]没有值(即元素的名称不是命名空间限定的),或者
(2) the element item is the enclosing element item for a value of the UNION type where the member attribute will be required (see Section 6.7.14), or
(2) 元素项是需要成员属性的联合类型值的封闭元素项(见第6.7.14节),或
(3) the element item is the enclosing element item for a value of the QName type where the namespace-name component is absent (see Section 6.7.11). This includes the case where the translation of the QName value is contained in the [normalized value] of an attribute item in the [attributes] of the element item.
(3) 元素项是QName类型值的封闭元素项,其中缺少名称空间名称组件(参见第6.7.11节)。这包括QName值的转换包含在元素项的[attributes]中的属性项的[normalized value]中的情况。
For a non-canonical RXER encoding, if the element item is not the [document element] of the document item and the [in-scope namespaces] property of the element item's [parent] contains a namespace item for the default namespace, then either:
对于非规范RXER编码,如果元素项不是文档项的[document element],并且元素项的[parent]的[in-scope namespaces]属性包含默认命名空间的命名空间项,则:
(1) that item is copied to the [in-scope namespaces] of the element item, or
(1) 将该项复制到元素项的[范围内命名空间],或
(2) a namespace declaration attribute item that declares the default namespace is added to the element item's [namespace attributes] (the namespace name is the encoder's choice), and an equivalent namespace item is added to the [in-scope namespaces] of the element item, or
(2) 将声明默认名称空间的名称空间声明属性项添加到元素项的[名称空间属性](名称空间名称是编码器的选择),并将等效名称空间项添加到元素项的[范围内名称空间],或
(3) a namespace declaration attribute item that undeclares the default namespace is added to the element item's [namespace attributes].
(3) 将取消声明默认命名空间的命名空间声明属性项添加到元素项的[命名空间属性]。
Options (1) and (2) SHALL NOT be used if the default namespace is restricted with respect to the element item.
如果元素项的默认名称空间受到限制,则不应使用选项(1)和(2)。
For a CRXER encoding, if the element item is not the [document element] of the document item and the element item is not required to be self-contained, then all the namespace items in the [in-scope namespaces] of the [parent], excluding the namespace item for the "xml" prefix and any namespace item for the default namespace, are copied to the [in-scope namespaces] of the element item.
对于CRXER编码,如果元素项不是文档项的[document element],并且元素项不要求是自包含的,则将[parent]的[in-scope namespaces]中的所有命名空间项(不包括“xml”前缀的命名空间项和默认命名空间的任何命名空间项)复制到元素项的[范围命名空间中]。
For a non-canonical RXER encoding, if the element item is not the [document element] of the document item and the element item is not required to be self-contained, then any subset (including none or all) of the namespace items in the [in-scope namespaces] of the [parent], excluding certain items, is copied to the [in-scope namespaces] of the element item. The excluded items that MUST NOT be copied are: the namespace item for the "xml" prefix, any namespace item for the default namespace, and any namespace item that matches the [prefix], but not the [namespace name], of a namespace item retained for the re-encoding of an unknown attribute item (see Section 6.8.8) or an unknown alternative of a UNION (see Section 6.7.14).
For a non-canonical RXER encoding, if the element item is not the [document element] of the document item and the element item is not required to be self-contained, then any subset (including none or all) of the namespace items in the [in-scope namespaces] of the [parent], excluding certain items, is copied to the [in-scope namespaces] of the element item. The excluded items that MUST NOT be copied are: the namespace item for the "xml" prefix, any namespace item for the default namespace, and any namespace item that matches the [prefix], but not the [namespace name], of a namespace item retained for the re-encoding of an unknown attribute item (see Section 6.8.8) or an unknown alternative of a UNION (see Section 6.7.14).
Aside: The descriptive approach used by this document only allows a namespace prefix to be used by a new namespace item if it is not currently used by another namespace item in the [in-scope namespaces]. By not inheriting a namespace item, the prefix of that namespace is again available for reuse without fear of breaking an existing dependency on the prefix.
旁白:本文档使用的描述性方法仅允许新名称空间项使用名称空间前缀,前提是[范围内名称空间]中的另一名称空间项当前未使用该名称空间前缀。通过不继承名称空间项,该名称空间的前缀可以再次重用,而无需担心破坏对前缀的现有依赖关系。
Element items that are required to be self-contained inherit none of the namespace items in the [in-scope namespaces] of the [parent].
需要自包含的元素项不会继承[parent]的[in-scope namespaces]中的任何命名空间项。
Any namespace item that is retained for the re-encoding of an unknown attribute item (Section 6.8.8) or an unknown alternative of a UNION (Section 6.7.14) and which is not in the [in-scope namespaces] of the element item MUST be added to the [in-scope namespaces]. An
为重新编码未知属性项(第6.8.8节)或联合的未知替代项(第6.7.14节)而保留的任何名称空间项(不在元素项的[范围内名称空间]中)必须添加到[范围内名称空间]。一
equivalent namespace declaration attribute item MUST be added to the [namespace attributes] of the element item.
必须将等效命名空间声明属性项添加到元素项的[namespace attributes]。
Definition (unused namespace prefix): A namespace prefix is unused if it does not match the [prefix] of any namespace item in the [in-scope namespaces] of the element item.
定义(未使用的名称空间前缀):如果名称空间前缀与元素项的[范围内名称空间]中任何名称空间项的[前缀]不匹配,则该名称空间前缀未使用。
For a non-canonical RXER encoding, if the type of the NamedType is not directly or indirectly the Markup type, then additional namespace declaration attribute items for currently unused namespace prefixes MAY be added to the [namespace attributes] of the element item. An equivalent namespace item MUST be added to the [in-scope namespaces] of the element item for each additional namespace declaration attribute item.
对于非规范RXER编码,如果NamedType的类型不是直接或间接的标记类型,则可以将当前未使用的命名空间前缀的其他命名空间声明属性项添加到元素项的[namespace attributes]。对于每个附加的名称空间声明属性项,必须将等效名称空间项添加到元素项的[范围内名称空间]。
For a non-canonical RXER encoding, if the type of the NamedType is not directly or indirectly the Markup type, and the [in-scope namespaces] property of the element item does not contain a namespace item for the default namespace, and the default namespace is not restricted with respect to the element item, then a namespace declaration attribute item for the default namespace MAY be added to the [namespace attributes] of the element item, in which case an equivalent namespace item MUST be added to the [in-scope namespaces] of the element item.
对于非规范RXER编码,如果NamedType的类型不是直接或间接的标记类型,并且元素项的[in-scope namespaces]属性不包含默认名称空间的名称空间项,并且默认名称空间不受元素项的限制,然后,可以将默认名称空间的名称空间声明属性项添加到元素项的[名称空间属性],在这种情况下,必须将等效名称空间项添加到元素项的[范围内名称空间]。
Whenever a namespace declaration attribute item is added to an element item's [namespace attributes], the [owner element] of the attribute item is set to the element item.
每当将名称空间声明属性项添加到元素项的[namespace attributes]时,属性项的[owner element]将设置为元素项。
This section describes how the [prefix] of an element item is determined when the element item has a value for its [namespace name] and the content and attributes of the element item are not described by a value of the Markup type (otherwise, see Section 6.10).
本节描述了当元素项的[名称空间名称]具有值,且元素项的内容和属性不由标记类型的值描述时,如何确定元素项的[前缀](否则,请参见第6.10节)。
For a CRXER encoding, if the [namespace name] of the element item has a value, then the [prefix] of the element item is any unused non-canonical namespace prefix unless the [in-scope namespaces] property of the element item contains a namespace item with the same [namespace name] as the element item. In that case, the [prefix] of that namespace item SHALL be used as the [prefix] of the element item.
对于CRXER编码,如果元素项的[namespace name]具有值,则元素项的[prefix]是任何未使用的非规范命名空间前缀,除非元素项的[in-scope namespaces]属性包含与元素项具有相同[namespace name]的命名空间项。在这种情况下,该名称空间项的[前缀]应用作元素项的[前缀]。
Aside: These prefixes will be rewritten to canonical namespace prefixes during the final step in producing the Infoset translation (see Section 6.11). Canonical namespace prefixes are not used here in the first instance because canonicalization
旁白:在生成信息集翻译的最后一步中,这些前缀将被重写为规范名称空间前缀(参见第6.11节)。在第一个实例中不使用规范化命名空间前缀,因为规范化
depends on knowing the final [namespace attributes] produced by encoding the abstract value of the type of the NamedType. If an implementation looks ahead to determine this final set prior to translating the abstract value, then it can assign the appropriate canonical namespace prefix in this step and skip the rewriting step.
取决于知道编码NamedType类型的抽象值所产生的最终[名称空间属性]。如果一个实现在转换抽象值之前预先确定这个最终集,那么它可以在此步骤中分配适当的规范名称空间前缀,并跳过重写步骤。
For a non-canonical RXER encoding, if the [namespace name] has a value, then the [prefix] of the element item is any unused namespace prefix unless the [in-scope namespaces] property of the element item contains a namespace item with the same [namespace name] as the element item. In that case, the [prefix] of that namespace item MAY be used as the [prefix] of the element item. Note that the [prefix] of a namespace item for the default namespace has no value.
对于非规范RXER编码,如果[namespace name]具有值,则元素项的[prefix]是任何未使用的命名空间前缀,除非元素项的[in-scope namespaces]属性包含与元素项具有相同[namespace name]的命名空间项。在这种情况下,该名称空间项的[prefix]可以用作元素项的[prefix]。请注意,默认命名空间的命名空间项的[prefix]没有值。
If the [prefix] of the element item is an unused namespace prefix, then a namespace declaration attribute item associating the namespace prefix with the namespace name MUST be added to the [namespace attributes] of the element item, and a corresponding namespace item MUST be added to the [in-scope namespaces] of the element item.
如果元素项的[prefix]是未使用的命名空间前缀,则必须将命名空间前缀与命名空间名称关联的命名空间声明属性项添加到元素项的[namespace attributes],并且必须将相应的命名空间项添加到元素项的[in-scope namespaces]。
Aside: The [local name] of the namespace declaration attribute item is the same as the [prefix] of the element item, the [namespace name] of the attribute item is "http://www.w3.org/2000/xmlns/", and the [normalized value] of the attribute item is the same as the [namespace name] of the element item. The namespace item has the same [prefix] and [namespace name] as the element item.
旁白:名称空间声明属性项的[local name]与元素项的[prefix]相同,属性项的[namespace name]为“http://www.w3.org/2000/xmlns/,并且属性项的[normalized value]与元素项的[namespace name]相同。名称空间项与元素项具有相同的[prefix]和[namespace name]。
A value of a NamedType subject to an ATTRIBUTE or ATTRIBUTE-REF encoding instruction is translated as an attribute item added to the [attributes] of the enclosing element item (which becomes the [owner element] of the attribute item).
受属性或ATTRIBUTE-REF编码指令约束的NamedType的值被转换为添加到封闭元素项(成为属性项的[owner element])的[attributes]中的属性项。
The [local name] of the attribute item is the local name of the expanded name of the NamedType (see [RXEREI]).
属性项的[local name]是NamedType的扩展名的本地名(请参见[RXEREI])。
If the namespace name of the expanded name has no value, then the [namespace name] of the attribute item has no value; otherwise, the [namespace name] is the namespace name of the expanded name.
如果扩展名称的名称空间名称没有值,则属性项的[名称空间名称]没有值;否则,[名称空间名称]是扩展名称的名称空间名称。
If the [namespace name] has a value, then the [prefix] of the attribute item is determined as specified in Section 6.2.3.1; otherwise, the [prefix] of the attribute item has no value.
如果[名称空间名称]有一个值,则根据第6.2.3.1节的规定确定属性项的[前缀];否则,属性项的[前缀]没有值。
The [normalized value] of the attribute item is the translation of the value of the Type of the NamedType.
属性项的[normalized value]是NamedType类型值的转换。
For completeness, the [specified] property is set to true, the [attribute type] has no value, and the value of the [references] property is set to unknown.
为了完整性,[specified]属性设置为true,[attribute type]没有值,[references]属性的值设置为unknown。
This section applies when an attribute item with a value for its [namespace name] is added to the [attributes] of an element item.
当将具有[namespace name]值的属性项添加到元素项的[attributes]时,本节适用。
For a CRXER encoding, the [prefix] of the attribute item is any unused non-canonical namespace prefix unless the [in-scope namespaces] property of the [owner element] contains a namespace item with a value for the [prefix] (i.e., is not a namespace item for the default namespace) and the same [namespace name] as the attribute item. In that case, the [prefix] of that namespace item SHALL be used as the [prefix] of the attribute item.
对于CRXER编码,属性项的[prefix]是任何未使用的非规范名称空间前缀,除非[owner element]的[in-scope namespaces]属性包含具有[prefix]值的名称空间项(即,不是默认名称空间的名称空间项)以及与属性项相同的[namespace name]。在这种情况下,该名称空间项的[前缀]应用作属性项的[前缀]。
For a non-canonical RXER encoding, the [prefix] of the attribute item is any unused namespace prefix unless the [in-scope namespaces] property of the [owner element] contains a namespace item with a value for the [prefix] and the same [namespace name] as the attribute item. In that case, the [prefix] of that namespace item MAY be used as the [prefix] of the attribute item.
对于非规范RXER编码,属性项的[prefix]是任何未使用的命名空间前缀,除非[owner element]的[in-scope namespaces]属性包含具有[prefix]值且与属性项相同[namespace name]的命名空间项。在这种情况下,该名称空间项的[prefix]可以用作属性项的[prefix]。
If the [prefix] of the attribute item is an unused namespace prefix, then a namespace declaration attribute item associating the namespace prefix with the namespace name MUST be added to the [namespace attributes] of the [owner element], and a corresponding namespace item MUST be added to the [in-scope namespaces] of the [owner element].
如果属性项的[prefix]是未使用的命名空间前缀,则必须将命名空间前缀与命名空间名称关联的命名空间声明属性项添加到[owner元素]的[namespace attributes],并且必须将相应的命名空间项添加到[owner元素]的[in-scope namespaces]。
A value of a NamedType subject to a GROUP or SIMPLE-CONTENT encoding instruction is translated as the value of the Type of the NamedType, i.e., without encapsulation in an element item or attribute item. Consequently, the enclosing element item for the translation of the value of the NamedType is also the enclosing element item for the translation of the value of the Type of the NamedType.
受组或简单内容编码指令约束的NamedType的值被转换为NamedType类型的值,即不封装在元素项或属性项中。因此,转换NamedType值的封闭元素项也是转换NamedType类型值的封闭元素项。
Consider this type definition:
考虑这种类型定义:
CHOICE { one [0] BOOLEAN, two [1] [RXER:ATTRIBUTE] INTEGER, three [2] [RXER:NAME AS "THREE"] OBJECT IDENTIFIER, four [3] [RXER:ATTRIBUTE-REF { namespace-name "http://www.example.com", local-name "foo" }] UTF8String, five [4] [RXER:ELEMENT-REF { namespace-name "http://www.example.com", local-name "bar" }] Markup, six [5] [RXER:GROUP] SEQUENCE { seven [0] [RXER:ATTRIBUTE] INTEGER, eight [1] INTEGER } }
CHOICE { one [0] BOOLEAN, two [1] [RXER:ATTRIBUTE] INTEGER, three [2] [RXER:NAME AS "THREE"] OBJECT IDENTIFIER, four [3] [RXER:ATTRIBUTE-REF { namespace-name "http://www.example.com", local-name "foo" }] UTF8String, five [4] [RXER:ELEMENT-REF { namespace-name "http://www.example.com", local-name "bar" }] Markup, six [5] [RXER:GROUP] SEQUENCE { seven [0] [RXER:ATTRIBUTE] INTEGER, eight [1] INTEGER } }
The content and attributes of each of the following <value> elements are the RXER encoding of a value of the above type:
以下<value>元素的内容和属性都是上述类型值的RXER编码:
<value> <one>true</one> </value>
<value> <one>true</one> </value>
<value two="100"/>
<value two="100"/>
<value> <THREE>2.5.4.3</THREE> </value>
<value> <THREE>2.5.4.3</THREE> </value>
<value xmlns:ex="http://www.example.com" ex:foo="a string"/>
<value xmlns:ex="http://www.example.com" ex:foo="a string"/>
<value> <ex:bar xmlns:ex="http://www.example.com">another string</ex:bar> </value>
<value> <ex:bar xmlns:ex="http://www.example.com">another string</ex:bar> </value>
<value seven="200"> <eight>300</eight> </value>
<value seven="200"> <eight>300</eight> </value>
A typical RXER encoding is the encoding of a value of a nominated top-level NamedType. An abstract value MAY be encoded as an XML document without nominating an explicit top-level NamedType by invoking a Standalone RXER Encoding or Standalone CRXER Encoding.
典型的RXER编码是对指定的顶级NamedType的值进行编码。通过调用独立的RXER编码或独立的CRXER编码,可以将抽象值编码为XML文档,而无需指定显式的顶级NamedType。
In a Standalone RXER Encoding or Standalone CRXER Encoding, the abstract value is encoded as the value of a notional NamedType where the identifier of the NamedType is "value" and the Type of the NamedType is the type of the abstract value. The NamedType is assumed to be subject to no encoding instructions.
在独立RXER编码或独立CRXER编码中,抽象值被编码为概念NamedType的值,其中NamedType的标识符为“值”,NamedType的类型为抽象值的类型。假定NamedType不受任何编码指令的约束。
Aside: Thus, the element item corresponding to the document element will have the [local name] "value" and no value for the [namespace name] and [prefix].
旁白:因此,与document元素对应的元素项将具有[local name]“value”,而[namespace name]和[prefix]没有值。
If RXER is chosen as the transfer syntax in an EMBEDDED PDV value, then the data-value OCTET STRING SHALL contain a Standalone RXER encoding.
如果在嵌入式PDV值中选择RXER作为传输语法,则数据值八位字节字符串应包含独立的RXER编码。
If CRXER is chosen as the transfer syntax in an EMBEDDED PDV value, then the data-value OCTET STRING SHALL contain a Standalone CRXER encoding.
如果在嵌入式PDV值中选择CRXER作为传输语法,则数据值八位字节字符串应包含独立的CRXER编码。
If RXER is chosen as the transfer syntax in an EXTERNAL value, then the octet-aligned OCTET STRING or arbitrary BIT STRING SHALL contain a Standalone RXER encoding.
如果选择RXER作为外部值中的传输语法,则八进制对齐的八进制字符串或任意位字符串应包含独立的RXER编码。
If CRXER is chosen as the transfer syntax in an EXTERNAL value, then the octet-aligned OCTET STRING or arbitrary BIT STRING SHALL contain a Standalone CRXER encoding.
如果选择CRXER作为外部值中的传输语法,则八进制对齐的八进制字符串或任意位字符串应包含独立的CRXER编码。
The reference encoding instructions [RXEREI] allow XML Schema definitions to be referenced from an ASN.1 specification. It is also possible to reference an ASN.1 type or top-level NamedType from an XML Schema definition or from an information item validated by an XML Schema wildcard. The manner in which an XML Schema definition references an ASN.1 type or top-level NamedType has an effect on the CRXER encoding of a value of the type or top-level NamedType.
引用编码指令[RXEREI]允许从ASN.1规范引用XML模式定义。还可以从XML模式定义或通过XML模式通配符验证的信息项引用ASN.1类型或顶级NamedType。XML模式定义引用ASN.1类型或顶级NamedType的方式会影响该类型或顶级NamedType值的CRXER编码。
This section also applies to XML Schema definitions that validate information items that are contained in a value of the Markup type.
本节还适用于验证标记类型值中包含的信息项的XML模式定义。
Aside: So the document element of an XML document might be described by an XML Schema definition that at some point references an ASN.1 definition that uses a reference encoding instruction to reference another XML Schema definition that then references another ASN.1 definition, and so on.
旁白:因此XML文档的文档元素可能由一个XML模式定义来描述,该定义在某种程度上引用了一个ASN.1定义,该定义使用引用编码指令来引用另一个XML模式定义,然后引用另一个ASN.1定义,依此类推。
In each of the following cases, an element or attribute item is only permitted to be, or to encapsulate, an RXER Infoset translation of an ASN.1 value if an XML Schema element declaration or ASN.1 NamedType is known for the [parent] element item ([owner element] in the case of an attribute declaration), for the [parent] of the [parent] element item, and so on, to the document element of the XML document. This condition is not satisfied by a NamedType where the Type is directly or indirectly the Markup type and the NamedType is not subject to a reference encoding instruction.
在以下每种情况下,如果[parent]的[parent]元素项([owner element])的[parent]已知XML模式元素声明或ASN.1 NamedType,则只允许元素或属性项作为或封装ASN.1值的RXER Infoset翻译元素项,依此类推到XML文档的文档元素。NamedType不满足此条件,其中该类型直接或间接为标记类型,且NamedType不受引用编码指令的约束。
Aside: An element declaration becomes known for an element item through assessment [XSD1]. A NamedType becomes known for an element item through decoding.
旁白:元素声明通过评估[XSD1]为元素项所知。通过解码,元素项的NamedType变为已知。
Aside: If an XML Schema element declaration or ASN.1 NamedType is not known for an element item, then the type of the element item and the type of every nested element item are treated as unknown. Although an xsi:type attribute definitively identifies the type of an element item even if an element declaration for the element item is not known, this attribute is generally optional in an RXER encoding and so cannot be relied upon when seen in isolation from an element declaration. Although only top-level NamedType instances can have namespace-qualified names in the current RXER specification, a future version may allow nested NamedType instances to also have namespace-qualified names, in which case it will not necessarily be possible to distinguish a nested NamedType from a top-level NamedType without knowledge of the type of the [parent] element item.
旁白:如果元素项的XML模式元素声明或ASN.1 NamedType未知,则元素项的类型和每个嵌套元素项的类型都被视为未知。尽管xsi:type属性最终标识元素项的类型,即使元素项的元素声明未知,但该属性在RXER编码中通常是可选的,因此在与元素声明分离时无法依赖。尽管在当前RXER规范中只有顶级NamedType实例可以具有命名空间限定名称,但未来版本可能允许嵌套的NamedType实例也具有命名空间限定名称,在这种情况下,如果不知道[parent]元素项的类型,就不一定能够区分嵌套的NamedType和顶级NamedType。
An ASN.1 type with an expanded name (Section 5) MAY be referenced by the type attribute of an XML Schema element declaration. The reference takes the form of a qualified name for the expanded name. An element item validated by such an element declaration encapsulates the Infoset translation of an abstract value of the ASN.1 type. The [namespace name] and [local name] of the element item are determined by the XML Schema element declaration. The remaining properties are determined according to RXER. The element item MUST be self-contained for a CRXER encoding.
具有扩展名称(第5节)的ASN.1类型可以由XML模式元素声明的type属性引用。引用采用扩展名称的限定名称形式。通过这种元素声明验证的元素项封装了ASN.1类型的抽象值的信息集转换。元素项的[namespace name]和[local name]由XML模式元素声明确定。其余属性根据RXER确定。对于CRXER编码,元素项必须是自包含的。
Aside: The element item is not required to be self-contained for a non-canonical RXER encoding.
旁白:对于非规范RXER编码,元素项不需要是自包含的。
A top-level NamedType MAY be referenced by the ref attribute of an XML Schema element declaration if the NamedType is not subject to an ATTRIBUTE encoding instruction. The reference takes the form of a qualified name for the expanded name of the top-level NamedType [RXEREI]. An element item validated by such an element declaration is the Infoset translation of a value of the referenced top-level NamedType. All the properties of the element item are determined according to RXER. The element item MUST be self-contained for a CRXER encoding.
如果NamedType不受属性编码指令的约束,则XML架构元素声明的ref属性可以引用顶级NamedType。该引用采用顶级NamedType[RXEREI]扩展名的限定名形式。通过这种元素声明验证的元素项是引用的顶级NamedType值的信息集转换。元素项的所有属性都是根据RXER确定的。对于CRXER编码,元素项必须是自包含的。
A top-level NamedType MAY be referenced by the ref attribute of an XML Schema attribute declaration if the NamedType is subject to an ATTRIBUTE encoding instruction and the definition of the type of the NamedType does not depend on the QName type in any way. An attribute item validated by such an attribute declaration is the Infoset translation of a value of the referenced top-level NamedType, except that whatever valid [prefix] is initially chosen for the attribute item MUST be preserved in any re-encoding. The remaining properties of the attribute item are determined according to RXER.
如果NamedType服从属性编码指令,并且NamedType类型的定义不以任何方式依赖于QName类型,则XML架构属性声明的ref属性可以引用顶级NamedType。通过此类属性声明验证的属性项是引用的顶级NamedType值的信息集翻译,但初始为属性项选择的有效[prefix]必须在任何重新编码中保留。属性项的其余属性根据RXER确定。
Aside: The exclusion of the QName type means that the attribute value is not dependent upon any namespace declarations of its parent element item.
旁白:排除QName类型意味着属性值不依赖于其父元素项的任何命名空间声明。
An element item that is validated by an XML Schema element declaration that has the ur-type (i.e., anyType) as its type definition MAY encapsulate the Infoset translation of a value of an ASN.1 type with an expanded name. The [namespace name] and [local name] of the element item are determined by the XML Schema element declaration. The remaining properties of the element item are determined according to RXER. The [attributes] of the element item SHALL contain an attribute item with the [local name] "type" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance" (i.e., an xsi:type attribute). The [prefix] of this attribute item is determined as specified in Section 6.2.3.1. The [normalized value] of this attribute item is a qualified name for the expanded name of the ASN.1 type, with the namespace prefix determined as specified in Section 6.7.11.1. The element item MUST be self-contained for a CRXER encoding.
由XML模式元素声明验证的元素项,其类型定义为ur类型(即anyType),可以用扩展名称封装ASN.1类型的值的信息集转换。元素项的[namespace name]和[local name]由XML模式元素声明确定。元素项的其余属性根据RXER确定。元素项的[attributes]应包含具有[local name]“type”和[namespace name]的属性项http://www.w3.org/2001/XMLSchema-instance“(即xsi:type属性)。根据第6.2.3.1节的规定确定该属性项的[前缀]。此属性项的[normalized value]是ASN.1类型扩展名的限定名,命名空间前缀按照第6.7.11.1节的规定确定。对于CRXER编码,元素项必须是自包含的。
An element item that is validated by an XML Schema wildcard (i.e., <xs:any/>) MAY be the Infoset translation of a value of a top-level NamedType that is not subject to an ATTRIBUTE encoding instruction and comes from an ASN.1 module with a target namespace [RXEREI] that satisfies the namespace constraint of the wildcard. All the properties of the element item are determined according to RXER. The element item MUST be self-contained for a CRXER encoding.
由XML模式通配符(即,<xs:any/>)验证的元素项可以是顶级NamedType值的信息集转换,该值不受属性编码指令的约束,并且来自ASN.1模块,其目标命名空间[RXEREI]满足通配符的命名空间约束。元素项的所有属性都是根据RXER确定的。对于CRXER编码,元素项必须是自包含的。
An attribute item that is validated by an XML Schema wildcard (i.e., <xs:anyAttribute/>) MAY be the Infoset translation of a value of a top-level NamedType if the NamedType is subject to an ATTRIBUTE encoding instruction, comes from an ASN.1 module with a target namespace that satisfies the namespace constraint of the wildcard, and has a type that does not depend on the QName type in any way. Whatever valid [prefix] is initially chosen for the attribute item MUST be preserved in any re-encoding. The remaining properties of the attribute item are determined according to RXER.
由XML模式通配符(即,<xs:anyAttribute/>)验证的属性项可能是顶级NamedType值的信息集转换,如果NamedType服从属性编码指令,则该属性项来自具有满足通配符的命名空间约束的目标命名空间的ASN.1模块,并且具有一个类型,该类型在任何方面都不依赖于QName类型。初始为属性项选择的任何有效[prefix]必须在任何重新编码中保留。属性项的其余属性根据RXER确定。
No other mechanisms for referencing an ASN.1 type or top-level NamedType from a different XML schema language are supported in this version of RXER. In particular, this excludes an ASN.1 type being used as the base type in an XML Schema derivation by extension or restriction, as a member type for an XML Schema union type, as an item type for an XML Schema list type, or as the type in an XML Schema attribute declaration.
此版本的RXER不支持从其他XML模式语言引用ASN.1类型或顶级NamedType的其他机制。特别是,这排除了ASN.1类型被用作XML模式扩展或限制派生中的基类型、XML模式联合类型的成员类型、XML模式列表类型的项类型或XML模式属性声明中的类型。
A fully conformant RXER implementation will understand both ASN.1 and XML Schema and will recognize the transitions between information items controlled by ASN.1 definitions and those controlled by XML Schema definitions. However, a purely XML Schema validator used to assess the validity of an RXER encoding will perceive any reference to an ASN.1 type or top-level NamedType as an unresolved reference. In order to enable such assessment, it is desirable to provide an XML Schema translation of the ASN.1 definitions being referenced from an XML Schema. Although XML Schema and ASN.1 are broadly similar, they each have unique features that cannot be adequately expressed in the other language, so a semantically equivalent translation is not possible in the general case. Fortunately, to simply achieve successful assessment it is sufficient for the XML Schema translation of an ASN.1 specification to be compatible with that ASN.1 specification. That is, the XML Schema translation MUST be constructed such that every correct RXER encoding is assessed as valid. Although not ideal, it is acceptable for the XML Schema to assess some incorrect RXER encodings as also being valid (a conformant RXER decoder will, of course, reject such an encoding).
完全一致的RXER实现将理解ASN.1和XML模式,并将识别由ASN.1定义控制的信息项与由XML模式定义控制的信息项之间的转换。但是,用于评估RXER编码有效性的纯XML模式验证器会将对ASN.1类型或顶级NamedType的任何引用视为未解析的引用。为了支持这种评估,需要提供从XML模式引用的ASN.1定义的XML模式翻译。尽管XMLSchema和ASN.1大体相似,但它们都有各自独特的特性,无法用另一种语言充分表达,因此在一般情况下不可能进行语义等价的翻译。幸运的是,为了简单地实现成功的评估,ASN.1规范的XML模式转换与该ASN.1规范兼容就足够了。也就是说,XML模式转换的构造必须确保每个正确的RXER编码都是有效的。虽然不理想,但XML模式可以将一些错误的RXER编码评估为有效(当然,一致的RXER解码器将拒绝这种编码)。
The simplest compatible XML Schema translation of an ASN.1 module is one in which every type is equivalent to the XML Schema ur-type. For example, given an ASN.1 type with the reference name MyType, a sufficient compatible XML Schema type definition is:
ASN.1模块最简单的兼容XML模式转换是每个类型都等效于XML模式ur类型的转换。例如,给定一个引用名为MyType的ASN.1类型,一个充分兼容的XML模式类型定义是:
<xs:complexType name="MyType" mixed="true"> <xs:sequence> <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:anyAttribute processContents="lax"/> </xs:complexType>
<xs:complexType name="MyType" mixed="true"> <xs:sequence> <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:anyAttribute processContents="lax"/> </xs:complexType>
OR
或
<xs:complexType name="MyType"> <xs:complexContent> <xs:extension base="xs:anyType"/> </xs:complexContent> </xs:complexType>
<xs:complexType name="MyType"> <xs:complexContent> <xs:extension base="xs:anyType"/> </xs:complexContent> </xs:complexType>
Aside: Because of the possible presence of an asnx:context attribute (Section 6.8.8.1), it is easiest to assume that all ASN.1 types translate into XML Schema complex types.
旁白:由于可能存在asnx:context属性(第6.8.8.1节),因此最容易假设所有ASN.1类型都转换为XML模式复杂类型。
Given an ASN.1 top-level NamedType that is not subject to an ATTRIBUTE encoding instruction and has the reference name myElement, a sufficient compatible XML Schema element declaration is:
给定不受属性编码指令约束且具有引用名称myElement的ASN.1顶级NamedType,充分兼容的XML架构元素声明为:
<xs:element name="myElement"/>
<xs:element name="myElement"/>
Given an ASN.1 top-level NamedType that is subject to an ATTRIBUTE encoding instruction and has the reference name myAttribute, a sufficient compatible XML Schema attribute declaration is:
给定一个ASN.1顶级NamedType,该类型受属性编码指令的约束,并具有引用名称myAttribute,则充分兼容的XML架构属性声明为:
<xs:attribute name="myAttribute"/>
<xs:attribute name="myAttribute"/>
An application specification that mixes ASN.1 and XML Schema is free to provide a stricter translation of its ASN.1 definitions; however, a more thorough treatment for translating an ASN.1 module into an XML Schema is out of scope for this document.
混合了ASN.1和XMLSchema的应用程序规范可以免费提供其ASN.1定义的更严格的翻译;但是,将ASN.1模块转换为XML模式的更彻底的处理方法超出了本文档的范围。
A value of a type with a defined type name is translated according to the type definition on the right-hand side of the type assignment for the type name.
具有已定义类型名的类型的值将根据类型名的类型赋值右侧的类型定义进行转换。
A value of a type denoted by the use of a parameterized type with actual parameters is translated according to the parameterized type with the DummyReferences [X.683] substituted with the actual parameters.
使用带有实际参数的参数化类型表示的类型值根据参数化类型进行转换,并用实际参数替换DummyReferences[X.683]。
A value of a constrained type is translated as a value of the type without the constraint. See X.680 [X.680] and X.682 [X.682] for the details of ASN.1 constraint notation.
受约束类型的值将转换为不受约束的类型的值。有关ASN.1约束表示法的详细信息,请参见X.680[X.680]和X.682[X.682]。
A prefixed type [X.680-1] associates an encoding instruction with a type. A value of a prefixed type is translated as a value of the type without the prefix.
前缀类型[X.680-1]将编码指令与类型相关联。带前缀类型的值转换为不带前缀类型的值。
Aside: This does not mean that RXER encoding instructions are ignored. It is simply easier to describe their effects in relation to specific built-in types, rather than as the translation of a value of a prefixed type.
旁白:这并不意味着RXER编码指令被忽略。与特定的内置类型相比,更容易描述它们的效果,而不是将其转换为前缀类型的值。
A tagged type is a special case of a prefixed type. A value of a tagged type is translated as a value of the type without the tag. ASN.1 tags do not appear in the XML encodings defined by this document.
标记类型是前缀类型的特例。标记类型的值将转换为不带标记的类型的值。ASN.1标记不会出现在本文档定义的XML编码中。
A value of a fixed type denoted by an ObjectClassFieldType is translated according to that fixed type (see Section 6.9 for the case of an ObjectClassFieldType denoting an open type).
由ObjectClassFieldType表示的固定类型的值根据该固定类型进行转换(有关表示开放类型的ObjectClassFieldType的情况,请参见第6.9节)。
A value of a selection type is translated according to the type referenced by the selection type. Note that component encoding instructions are not inherited by the type referenced by a selection type [RXEREI].
选择类型的值将根据选择类型引用的类型进行转换。请注意,组件编码指令不会由选择类型[RXEREI]引用的类型继承。
A value of a type described by TypeFromObject notation [X.681] is translated according to the denoted type.
TypeFromObject表示法[X.681]描述的类型值根据所表示的类型进行转换。
A value of a type described by ValueSetFromObjects notation [X.681] is translated according to the governing type.
ValueSetFromObjects符号[X.681]描述的类型的值根据管理类型进行转换。
For the purposes of this document, a TypeWithConstraint is treated as if it were the parent type [X.680] (either a SEQUENCE OF or SET OF type).
在本文档中,TypeWithConstraint被视为父类型[X.680](类型序列或类型集)。
For example,
例如
SEQUENCE SIZE(1..MAX) OF SomeType
某种类型的序列大小(1..MAX)
is treated like
被当作
SEQUENCE OF SomeType
某种类型的序列
Additionally, a "SEQUENCE OF Type" (including the case where it is the parent type for a TypeWithConstraint) is treated as if it were a "SEQUENCE OF NamedType", where the identifier of the NamedType is assumed to be "item". Similarly, a "SET OF Type" (including the case where it is the parent type for a TypeWithConstraint) is treated as if it were a "SET OF NamedType", where the identifier of the NamedType is assumed to be "item".
此外,“类型序列”(包括它是TypeWithConstraint的父类型的情况)被视为“NamedType序列”,其中NamedType的标识符被假定为“项”。类似地,“类型集”(包括它是TypeWithConstraint的父类型的情况)被视为“NamedType集”,其中NamedType的标识符被假定为“项”。
For example,
例如
SEQUENCE SIZE(1..MAX) OF SomeType
某种类型的序列大小(1..MAX)
is ultimately treated like
最终被当作
SEQUENCE OF item SomeType
项目类型的顺序
For the majority of ASN.1 built-in types, encodings of values of those types never have element content. The encoding of a value of an ASN.1 combining type (except a UNION or LIST type) typically has element content.
对于大多数ASN.1内置类型,这些类型的值编码从来没有元素内容。ASN.1组合类型(联合或列表类型除外)的值的编码通常包含元素内容。
For those types that do not produce element content, the translation of an abstract value is described as a character string of ISO 10646 characters [UCS]. This character data translation will be destined to become either part of the [normalized value] of an attribute item, or a series of character items in the [children] of an element item (which becomes the [parent] for the character items). The case that applies is determined in accordance with Section 6.2.
对于那些不产生元素内容的类型,抽象值的翻译被描述为ISO10646字符[UCS]的字符串。该字符数据转换将成为属性项的[normalized value]的一部分,或元素项的[children]中的一系列字符项(成为字符项的[parent])。根据第6.2节确定适用的情况。
For a non-canonical RXER encoding, if the type of the abstract value is not directly or indirectly a restricted character string type, the NULL type, or a UNION type, then leading and/or trailing white space characters MAY be added to the character data translation.
对于非规范RXER编码,如果抽象值的类型不是直接或间接的受限字符串类型、NULL类型或联合类型,则可以将前导和/或尾随空白字符添加到字符数据转换中。
Aside: White space characters are significant in the encoding of a value of a restricted character string type, and a restricted character string type can be a member type of a UNION type. The encoding of a NULL value produces no character data.
旁白:空格字符在受限字符串类型的值的编码中很重要,受限字符串类型可以是联合类型的成员类型。空值的编码不产生字符数据。
Aside: Optional white space characters are not permitted in a CRXER encoding.
旁白:CRXER编码中不允许使用可选的空白字符。
For a non-canonical RXER encoding, if the type of the abstract value is directly or indirectly the AnyURI, NCName, or Name type, then leading and trailing white space characters MAY be added to the character data translation.
对于非规范RXER编码,如果抽象值的类型直接或间接为AnyURI、NCName或Name类型,则可以将前导和尾随空格字符添加到字符数据转换中。
Aside: These types are indirectly a restricted character string type (UTF8String); however, their definitions exclude white space characters, so any white space characters appearing in an encoding are not part of the abstract value and can be safely ignored. This exception does not apply to other subtypes of a restricted character string type that happen to exclude white space characters.
旁白:这些类型间接地是受限字符串类型(UTF8String);但是,它们的定义不包括空格字符,因此编码中出现的任何空格字符都不是抽象值的一部分,可以安全地忽略。此异常不适用于恰好排除空白字符的受限字符串类型的其他子类型。
The character data translation of a value of a restricted character string type is the sequence of characters in the string.
受限字符串类型的值的字符数据转换是字符串中的字符序列。
Depending on the ASN.1 string type, and an application's internal representation of that string type, a character may need to be translated to or from the equivalent ISO 10646 character code [UCS]. The NumericString, PrintableString, IA5String, VisibleString (ISO646String), BMPString, UniversalString, and UTF8String character encodings use the same character codes as ISO 10646. For the remaining string types (GeneralString, GraphicString, TeletexString, T61String, and VideotexString), see X.680 [X.680].
根据ASN.1字符串类型和应用程序对该字符串类型的内部表示,可能需要将字符转换为等效的ISO10646字符代码[UCS],或将其转换为等效的ISO10646字符代码[UCS]。NumericString、PrintableString、IA5String、VisibleString(ISO646String)、BMPString、UniversalString和UTF8String字符编码使用与ISO10646相同的字符代码。对于其余的字符串类型(GeneralString、GraphicsString、TeletextString、T61String和VideotexString),请参见X.680[X.680]。
The null character (U+0000) is not a legal character for XML. It is omitted from the character data translation of a string value.
空字符(U+0000)不是XML的合法字符。它在字符串值的字符数据转换中被省略。
Certain other control characters are legal for XML version 1.1, but not for version 1.0. If any string value contains these characters, then the RXER encoding must use XML version 1.1 (see Section 6.12).
某些其他控制字符对于XML 1.1版是合法的,但对于1.0版则不合法。如果任何字符串值包含这些字符,则RXER编码必须使用XML版本1.1(参见第6.12节)。
All white space characters in the RXER encoding of a value of a restricted character string type (excluding the AnyURI, NCName, and Name subtypes) are significant, i.e., part of the abstract value.
受限字符串类型(不包括AnyURI、NCName和Name子类型)的值的RXER编码中的所有空白字符都是重要的,即抽象值的一部分。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of an IA5String value:
以下每个<value>元素的内容都是IA5String值的RXER编码:
<value> Don't run with scissors! </value>
<value> Don't run with scissors! </value>
<value>Markup (e.g., <value>) has to be escaped.</value>
<value>Markup (e.g., <value>) has to be escaped.</value>
<value>Markup (e.g., <![CDATA[<value>]]>) has to be escaped. </value>
<value>Markup (e.g., <![CDATA[<value>]]>) has to be escaped. </value>
The character data translation of a value of the BIT STRING type is either a binary digit string, a hexadecimal digit string, or a list of bit names.
位字符串类型的值的字符数据转换为二进制数字字符串、十六进制数字字符串或位名称列表。
A binary digit string is a sequence of zero, one, or more of the binary digit characters '0' and '1' (i.e., U+0030 and U+0031). Each bit in the BIT STRING value is encoded as a binary digit in order from the first bit to the last bit.
二进制数字字符串是零、一个或多个二进制数字字符“0”和“1”(即U+0030和U+0031)的序列。位字符串值中的每一位都按从第一位到最后一位的顺序编码为二进制数字。
For a non-canonical RXER encoding, if the BIT STRING type has a NamedBitList, then trailing zero bits MAY be omitted from a binary digit string.
对于非规范RXER编码,如果位字符串类型具有NamedBitList,则可以从二进制数字字符串中省略尾随零位。
A hexadecimal digit string is permitted if and only if the number of bits in the BIT STRING value is zero or a multiple of eight and the character data translation is destined for the [children] of an element item.
当且仅当位字符串值中的位数为零或八的倍数,且字符数据转换的目的地为元素项的[子项]时,才允许使用十六进制数字字符串。
A hexadecimal digit string is a sequence of zero, one, or more pairs of the hexadecimal digit characters '0'-'9', 'A'-'F', and 'a'-'f' (i.e., U+0030-U+0039, U+0041-U+0046 and U+0061-U+0066). Each group of eight bits in the BIT STRING value is encoded as a pair of hexadecimal digits where the first bit is the most significant. An odd number of hexadecimal digits is not permitted. The characters 'a'-'f' (i.e., U+0061-U+0066) SHALL NOT be used in the CRXER encoding of a BIT STRING value. If a hexadecimal digit string is used, then the enclosing element's [attributes] MUST contain an attribute item with the [local name] "format", the [namespace name] "urn:ietf:params:xml:ns:asnx", and the [normalized value] "hex" (i.e., asnx:format="hex"). The [prefix] of the attribute item is determined as specified in Section 6.2.3.1.
十六进制数字字符串是由零对、一对或多对十六进制数字字符“0”-“9”、“A”-“F”和“A”-“F”(即U+0030-U+0039、U+0041-U+0046和U+0061-U+0066)组成的序列。位字符串值中的每组八位编码为一对十六进制数字,其中第一位为最高有效位。不允许奇数十六进制数字。字符“a”-“f”(即U+0061-U+0066)不得用于位字符串值的CRXER编码。如果使用十六进制数字字符串,则封闭元素的[attributes]必须包含具有[local name]“format”、[namespace name]“urn:ietf:params:xml:ns:asnx”和[normalized value]“hex”(即asnx:format=“hex”)的属性项。属性项的[前缀]按照第6.2.3.1节的规定确定。
Aside: The hexadecimal digit string is intended to conform to the lexical representation of the XML Schema [XSD2] hexBinary data type.
旁白:十六进制数字字符串旨在符合XML模式[XSD2]十六进制数据类型的词汇表示。
For a non-canonical RXER encoding, if the preconditions for using a hexadecimal digit string are satisfied, then a hexadecimal digit string MAY be used.
对于非规范RXER编码,如果满足使用十六进制数字字符串的先决条件,则可以使用十六进制数字字符串。
A list of bit names is permitted if and only if the BIT STRING type has a NamedBitList and each '1' bit in the BIT STRING value has a corresponding identifier in the NamedBitList.
当且仅当位字符串类型具有NamedBitList且位字符串值中的每个“1”位在NamedBitList中具有相应的标识符时,才允许位名称列表。
Aside: ASN.1 does not require that an identifier be assigned for every bit.
旁白:ASN.1不要求为每一位分配一个标识符。
A list of bit names is a sequence of names for the '1' bits in the BIT STRING value, in any order, each separated from the next by at least one white space character. If the BitStringType is not subject to a VALUES encoding instruction, then each '1' bit in the BIT STRING value is represented by its corresponding identifier from the NamedBitList. If the BitStringType is subject to a VALUES encoding instruction, then each '1' bit in the BIT STRING value is represented by the replacement name [RXEREI] for its corresponding identifier.
位名称列表是位字符串值中“1”位的名称序列,按任意顺序排列,每个位与下一位之间至少有一个空格字符分隔。如果BitStringType不受值编码指令的约束,则位字符串值中的每个“1”位由NamedBitList中相应的标识符表示。如果BitStringType受值编码指令的约束,则位字符串值中的每个“1”位由其对应标识符的替换名[RXEREI]表示。
For a CRXER encoding, if the BIT STRING type has a NamedBitList, then a binary digit string MUST be used, and trailing zero bits MUST be omitted from the binary digit string; else if the number of bits in the BIT STRING value is greater than or equal to 64, and the preconditions for using a hexadecimal digit string are satisfied, then a hexadecimal digit string MUST be used; otherwise, a binary digit string MUST be used.
对于CRXER编码,如果位字符串类型具有NamedBitList,则必须使用二进制数字字符串,并且必须从二进制数字字符串中省略尾随零位;否则,如果位字符串值中的位数大于或等于64,并且满足使用十六进制数字字符串的先决条件,则必须使用十六进制数字字符串;否则,必须使用二进制数字字符串。
Aside: Because the asnx:format attribute adds an overhead to a hexadecimal encoding (including a namespace declaration for the "asnx" prefix), a bit string of less than 64 bits is more compactly encoded as a binary digit string.
旁白:因为asnx:format属性为十六进制编码(包括“asnx”前缀的名称空间声明)增加了开销,所以小于64位的位字符串更紧凑地编码为二进制数字字符串。
Examples
例子
Consider this type definition:
考虑这种类型定义:
BIT STRING { black(0), red(1), orange(2), yellow(3), green(4), blue(5), indigo(6), violet(7) }
BIT STRING { black(0), red(1), orange(2), yellow(3), green(4), blue(5), indigo(6), violet(7) }
The content and attributes of each of the following <value> elements are an RXER encoding of the same abstract value:
以下<value>元素的内容和属性都是相同抽象值的RXER编码:
<value> green violet orange</value>
<value> green violet orange</value>
<value> 001<!--Orange-->01001 </value>
<value> 001<!--Orange-->01001 </value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:format="hex"> 29 </value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:format="hex"> 29 </value>
<value>00101001</value>
<value>00101001</value>
The final case contains the CRXER encoding of the abstract value.
最后一个案例包含抽象值的CRXER编码。
For a non-canonical RXER encoding, the character data translation of the BOOLEAN value TRUE is the string "true" or "1", at the encoder's discretion. For a CRXER encoding, the character data translation of the BOOLEAN value TRUE is the string "true".
对于非规范RXER编码,布尔值TRUE的字符数据转换为字符串“TRUE”或“1”,由编码器自行决定。对于CRXER编码,布尔值TRUE的字符数据转换为字符串“TRUE”。
For a non-canonical RXER encoding, the character data translation of the BOOLEAN value FALSE is the string "false" or "0", at the encoder's discretion. For a CRXER encoding, the character data translation of the BOOLEAN value FALSE is the string "false".
对于非规范RXER编码,布尔值FALSE的字符数据转换为字符串“FALSE”或“0”,由编码器自行决定。对于CRXER编码,布尔值FALSE的字符数据转换为字符串“FALSE”。
Aside: The RXER encoding of BOOLEAN values is intended to conform to the lexical representation of the XML Schema [XSD2] boolean data type.
旁白:布尔值的RXER编码旨在符合XML模式[XSD2]布尔数据类型的词汇表示。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of a BOOLEAN value:
以下每个<value>元素的内容都是布尔值的RXER编码:
<value>1</value>
<value>1</value>
<value> false </value>
<value> false </value>
<value> fal<!-- a pesky comment -->se </value>
<value> fal<!-- a pesky comment -->se </value>
The character data translation of a value of an ENUMERATED type where the EnumeratedType is not subject to a VALUES encoding instruction is the identifier corresponding to the actual value.
枚举类型的值的字符数据转换,其中枚举类型不受值编码指令的约束,是与实际值相对应的标识符。
Examples
例子
Consider this type definition:
考虑这种类型定义:
ENUMERATED { sunday, monday, tuesday, wednesday, thursday, friday, saturday }
经点算{星期日、星期一、星期二、星期三、星期四、星期五、星期六}
The content of both of the following <value> elements is the RXER encoding of a value of the above type:
以下两个<value>元素的内容都是上述类型值的RXER编码:
<value>monday</value>
<value>monday</value>
<value> thursday </value>
<value> thursday </value>
The character data translation of a value of an ENUMERATED type where the EnumeratedType is subject to a VALUES encoding instruction is the replacement name [RXEREI] for the identifier corresponding to the actual value.
枚举类型的值的字符数据转换,其中枚举类型服从值编码指令,是对应于实际值的标识符的替换名称[RXEREI]。
Examples
例子
Consider this type definition:
考虑这种类型定义:
[RXER:VALUES ALL CAPITALIZED, sunday AS "SUNDAY", saturday AS "SATURDAY"] ENUMERATED { sunday, monday, tuesday, wednesday, thursday, friday, saturday }
[RXER:值全部大写,周日为“周日”,周六为“周六”]枚举{周日、周一、周二、周三、周四、周五、周六}
The content of each of the following <value> elements is the RXER encoding of a value of the above type:
以下<value>元素的内容均为上述类型值的RXER编码:
<value>SUNDAY</value>
<value>SUNDAY</value>
<value> Monday </value>
<value> Monday </value>
<value> Tuesday </value>
<value> Tuesday </value>
The character data translation of a value of the GeneralizedTime type is a date, the letter 'T' (U+0054), a time of day, optional fractional seconds, and an optional time zone.
GeneratedTime类型的值的字符数据转换为日期、字母“T”(U+0054)、时间、可选分数秒和可选时区。
The date is two decimal digits representing the century, followed by two decimal digits representing the year, a hyphen ('-', U+002D), two decimal digits representing the month, a hyphen ('-', U+002D), and two decimal digits representing the day.
日期是表示世纪的两个十进制数字,后面是表示年份的两个十进制数字、连字符('-',U+002D)、表示月份的两个十进制数字、连字符('-',U+002D)和表示日期的两个十进制数字。
The time of day is two decimal digits representing the hour, followed by a colon (':', U+003A), two decimal digits representing the minutes, a colon (':', U+003A), and two decimal digits representing the seconds.
一天中的时间是表示小时的两个十进制数字,后跟一个冒号(“:”,U+003A),两个十进制数字表示分钟,一个冒号(“:”,U+003A),两个十进制数字表示秒。
Note that the hours value "24" is disallowed [X.680].
请注意,不允许使用小时数值“24”[X.680]。
A GeneralizedTime value with fractional hours or minutes is first converted to the equivalent time with whole minutes and seconds and, if necessary, fractional seconds.
带有分数小时或分钟的GeneralizedTime值首先转换为带有整分和整秒的等效时间,必要时还可以转换为分数秒。
The minutes are encoded as "00" if the GeneralizedTime value omits minutes. The seconds are encoded as "00" if the GeneralizedTime value omits seconds.
如果GeneratedTime值忽略分钟,则分钟编码为“00”。如果GeneratedTime值忽略秒,则秒编码为“00”。
The fractional seconds part is a full stop ('.', U+002E) followed by zero, one, or more decimal digits (U+0030-U+0039). For a CRXER encoding, trailing zero digits (U+0030) in the fractional seconds SHALL be omitted, and the full stop SHALL be omitted if there are no following digits.
小数秒部分是一个句号('.',U+002E),后跟零、一个或多个十进制数字(U+0030-U+0039)。对于CRXER编码,小数秒内的尾随零位(U+0030)应省略,如果没有以下数字,则应省略句号。
The time zone, if present, is either the letter 'Z' (U+005A) to indicate Coordinated Universal Time, a plus sign ('+', U+002B) followed by a time zone differential, or a minus sign ('-', U+002D) followed by a time zone differential.
时区(如果存在)是字母“Z”(U+005A),表示协调世界时,加号(“+”,U+002B)后跟时区差分,或者减号(“-”,U+002D)后跟时区差分。
A time zone differential indicates the difference between local time (the time specified by the preceding date and time of day) and Coordinated Universal Time. Coordinated Universal Time can be calculated from the local time by subtracting the differential.
时区差表示本地时间(前一日期和时间指定的时间)与协调世界时之间的差。通过减去差分,可以从当地时间计算协调世界时。
For a CRXER encoding, a GeneralizedTime value with a time zone differential SHALL be encoded as the equivalent Coordinated Universal Time, i.e., the time zone will be "Z".
对于CRXER编码,带有时区差分的广义时间值应编码为等效协调世界时,即时区为“Z”。
A local time GeneralizedTime value is not converted to Coordinated Universal Time for a CRXER encoding. Other canonical ASN.1 encoding rules specify that local times must be encoded as Coordinated Universal Time but do not specify a method to convert a local time to a Coordinated Universal Time. Consequently, canonicalization of local time values is unreliable and applications SHOULD NOT use local time.
对于CRXER编码,本地时间GeneratedTime值不会转换为协调通用时间。其他规范的ASN.1编码规则指定本地时间必须编码为协调世界时,但未指定将本地时间转换为协调世界时的方法。因此,本地时间值的规范化是不可靠的,应用程序不应该使用本地时间。
A time zone differential is encoded as two decimal digits representing hours, a colon (':', U+003A), and two decimal digits representing minutes. The minutes are encoded as "00" if the GeneralizedTime value omits minutes from the time zone differential.
时区差分编码为表示小时的两个十进制数字、冒号(“:”,U+003A)和表示分钟的两个十进制数字。如果GeneratedTime值从时区差中忽略分钟数,则分钟数编码为“00”。
Aside: The RXER encoding of GeneralizedTime values is intended to conform to the lexical representation of the XML Schema [XSD2] dateTime data type.
旁白:GeneratedTime值的RXER编码旨在符合XML模式[XSD2]日期时间数据类型的词汇表示。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of a GeneralizedTime value:
以下每个<value>元素的内容都是GeneralizedTime值的RXER编码:
<value>2004-06-15T12:00:00Z</value>
<value>2004-06-15T12:00:00Z</value>
<value> 2004-06-15T02:00:00+10:00 </value>
<value> 2004-06-15T02:00:00+10:00 </value>
<value> 2004-06-15T12:00:00.5 </value>
<value> 2004-06-15T12:00:00.5 </value>
For a CRXER encoding, the character data translation of a value of an IntegerType is a canonical number string representing the integer value.
对于CRXER编码,IntegerType值的字符数据转换是表示整数值的规范数字字符串。
A canonical number string is either the digit character '0' (U+0030), or an optional minus sign ('-', U+002D) followed by a non-zero decimal digit character (U+0031-U+0039) followed by zero, one, or more of the decimal digit characters '0' to '9' (U+0030-U+0039).
标准数字字符串可以是数字字符“0”(U+0030),也可以是可选的减号('-',U+002D),后跟非零十进制数字字符(U+0031-U+0039),后跟零、一个或多个十进制数字字符“0”到“9”(U+0030-U+0039)。
For a non-canonical RXER encoding, the character data translation of a value of the IntegerType without a NamedNumberList is a number string representing the integer value.
对于非规范RXER编码,不带NamedNumber列表的IntegerType值的字符数据转换是表示整数值的数字字符串。
A number string is a sequence of one or more of the decimal digit characters '0' to '9' (U+0030-U+0039), with an optional leading sign, either '+' (U+002B) or '-' (U+002D). Leading zero digits are permitted in a number string for a non-canonical RXER encoding.
数字字符串是一个或多个十进制数字字符“0”到“9”(U+0030-U+0039)的序列,带有可选的前导符号“+”(U+002B)或“-”(U+002D)。对于非规范RXER编码,允许在数字字符串中使用前导零位。
Aside: The RXER encoding of values of the IntegerType without a NamedNumberList is intended to conform to the lexical representation of the XML Schema [XSD2] integer data type.
旁白:不带NamedNumber列表的IntegerType值的RXER编码旨在符合XML模式[XSD2]整数数据类型的词法表示。
For a non-canonical RXER encoding, if the IntegerType has a NamedNumberList, and the NamedNumberList defines an identifier for the actual value, and the IntegerType is not subject to a VALUES encoding instruction, then the character data translation of the value is either a number string or the identifier.
对于非规范RXER编码,如果IntegerType具有NamedNumber列表,并且NamedNumber列表定义了实际值的标识符,并且IntegerType不受值编码指令的约束,则值的字符数据转换为数字字符串或标识符。
Examples
例子
Consider this type definition:
考虑这种类型定义:
INTEGER { zero(0), one(1) }
INTEGER { zero(0), one(1) }
The content of each of the following <value> elements is the RXER encoding of a value of the above type:
以下<value>元素的内容均为上述类型值的RXER编码:
<value>0</value>
<value>0</value>
<value> zero </value>
<value> zero </value>
<value> 2 <!-- This number doesn't have a name. --> </value>
<value> 2 <!-- This number doesn't have a name. --> </value>
<value>00167</value>
<value>00167</value>
For a non-canonical RXER encoding, if the IntegerType is subject to a VALUES encoding instruction (it necessarily must have a NamedNumberList) and the NamedNumberList defines an identifier for the actual value, then the character data translation of the value is either a number string or the replacement name [RXEREI] for the identifier.
对于非规范RXER编码,如果IntegerType遵循值编码指令(它必须具有NamedNumber列表),并且NamedNumber列表定义了实际值的标识符,则值的字符数据转换为数字字符串或标识符的替换名[RXEREI]。
Examples
例子
Consider this type definition:
考虑这种类型定义:
[RXER:VALUES ALL UPPERCASED] INTEGER { zero(0), one(1) }
[RXER:VALUES ALL UPPERCASED] INTEGER { zero(0), one(1) }
The content of both of the following <value> elements is the RXER encoding of a value of the above type:
以下两个<value>元素的内容都是上述类型值的RXER编码:
<value>0</value>
<value>0</value>
<value> ZERO </value>
<value> ZERO </value>
The character data translation of a value of the NULL type is an empty character string.
NULL类型的值的字符数据转换为空字符串。
Examples
例子
<value/>
<value/>
<value><!-- Comments don't matter. --></value>
<value><!-- Comments don't matter. --></value>
<value></value>
<value></value>
The final case is the CRXER encoding.
最后一种情况是CRXER编码。
A value of the ObjectDescriptor type is translated according to the GraphicString type.
ObjectDescriptor类型的值根据GraphicsString类型进行转换。
The character data translation of a value of the OBJECT IDENTIFIER or RELATIVE-OID type is a full stop ('.', U+002E) separated list of the object identifier components of the value.
对象标识符或相对OID类型的值的字符数据转换是该值的对象标识符组件的句号('.',U+002E)分隔列表。
Each object identifier component is translated as a non-negative number string. A non-negative number string is either the digit character '0' (U+0030), or a non-zero decimal digit character (U+0031-U+0039) followed by zero, one, or more of the decimal digit characters '0' to '9' (U+0030-U+0039).
每个对象标识符组件都转换为非负数字符串。非负数字符串是数字字符“0”(U+0030)或非零十进制数字字符(U+0031-U+0039),后跟零、一个或多个十进制数字字符“0”至“9”(U+0030-U+0039)。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of an OBJECT IDENTIFIER value:
以下每个<value>元素的内容是对象标识符值的RXER编码:
<value>2.5.6.0</value>
<value>2.5.6.0</value>
<value> 2.5.4.10 </value>
<value> 2.5.4.10 </value>
<value> 2.5.4.3 <!-- commonName --> </value>
<value> 2.5.4.3 <!-- commonName --> </value>
The character data translation of a value of the OCTET STRING type is the hexadecimal digit string representation of the octets.
八位字节字符串类型的值的字符数据转换是八位字节的十六进制数字字符串表示。
The octets are encoded in order from the first octet to the last octet. Each octet is encoded as a pair of the hexadecimal digit characters '0'-'9', 'A'-'F', and 'a'-'f' (i.e., U+0030-U+0039, U+0041-U+0046, and U+0061-U+0066) where the first digit in the pair corresponds to the four most significant bits of the octet. An odd number of hexadecimal digits is not permitted. The characters 'a'- 'f' (i.e., U+0061-U+0066) SHALL NOT be used in the CRXER encoding of an OCTET STRING value.
八位字节按从第一个八位字节到最后一个八位字节的顺序编码。每个八位字节编码为一对十六进制数字字符“0”-“9”,“a”-“F”和“a”-“F”(即U+0030-U+0039,U+0041-U+0046和U+0061-U+0066),其中该对中的第一个数字对应于八位字节的四个最高有效位。不允许奇数十六进制数字。字符“a”-“f”(即U+0061-U+0066)不得用于八位字节字符串值的CRXER编码。
Aside: The RXER encoding of OCTET STRING values is intended to conform to the lexical representation of the XML Schema [XSD2] hexBinary data type.
XML模式的[xs:OCTET]值表示形式为符合二进制模式的[XSD2]。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of an OCTET STRING value:
以下每个<value>元素的内容都是八位字节字符串值的RXER编码:
<value>27F69A0300</value>
<value>27F69A0300</value>
<value> efA03bFF </value>
<value> efA03bFF </value>
The character data translation of a value of the QName type (Section 4.5) is a qualified name conforming to the QName production of Namespaces in XML 1.0 [XMLNS10].
QName类型值的字符数据转换(第4.5节)是符合XML 1.0[XMLNS10]中名称空间的QName生成的限定名称。
The local part (i.e., LocalPart) of the qualified name SHALL be the value of the local-name component of the QName value.
限定名称的本地部分(即LocalPart)应为QName值的本地名称组件的值。
If the namespace-name component of the QName value is absent, then the namespace prefix (i.e., Prefix) of the qualified name SHALL be absent; otherwise, the namespace prefix is determined as specified in Section 6.7.11.1 using the value of the namespace-name component of the QName value as the namespace name.
如果缺少QName值的名称空间名称组件,则应缺少限定名称的名称空间前缀(即前缀);否则,按照第6.7.11.1节的规定,使用QName值的名称空间名称组件的值作为名称空间名称来确定名称空间前缀。
This section describes how the namespace prefix of a qualified name is determined given the namespace name to which the namespace prefix must map.
本节描述在给定名称空间前缀必须映射到的名称空间名称的情况下,如何确定限定名称的名称空间前缀。
For a CRXER encoding, the namespace prefix of the qualified name is any unused non-canonical namespace prefix unless the [in-scope namespaces] property of the enclosing element item contains a namespace item with a [namespace name] that matches the namespace name. In that case, the [prefix] of that namespace item SHALL be used as the namespace prefix of the qualified name.
对于CRXER编码,限定名称的名称空间前缀是任何未使用的非规范名称空间前缀,除非封闭元素项的[in-scope namespaces]属性包含具有与名称空间名称匹配的[namespace name]的名称空间项。在这种情况下,该名称空间项的[前缀]应用作限定名称的名称空间前缀。
Aside: If the qualified name appears in the [normalized value] of an attribute item, then the enclosing element item is the [owner element] for that attribute item.
旁白:如果限定名称出现在属性项的[normalized value]中,则封闭元素项是该属性项的[owner element]。
For a non-canonical RXER encoding, the namespace prefix of the qualified name is any unused namespace prefix unless the [in-scope namespaces] property of the enclosing element item contains a namespace item with the same [namespace name] as the element item. In that case, the [prefix] of that namespace item MAY be used as the
对于非规范RXER编码,限定名称的命名空间前缀是任何未使用的命名空间前缀,除非封闭元素项的[in-scope namespaces]属性包含与元素项具有相同[namespace name]的命名空间项。在这种情况下,该名称空间项的[前缀]可以用作
namespace prefix of the qualified name. Note that the [prefix] of a namespace item for the default namespace has no value.
限定名称的命名空间前缀。请注意,默认命名空间的命名空间项的[prefix]没有值。
If the namespace prefix of the qualified name is an unused namespace prefix, then a namespace declaration attribute item associating the namespace prefix with the namespace name MUST be added to the [namespace attributes] of the enclosing element item, and a corresponding namespace item MUST be added to the [in-scope namespaces] of the enclosing element item.
如果限定名称的名称空间前缀是未使用的名称空间前缀,则必须将名称空间前缀与名称空间名称关联的名称空间声明属性项添加到封闭元素项的[名称空间属性],并且必须将相应的名称空间项添加到[范围内名称空间]包含的元素项的。
The character data translation of a value of the REAL type is the character string "0" if the value is positive zero, the character string "-0" if the value is negative zero, the character string "INF" if the value is positive infinity, the character string "-INF" if the value is negative infinity, the character string "NaN" if the value is not a number, or a real number otherwise.
实数类型值的字符数据转换为字符串“0”(如果值为正零),字符串“-0”(如果值为负零),字符串“INF”(如果值为正无穷大),字符串“-INF”(如果值为负无穷大),字符串“NaN”如果该值不是数字,或者不是实数,则为。
A real number is the mantissa followed by either the character 'E' (U+0045) or 'e' (U+0065) and the exponent. The character 'e' SHALL NOT be used for a CRXER encoding. If the exponent is zero, then the 'E' or 'e' and exponent MAY be omitted for a non-canonical RXER encoding.
实数是尾数,后跟字符“E”(U+0045)或“E”(U+0065)和指数。字符“e”不得用于CRXER编码。如果指数为零,则对于非规范RXER编码,可以省略“E”或“E”和指数。
The mantissa is a decimal number with an optional leading sign, either '+' (U+002B) or '-' (U+002D). A decimal number is a sequence of one or more of the decimal digit characters '0' to '9' (U+0030-U+0039) optionally partitioned by a single full stop character ('.', U+002E) representing the decimal point. Multiple leading zero digits are permitted for a non-canonical RXER encoding.
尾数是一个带可选前导符号的十进制数,可以是“+”(U+002B)或“-”(U+002D)。十进制数是一个或多个十进制数字字符“0”到“9”(U+0030-U+0039)的序列,可选地由表示小数点的单个句号字符(“.”,U+002E)分割。非规范RXER编码允许多个前导零位。
The exponent is encoded as a number string (see Section 6.7.6).
指数编码为数字字符串(见第6.7.6节)。
Aside: The RXER encoding of REAL values is intended to be compatible with the lexical representation of the XML Schema [XSD2] double data type, but allows real values outside the set permitted by double.
旁白:实值的RXER编码旨在与XMLSchema[XSD2]double数据类型的词法表示兼容,但允许在double允许的集合之外使用实值。
For a CRXER encoding:
对于CRXER编码:
(1) The real number MUST be normalized so that the mantissa has a single non-zero digit immediately to the left of the decimal point.
(1) 实数必须规范化,以便尾数在小数点左侧有一个非零的数字。
(2) Leading zero digits SHALL NOT be used.
(2) 不得使用前导零位。
(3) A leading plus sign SHALL NOT be used in the mantissa or the exponent.
(3) 尾数或指数中不得使用前导加号。
(4) The fractional part of the mantissa (i.e., that part following the decimal point) MUST have at least one digit (which may be '0') and MUST NOT have any trailing zeroes after the first digit.
(4) 尾数的小数部分(即小数点后的部分)必须至少有一个数字(可以是“0”),并且在第一个数字后不得有任何尾随零。
(5) The exponent SHALL be present and SHALL be a canonical number string (see Section 6.7.6).
(5) 指数应为标准数字串(见第6.7.6节)。
Examples
例子
The content of each of the following <value> elements is the RXER encoding of a REAL value:
以下<value>元素的内容都是实值的RXER编码:
<value>3.14159<!-- pi --></value>
<value>3.14159<!-- pi --></value>
<value> 1.0e6 </value>
<value> 1.0e6 </value>
<value> INF </value>
<value> INF </value>
<value> -01e-06 </value>
<value> -01e-06 </value>
The character data translation of a value of the UTCTime type is a date, the letter 'T' (U+0054), a time of day, and a time zone.
UTCTime类型的值的字符数据转换为日期、字母“T”(U+0054)、时间和时区。
The date is two decimal digits representing the year (no century), a hyphen ('-', U+002D), two decimal digits representing the month, a hyphen ('-', U+002D), and two decimal digits representing the day.
日期是两个十进制数字,表示年份(无世纪),一个连字符('-',U+002D),两个十进制数字表示月份,一个连字符('-',U+002D),两个十进制数字表示日期。
The time of day is two decimal digits representing the hour, followed by a colon (':', U+003A), two decimal digits representing the minutes, a colon (':', U+003A), and two decimal digits representing the seconds.
一天中的时间是表示小时的两个十进制数字,后跟一个冒号(“:”,U+003A),两个十进制数字表示分钟,一个冒号(“:”,U+003A),两个十进制数字表示秒。
Note that the hours value "24" is disallowed [X.680].
请注意,不允许使用小时数值“24”[X.680]。
The seconds are encoded as "00" if the UTCTime value omits seconds.
如果UTCTime值忽略秒数,则秒数编码为“00”。
The time zone is either the letter 'Z' (U+005A) to indicate Coordinated Universal Time, a plus sign ('+', U+002B) followed by a time zone differential, or a minus sign ('-', U+002D) followed by a time zone differential.
时区可以是字母“Z”(U+005A)表示协调世界时,加号(“+”,U+002B)后接时区差,或减号(“-”,U+002D)后接时区差。
A time zone differential indicates the difference between local time (the time specified by the preceding date and time of day) and Coordinated Universal Time. Coordinated Universal Time can be calculated from the local time by subtracting the differential.
时区差表示本地时间(前一日期和时间指定的时间)与协调世界时之间的差。通过减去差分,可以从当地时间计算协调世界时。
For a CRXER encoding, a UTCTime value with a time zone differential SHALL be encoded as the equivalent Coordinated Universal Time, i.e., the time zone will be "Z".
对于CRXER编码,带有时区差分的UTCTime值应编码为等效协调世界时,即时区为“Z”。
A time zone differential is encoded as two decimal digits representing hours, a colon (':', U+003A), and two decimal digits representing minutes.
时区差分编码为表示小时的两个十进制数字、冒号(“:”,U+003A)和表示分钟的两个十进制数字。
The chosen alternative of a value of a UNION type corresponds to some NamedType in the UNION type definition (a ChoiceType).
所选的联合类型值的替代项对应于联合类型定义(ChoiceType)中的某个NamedType。
The character data translation of a value of a UNION type is the character data translation of the value of the type of the chosen alternative, i.e., without any kind of encapsulation.
联合类型值的字符数据转换是所选备选类型值的字符数据转换,即,无任何封装。
Leading and trailing white space characters are not permitted to be added to the character data translation of a value of a UNION type (see Section 6.7); however, this does not preclude such white space being added to the character data translation of the value of the chosen alternative.
不允许在联合类型值的字符数据转换中添加前导和尾随空格字符(见第6.7节);然而,这并不排除将此类空白添加到所选备选方案的值的字符数据转换中。
The character data translation of a value of a UNION type is necessarily destined for the [children] of an enclosing element item.
UNION类型的值的字符数据转换必须指定给封闭元素项的[children]。
Aside: This is because the ATTRIBUTE encoding instruction cannot be applied to a NamedType with a type that is a UNION type.
旁白:这是因为属性编码指令不能应用于类型为联合类型的NamedType。
The chosen alternative can be identified by a member attribute item, i.e., an attribute item with the [local name] "member" and [namespace name] "urn:ietf:params:xml:ns:asnx", added to the [attributes] of the enclosing element item. The [prefix] of this attribute item is determined as specified in Section 6.2.3.1. The [normalized value] of the attribute item is a qualified name for the expanded name of the NamedType (see [RXEREI]) corresponding to the chosen alternative.
The chosen alternative can be identified by a member attribute item, i.e., an attribute item with the [local name] "member" and [namespace name] "urn:ietf:params:xml:ns:asnx", added to the [attributes] of the enclosing element item. The [prefix] of this attribute item is determined as specified in Section 6.2.3.1. The [normalized value] of the attribute item is a qualified name for the expanded name of the NamedType (see [RXEREI]) corresponding to the chosen alternative.
Aside: It is not possible to associate a namespace name with a NamedType in a UNION type using the current specification for RXER encoding instructions. Consequently, the [normalized value] of the member attribute item will always contain a qualified name without a namespace prefix.
旁白:使用RXER编码指令的当前规范,无法将命名空间名称与联合类型中的NamedType关联。因此,成员属性项的[normalized value]将始终包含不带命名空间前缀的限定名。
For a CRXER encoding, the member attribute item MUST be used, and the [normalized value] of the attribute item MUST be the CRXER translation of the QName value equal to the expanded name.
对于CRXER编码,必须使用成员属性项,属性项的[normalized value]必须是QName值等于扩展名称的CRXER翻译。
In the absence of a member attribute item, an RXER decoder MUST determine the chosen alternative by considering the alternatives of the choice in the order prescribed below and accepting the first alternative for which the encoding is valid.
在没有成员属性项的情况下,RXER解码器必须通过按照下面规定的顺序考虑选择的备选方案并接受编码有效的第一个备选方案来确定所选备选方案。
If the UNION encoding instruction has a PrecedenceList, then the alternatives of the ChoiceType referenced by the PrecedenceList are considered in the order identified by that PrecedenceList, then the remaining alternatives are considered in the order of their definition in the ChoiceType. If the UNION encoding instruction does not have a PrecedenceList, then all the alternatives of the ChoiceType are considered in the order of their definition in the ChoiceType.
如果UNION编码指令具有PrecenceList,则PrecenceList引用的ChoiceType的备选方案将按照该PrecenceList标识的顺序考虑,其余备选方案将按照其在ChoiceType中的定义顺序考虑。如果UNION编码指令没有PrecenceList,则ChoiceType的所有替代项都将按照其在ChoiceType中的定义顺序考虑。
A non-canonical RXER encoder MUST use the member attribute item if an RXER decoder would determine the chosen alternative to be something other than the actual chosen alternative of the CHOICE value being translated; otherwise, the member attribute item MAY be used.
如果RXER解码器将确定所选备选方案不是所翻译的选择值的实际所选备选方案,则非规范RXER编码器必须使用成员属性项;否则,可以使用成员属性项。
Examples
例子
Consider this type definition:
考虑这种类型定义:
[RXER:UNION PRECEDENCE serialNumber] CHOICE { name [0] IA5String, serialNumber [1] INTEGER }
[RXER:UNION PRECEDENCE serialNumber] CHOICE { name [0] IA5String, serialNumber [1] INTEGER }
In the absence of a member attribute, an RXER decoder would first consider whether the received encoding was a valid serialNumber (an INTEGER) before considering whether it was a valid name (an IA5String).
在缺少成员属性的情况下,RXER解码器将首先考虑接收的编码是否是有效的序号(整数),然后才考虑它是否是一个有效的名称(IA5Stand)。
The content and attributes of each of the following <value> elements are the RXER encoding of a value of the above type:
以下<value>元素的内容和属性都是上述类型值的RXER编码:
<value>Bob</value>
<value>Bob</value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:member="name">Alice</value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:member="name">Alice</value>
<value> <!-- Don't have a name for this one! --> 344 </value>
<value> <!-- Don't have a name for this one! --> 344 </value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:member="name"><!-- A strange name. -->100</value>
<value xmlns:asnx="urn:ietf:params:xml:ns:asnx" asnx:member="name"><!-- A strange name. -->100</value>
The member attribute is required in the final case to prevent the value being interpreted as a serialNumber.
在最后一种情况下需要member属性,以防止该值被解释为serialNumber。
If the UNION (i.e., CHOICE) type is extensible [X.680], then an application MUST accept and be prepared to re-encode (using the same encoding rules) any unknown extension in received encoded values of the type. An unknown extension in a value of a UNION type (an unknown alternative) takes the form of an unknown name in the [normalized value] of the member attribute and/or character data in the [children] of the enclosing element item that do not conform to any of the known alternatives.
如果UNION(即CHOICE)类型是可扩展的[X.680],则应用程序必须接受并准备重新编码(使用相同的编码规则)该类型的已接收编码值中的任何未知扩展。联合类型(未知替代项)值中的未知扩展名的形式为成员属性的[normalized value]中的未知名称和/或封闭元素项的[children]中不符合任何已知替代项的字符数据。
To enable re-encoding of an unknown alternative, it is necessary to retain the [normalized value] of the member attribute, if present, and the [children] property of the enclosing element item.
要启用未知替代项的重新编码,必须保留成员属性(如果存在)的[normalized value]和封闭元素项的[children]属性。
The character data for an unknown alternative may contain qualified names that depend on the [in-scope namespaces] of the enclosing element item for their interpretation. Therefore, semantically faithful re-encoding of an unknown alternative may require reproduction of at least some part of the [in-scope namespaces] of the enclosing element item. The problem is deciding which of the namespace items are actually needed. In the absence of type information, it is not possible to discern whether anything that syntactically resembles a qualified name in the character data of the enclosing element item actually is a qualified name. The simplest approach is to retain all the namespace items from the [in-scope namespaces] of the enclosing element item and output them as namespace declaration attribute items in the [namespace attributes] of the enclosing element item when re-encoding the unknown alternative. At best, an application can omit the namespace items that do not define the namespace prefix of any potential qualified name.
未知备选方案的字符数据可能包含限定名,这些限定名依赖于封闭元素项的[范围内名称空间]进行解释。因此,在语义上忠实地重新编码未知替代方案可能需要复制封闭元素项的至少部分[范围内名称空间]。问题在于决定实际需要哪些名称空间项。在缺少类型信息的情况下,无法辨别在语法上类似于封闭元素项的字符数据中的限定名的任何内容是否实际上是限定名。最简单的方法是保留封闭元素项的[in-scope namespaces]中的所有命名空间项,并在重新编码未知替代项时将其作为封闭元素项的[namespace attributes]中的命名空间声明属性项输出。充其量,应用程序可以省略未定义任何潜在限定名称的名称空间前缀的名称空间项。
An application MUST retain the namespace items in the [in-scope namespaces] of the enclosing element item that define the namespace prefixes of all the potential qualified names in the [children] of the enclosing element item. Other namespace items in the [in-scope namespaces] of the enclosing element item MAY be retained. The effect of these retained namespace items on the [namespace attributes] and [in-scope namespaces] of the enclosing element item when re-encoding is considered in Section 6.2.2.1.
An application MUST retain the namespace items in the [in-scope namespaces] of the enclosing element item that define the namespace prefixes of all the potential qualified names in the [children] of the enclosing element item. Other namespace items in the [in-scope namespaces] of the enclosing element item MAY be retained. The effect of these retained namespace items on the [namespace attributes] and [in-scope namespaces] of the enclosing element item when re-encoding is considered in Section 6.2.2.1.
Aside: The context attribute (Section 6.8.8) is not added to the [attributes] of the enclosing element item when re-encoding an unknown alternative since the type of a NamedType in a UNION type cannot be the Markup type.
旁白:重新编码未知替代项时,上下文属性(第6.8.8节)不会添加到封闭元素项的[attributes],因为联合类型中NamedType的类型不能是标记类型。
The character data translation of a value of a LIST type (a SEQUENCE OF NamedType) is the concatenation of the character data translations of the component values, i.e., the abstract values of the type of the NamedType, each separated from the next by at least one white space character. For a CRXER encoding, separating white space MUST be exactly one space character (U+0020).
列表类型值(NamedType序列)的字符数据转换是组件值(即NamedType类型的抽象值)的字符数据转换的串联,每个值与下一个值之间至少有一个空格字符分隔。对于CRXER编码,分隔的空白必须正好是一个空格字符(U+0020)。
Example
实例
Consider this type definition:
考虑这种类型定义:
[LIST] SEQUENCE OF timeStamp GeneralizedTime
[列表]时间戳的序列GeneralizedTime
The content of the following <value> element is the RXER encoding of a value of the above type:
以下<value>元素的内容是上述类型值的RXER编码:
<value> 2004-06-15T12:14:56Z 2004-06-15T12:18:13Z 2004-06-15T01:00:25Z </value>
<value> 2004-06-15T12:14:56Z 2004-06-15T12:18:13Z 2004-06-15T01:00:25Z </value>
The encoding of a value of an ASN.1 combining type (except a UNION or LIST type) typically has element content.
ASN.1组合类型(联合或列表类型除外)的值的编码通常包含元素内容。
The Infoset translation of a value of a specific ASN.1 combining type (excluding a UNION or LIST type) contains zero or more attribute items to be added to the [attributes] of the enclosing element item and zero or more element items to be added to the [children] of the enclosing element item. These translations are described in Sections 6.8.1 to 6.8.7.
特定ASN.1组合类型(不包括联合或列表类型)的值的信息集转换包含零个或多个要添加到封闭元素项的[attributes]的属性项,以及零个或多个要添加到封闭元素项的[children]的元素项。第6.8.1节至第6.8.7节对这些翻译进行了描述。
For a non-canonical RXER encoding, white space character items MAY be added to the [children] of the enclosing element item (before or after any other items).
对于非规范RXER编码,可以将空白字符项添加到封闭元素项的[子项](在任何其他项之前或之后)。
For a CRXER encoding, a character item with the [character code] U+000A (a line feed) MUST be inserted immediately before each element item in the [children] of the enclosing element item. No other white space character items are permitted to be added to the [children] of the enclosing element item.
对于CRXER编码,必须将带有[character code]U+000A(换行符)的字符项插入封闭元素项的[children]中的每个元素项之前。不允许将其他空白字符项添加到封闭元素项的[子项]。
Aside: Without the single line feed character before each child element, a typical CRXER encoding would be a single, very long line.
旁白:如果在每个子元素之前没有单行换行符,典型的CRXER编码将是一个非常长的单行。
A value of the unrestricted CHARACTER STRING type is translated according to the corresponding SEQUENCE type defined in Clause 40.5 of X.680 [X.680].
无限制字符串类型的值根据X.680[X.680]第40.5条中定义的相应序列类型进行转换。
The chosen alternative of a value of a CHOICE type corresponds to, and is a value of (see Section 6), some NamedType in the CHOICE type definition.
选择类型值的所选备选值对应于选择类型定义中的某个NamedType,并且是该类型的值(参见第6节)。
The translation of a value of a CHOICE type other than the Markup type or a UNION type (see Section 6.7.14) is the translation of the value of the NamedType corresponding to the actual chosen alternative.
除标记类型或联合类型(见第6.7.14节)以外的选择类型的值的翻译是对应于实际选择的备选方案的NamedType值的翻译。
Examples
例子
Consider this type definition:
考虑这种类型定义:
CHOICE { name [0] IA5String, serialNumber [1] INTEGER }
CHOICE { name [0] IA5String, serialNumber [1] INTEGER }
The content of each of the following <value> elements is the RXER encoding of a value of the above type:
以下<value>元素的内容均为上述类型值的RXER编码:
<value><name>Bob</name></value>
<value><name>Bob</name></value>
<value> <name>Alice</name> </value>
<value> <name>Alice</name> </value>
<value> <!-- Don't have a name for this one! --> <serialNumber> 344 </serialNumber> </value>
<value> <!-- Don't have a name for this one! --> <serialNumber> 344 </serialNumber> </value>
<value> <!-- A strange name. --> <name>100</name> </value>
<value> <!-- A strange name. --> <name>100</name> </value>
If the CHOICE type is extensible [X.680], then an application MUST accept, and be prepared to re-encode (in RXER), any attribute item or child element item with a name that is not recognized (see Section 6.8.8).
如果选择类型是可扩展的[X.680],则应用程序必须接受并准备重新编码(在RXER中)任何名称不可识别的属性项或子元素项(参见第6.8.8节)。
A value of the EMBEDDED PDV type is translated according to the corresponding SEQUENCE type defined in Clause 33.5 of X.680 [X.680].
嵌入PDV类型的值根据X.680[X.680]第33.5条中定义的相应序列类型进行转换。
A value of the EXTERNAL type is translated according to the corresponding SEQUENCE type defined in Clause 8.18.1 of X.690 [X.690].
外部类型的值根据X.690[X.690]第8.18.1条中定义的相应序列类型进行转换。
A value of the INSTANCE OF type is translated according to the corresponding SEQUENCE type defined in Annex C of X.681 [X.681].
类型实例的值根据X.681[X.681]附录C中定义的相应序列类型进行转换。
Each component value of a value of a SEQUENCE or SET type corresponds to, and is a value of (see Section 6), some NamedType in the SEQUENCE or SET type definition.
序列或集合类型的值的每个分量值对应于序列或集合类型定义中的某个命名类型,并且是该类型的值(参见第6节)。
A value of a SEQUENCE or SET type, other than the QName type (Section 4.5), is translated by translating in turn each component value actually present in the SEQUENCE or SET value and adding the resulting attribute items and/or element items to the [attributes] and/or [children] of the enclosing element item. Attribute items may be added to the [attributes] of the enclosing element item in any order. Element items resulting from the translation of component
序列或集合类型的值(QName类型除外)(第4.5节)通过依次转换序列或集合值中实际存在的每个分量值,并将结果属性项和/或元素项添加到封闭元素项的[属性]和/或[子项]来转换。属性项可以按任何顺序添加到封闭元素项的[attributes]。组件转换产生的元素项
values MUST be appended to the [children] of the enclosing element item in the order of the component values' corresponding NamedType definitions in the SEQUENCE or SET type definition.
值必须按照序列或集合类型定义中组件值对应的NamedType定义的顺序附加到封闭元素项的[子项]。
Aside: In the case of the SET type, this is a deliberate departure from BER [X.690], where the components of a SET can be encoded in any order.
旁白:在集合类型的情况下,这是对BER[X.690]的故意背离,在BER[X.690]中,集合的组件可以按任何顺序编码。
If a DEFAULT value is defined for a NamedType and the value of the NamedType is the same as the DEFAULT value, then the translation of the value of the NamedType SHALL be omitted for a CRXER encoding and MAY be omitted for a non-canonical RXER encoding.
如果为NamedType定义了默认值,且NamedType的值与默认值相同,则对于CRXER编码,应省略NamedType值的翻译,对于非规范RXER编码,可省略。
Examples
例子
Consider this type definition:
考虑这种类型定义:
SEQUENCE { name [0] IA5String OPTIONAL, partNumber [1] INTEGER, quantity [2] INTEGER DEFAULT 0 }
SEQUENCE { name [0] IA5String OPTIONAL, partNumber [1] INTEGER, quantity [2] INTEGER DEFAULT 0 }
The content of each of the following <value> elements is the RXER encoding of a value of the above type:
以下<value>元素的内容均为上述类型值的RXER编码:
<value> <partNumber>23</partNumber> <!-- The quantity defaults to zero. --> </value>
<value> <partNumber>23</partNumber> <!-- The quantity defaults to zero. --> </value>
<value> <name>chisel</name> <partNumber> 37 </partNumber> <quantity> 0 </quantity> </value>
<value> <name>chisel</name> <partNumber> 37 </partNumber> <quantity> 0 </quantity> </value>
<value> <!-- The name component is optional. --> <partNumber>1543</partNumber> <quantity>29</quantity> </value>
<value> <!-- The name component is optional. --> <partNumber>1543</partNumber> <quantity>29</quantity> </value>
If the SEQUENCE or SET type is extensible [X.680], then an application MUST accept, and be prepared to re-encode (in RXER), any attribute item or child element item with a name that is not recognized (see Section 6.8.8).
如果序列或集合类型是可扩展的[X.680],则应用程序必须接受并准备重新编码(在RXER中)任何名称不可识别的属性项或子元素项(见第6.8.8节)。
Each component value of a value of a type that is a SET OF NamedType or a SEQUENCE OF NamedType corresponds to, and is a value of (see Section 6), the NamedType in the type definition.
作为一组NamedType或一系列NamedType的类型的值的每个组件值对应于类型定义中的NamedType,并且是该NamedType的值(参见第6节)。
A value of a type that is a SET OF NamedType, or a SEQUENCE OF NamedType other than a LIST type (see Section 6.7.15), is translated by adding the translation of each value of the NamedType to the [children] of the enclosing element item.
通过将NamedType的每个值的转换添加到封闭元素项的[子项]中,转换为一组NamedType或一系列NamedType而非列表类型(见第6.7.15节)的类型值。
Aside: An ATTRIBUTE encoding instruction cannot appear in the component type for a SEQUENCE OF or SET OF type, so there are no attribute items to add to the [attributes] of the enclosing element item.
旁白:属性编码指令不能出现在类型序列或类型集的组件类型中,因此没有要添加到封闭元素项的[attributes]中的属性项。
If the type is a SEQUENCE OF NamedType, then the values of the NamedType are translated in the order in which they appear in the value of the type.
如果类型是NamedType的序列,则NamedType的值将按照它们在类型值中出现的顺序进行转换。
For a non-canonical RXER encoding, if the type is a SET OF NamedType, then the values of the NamedType may be translated in any order.
对于非规范RXER编码,如果类型是一组NamedType,则NamedType的值可以按任意顺序转换。
For a CRXER encoding, if the type is a SET OF NamedType, then the values of the NamedType MUST be translated in ascending order where the order is determined by comparing the octets of their CRXER encodings (which will be UTF-8 encoded character strings; see Section 6.12.2). A shorter encoding is ordered before a longer encoding that is identical up to the length of the shorter encoding.
对于CRXER编码,如果类型是一组NamedType,则必须按升序翻译NamedType的值,其中顺序是通过比较其CRXER编码的八位字节来确定的(将是UTF-8编码字符串;请参见第6.12.2节)。短编码在长编码之前排序,长编码的长度与短编码的长度相同。
Examples
例子
Consider this type definition:
考虑这种类型定义:
SEQUENCE OF timeStamp GeneralizedTime
时间戳序列
The content of the following <value> element is the RXER encoding of a value of the above type:
以下<value>元素的内容是上述类型值的RXER编码:
<value> <timeStamp>2004-06-15T12:14:56Z</timeStamp> <timeStamp>2004-06-15T12:18:13Z</timeStamp> <timeStamp> 2004-06-15T01:00:25Z </timeStamp> </value>
<value> <timeStamp>2004-06-15T12:14:56Z</timeStamp> <timeStamp>2004-06-15T12:18:13Z</timeStamp> <timeStamp> 2004-06-15T01:00:25Z </timeStamp> </value>
Consider this type definition (also see Section 6.6):
考虑这个类型定义(也见第6.6节):
SEQUENCE OF INTEGER
整数序列
The content of the following <value> element is the RXER encoding of a value of the above type:
以下<value>元素的内容是上述类型值的RXER编码:
<value> <item>12</item> <item> 9 </item> <item> 7 <!-- A prime number. --></item> </value>
<value> <item>12</item> <item> 9 </item> <item> 7 <!-- A prime number. --></item> </value>
An application must accept and be prepared to re-encode (using the same encoding rules) any unknown extension appearing in the encoding of a value of an extensible CHOICE, SEQUENCE, or SET type. An unknown extension in a value of an extensible combining type (except UNION types) takes the form of unknown element and/or attribute items. Section 6.8.8.1 describes the processing of unknown element items and Section 6.8.8.2 describes the processing of unknown attribute items.
应用程序必须接受并准备重新编码(使用相同的编码规则)在可扩展选项、序列或集合类型的值的编码中出现的任何未知扩展。可扩展组合类型(联合类型除外)的值中的未知扩展采用未知元素和/或属性项的形式。第6.8.8.1节描述了未知元素项的处理,第6.8.8.2节描述了未知属性项的处理。
An application cannot produce a canonical encoding if an abstract value contains unknown extensions. However, the method for re-encoding unknown extensions does not prevent a receiving application with knowledge of the extension from producing the correct canonical encoding.
如果抽象值包含未知扩展,则应用程序无法生成规范编码。但是,对未知扩展重新编码的方法不会阻止知道该扩展的接收应用程序生成正确的规范编码。
To enable re-encoding of an unknown element item it is necessary to retain the [prefix], [local name], [attributes], [namespace attributes], and [children] properties of the element item.
要启用未知元素项的重新编码,必须保留元素项的[前缀]、[本地名称]、[属性]、[命名空间属性]和[子项]属性。
Definition (inherited namespace item): An inherited namespace item is a namespace item in the [in-scope namespaces] of an element item for which there is no corresponding namespace declaration attribute item in the [namespace attributes] of the element item.
定义(继承的命名空间项):继承的命名空间项是元素项的[in-scope namespaces]中的命名空间项,元素项的[namespace attributes]中没有对应的命名空间声明属性项。
The content and attributes of an unknown element item may contain qualified names whose interpretation depends on inherited namespace items. Semantically faithful re-encoding of the unknown item may require reproduction of at least some of the inherited namespace
未知元素项的内容和属性可能包含限定名,其解释取决于继承的命名空间项。在语义上忠实地重新编码未知项可能需要复制至少一些继承的命名空间
items. The problem is deciding which of the inherited namespace items are actually needed. Qualified names as the names of elements and attributes are easily recognized, but in the absence of type information it is not possible to discern whether anything that syntactically resembles a qualified name in the value of an attribute or the character data of an element actually is a qualified name.
项目。问题在于决定实际需要哪些继承的命名空间项。作为元素和属性名称的限定名很容易识别,但在缺乏类型信息的情况下,无法辨别在属性值或元素的字符数据中语法上类似于限定名的任何内容实际上是否为限定名。
The simplest approach is to retain all the inherited namespace items and output corresponding namespace declaration attribute items in the [namespace attributes] of the unknown element item when re-encoding the element item. At best, an application can omit the inherited namespace items that do not define the namespace prefix of any definite or potential qualified name, though this requires examining the content and attributes of the unknown extension.
最简单的方法是保留所有继承的命名空间项,并在重新编码元素项时在未知元素项的[namespace attributes]中输出相应的命名空间声明属性项。充其量,应用程序可以省略继承的名称空间项,这些项不定义任何确定或潜在限定名称的名称空间前缀,尽管这需要检查未知扩展的内容和属性。
Regardless of how clever an implementation tries to be, adding any namespace declaration attribute items to an unknown element item is harmful to canonicalization if the ASN.1 type for the element item turns out to be the Markup type. To counter this problem, a special attribute is used to identify the namespace declaration attribute items added to an unknown element item so that they can be removed later, if it proves necessary.
无论实现多么聪明,如果元素项的ASN.1类型是标记类型,那么将任何命名空间声明属性项添加到未知元素项都会对规范化有害。为了解决这个问题,使用一个特殊的属性来标识添加到未知元素项的名称空间声明属性项,以便以后在必要时删除它们。
If the outermost element item in an unknown extension does not have an attribute item with the [local name] "context" and [namespace name] "urn:ietf:params:xml:ns:asnx" in its [attributes], then namespace declaration attribute items corresponding to the inherited namespace items that define the namespace prefixes of all the definite and potential qualified names in the content and attributes of the element item MUST be added to the retained [namespace attributes]. Other inherited namespace items MAY be added to the retained [namespace attributes].
如果未知扩展中的最外层元素项在其[attributes]中没有具有[local name]“context”和[namespace name]“urn:ietf:params:xml:ns:asnx”的属性项,然后,必须将与继承的名称空间项相对应的名称空间声明属性项添加到保留的[名称空间属性],这些名称空间项定义元素项的内容和属性中所有确定和潜在限定名称的名称空间前缀。其他继承的命名空间项可以添加到保留的[命名空间属性]。
If there are one or more of these added namespace declaration attribute items, then an attribute item with the [local name] "context" and [namespace name] "urn:ietf:params:xml:ns:asnx" MUST be added to the retained [attributes].
如果有一个或多个添加的命名空间声明属性项,则必须将具有[本地名称]“上下文”和[命名空间名称]“urn:ietf:params:xml:ns:asnx”的属性项添加到保留的[属性]中。
The [prefix] of the context attribute item is any namespace prefix that does not match the [local name] of any namespace declaration attribute item in the [namespace attributes] unless the [namespace attributes] property contains a namespace declaration attribute item with a non-empty [prefix] and a [normalized value] of "urn:ietf:params:xml:ns:asnx". In that case, the [local name] of that namespace declaration attribute item MAY be used as the [prefix] of the context attribute item.
上下文属性项的[prefix]是与[namespace attributes]中任何名称空间声明属性项的[local name]不匹配的任何名称空间前缀,除非[namespace attributes]属性包含具有非空[prefix]和[normalized value]的名称空间声明属性项“urn:ietf:params:xml:ns:asnx”。在这种情况下,名称空间声明属性项的[本地名称]可以用作上下文属性项的[前缀]。
If the [prefix] of the context attribute item does not match the [local name] of any namespace declaration attribute item, then an attribute item with the [prefix] "xmlns", [namespace name] "urn:ietf:params:xml:ns:asnx", and [local name] equal to the [prefix] of the context attribute item MUST be added to the retained [namespace attributes] of the element item.
如果上下文属性项的[prefix]与任何命名空间声明属性项的[local name]不匹配,则必须将[prefix]“xmlns”、[namespace name]“urn:ietf:params:xml:ns:asnx”和[local name]等于上下文属性项的[prefix]的属性项添加到保留的[namespace attributes]元素项的属性。
The [normalized value] of the context attribute is the white-space-separated unordered list of the [local names] of the added namespace declaration attribute items (i.e., a list of the namespace prefixes), including any namespace declaration attribute item added to define the [prefix] of the context attribute. Note that the [local name] for a namespace declaration attribute item declaring the default namespace is "xmlns".
上下文属性的[normalized value]是添加的名称空间声明属性项的[local names]的空白分隔无序列表(即名称空间前缀列表),包括为定义上下文属性的[prefix]而添加的任何名称空间声明属性项。请注意,声明默认命名空间的命名空间声明属性项的[local name]是“xmlns”。
Aside: A receiver that knows about the extension will use the context attribute to strip out the added namespace declaration attributes if the type of the associated NamedType is the Markup type (Section 6.10), and will discard the context attribute otherwise. A receiver that does not know about the extension will re-encode the extension as is.
旁白:如果关联NamedType的类型是标记类型(第6.10节),则了解扩展的接收者将使用上下文属性删除添加的命名空间声明属性,否则将放弃上下文属性。不知道扩展的接收器将按原样重新编码扩展。
Adding the required namespace declaration attribute items to an element item effectively makes the element item self-contained. A received encoding has an encoding error if it contains an element item that is not self-contained but has a context attribute item in its [attributes].
将所需的命名空间声明属性项添加到元素项可以有效地使元素项自包含。如果接收到的编码包含非自包含的元素项,但其[attributes]中有上下文属性项,则该编码存在编码错误。
An RXER encoder MUST NOT add the context attribute item to an element item corresponding to a NamedType that is known to it.
RXER编码器不得将上下文属性项添加到与其已知的NamedType对应的元素项。
An RXER decoder MUST accept the context attribute item on an element item corresponding to a NamedType that does not appear to be an extension.
RXER解码器必须接受与似乎不是扩展名的NamedType对应的元素项上的上下文属性项。
Aside: It is not uncommon for extension markers to be neglected in specifications traditionally using only BER, since extension markers do not alter BER encodings. Consequently, it is not immediately obvious in later versions of the specification which instances of NamedType belong to extensions of the original base specification.
旁白:在传统上仅使用BER的规范中忽略扩展标记并不少见,因为扩展标记不会改变BER编码。因此,在规范的后续版本中,NamedType的哪些实例属于原始基本规范的扩展并不明显。
Example
实例
Suppose there are three applications, A, B, and C. Suppose that Application A uses the first edition of an ASN.1 specification containing the following type definition:
假设有三个应用程序A、B和C。假设应用程序A使用ASN.1规范的第一版,其中包含以下类型定义:
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ... }
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ... }
Suppose that Application B uses the second edition of the ASN.1 specification:
假设应用程序B使用ASN.1规范的第二版:
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ..., field2 QName -- added in second edition }
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ..., field2 QName -- added in second edition }
Suppose that Application C uses the third edition of the ASN.1 specification:
假设应用程序C使用ASN.1规范的第三版:
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ..., field2 QName, -- added in second edition field3 Markup -- added in third edition }
MyType ::= SEQUENCE { field1 INTEGER, -- present in first edition ..., field2 QName, -- added in second edition field3 Markup -- added in third edition }
Application C produces the following RXER encoding and sends it to Application B:
应用程序C生成以下RXER编码并将其发送给应用程序B:
<value xmlns:p2="http://example.com/ns2"> <field1> 100 </field1> <field2> p2:foobar </field2> <field3 xmlns:p1="http://example.com/ns1"> p1:foobar </field3> </value>
<value xmlns:p2="http://example.com/ns2"> <field1> 100 </field1> <field2> p2:foobar </field2> <field3 xmlns:p1="http://example.com/ns1"> p1:foobar </field3> </value>
Application B doesn't know about <field3>, so it adds the asnx:context attribute to <field3> when it re-encodes the abstract value to send to Application A:
应用程序B不知道<field3>,因此当它重新编码要发送给应用程序A的抽象值时,会将asnx:context属性添加到<field3>:
<value xmlns:p1="http://example.com/ns2"> <!-- Application B knows the white space in field1 and field2 is optional and discards it. --> <field1>100</field1> <field2>p1:foobar</field2> <!-- Application B doesn't know about field3 so it leaves the character data alone. --> <field3 asnx:context="asnx p2" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns1" xmlns:p2="http://example.com/ns2"> p1:foobar </field3> </value>
<value xmlns:p1="http://example.com/ns2"> <!-- Application B knows the white space in field1 and field2 is optional and discards it. --> <field1>100</field1> <field2>p1:foobar</field2> <!-- Application B doesn't know about field3 so it leaves the character data alone. --> <field3 asnx:context="asnx p2" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns1" xmlns:p2="http://example.com/ns2"> p1:foobar </field3> </value>
Application A doesn't know about <field2> and <field3>, so it adds the asnx:context attribute to <field2> and leaves <field3> alone when it re-encodes the abstract value:
应用程序A不知道<field2>和<field3>,因此它将asnx:context属性添加到<field2>中,并在重新编码抽象值时保留<field3>:
<value> <!-- Application A knows about field1 and chooses to add some white space. --> <field1> 100 </field1> <!-- Application A doesn't know about field2 or field3 so it leaves the character data alone. --> <field2 asnx:context="asnx p1" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns2">p1:foobar</field2> <field3 asnx:context="asnx p2" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns1" xmlns:p2="http://example.com/ns2"> p1:foobar </field3> </value>
<value> <!-- Application A knows about field1 and chooses to add some white space. --> <field1> 100 </field1> <!-- Application A doesn't know about field2 or field3 so it leaves the character data alone. --> <field2 asnx:context="asnx p1" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns2">p1:foobar</field2> <field3 asnx:context="asnx p2" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xmlns:p1="http://example.com/ns1" xmlns:p2="http://example.com/ns2"> p1:foobar </field3> </value>
If Application C receives this final encoding, it has sufficient information to discard the asnx:context, xmlns:asnx, and xmlns:p2 attributes from the received Markup value of <field3> to recover the original value. Application C knows about <field2>, so it uses the namespace declaration for p1 when decoding the QName value and ignores the other declarations.
如果应用程序C收到此最终编码,它有足够的信息从接收到的标记值<field3>中丢弃asnx:context、xmlns:asnx和xmlns:p2属性,以恢复原始值。应用程序C知道<field2>,因此在解码QName值时使用p1的名称空间声明,并忽略其他声明。
To enable re-encoding of an unknown attribute item it is necessary to retain at least the [local name], [namespace name], and [normalized value] properties of the attribute item.
要启用未知属性项的重新编码,必须至少保留属性项的[local name]、[namespace name]和[normalized value]属性。
The [normalized value] of an unknown attribute item may contain qualified names whose interpretation depends on the [in-scope namespaces] of the [owner element]. Semantically faithful
未知属性项的[normalized value]可能包含限定名,其解释取决于[owner元素]的[in-scope namespaces]。语义忠实
re-encoding of the unknown attribute item may require reproduction of at least some part of the [in-scope namespaces]. In the absence of type information, it is not possible to discern whether anything that syntactically resembles a qualified name in the [normalized value] of an unknown attribute item actually is a qualified name.
未知属性项的重新编码可能需要至少复制[范围内名称空间]的某些部分。在缺少类型信息的情况下,无法辨别在语法上与未知属性项的[normalized value]中的限定名相似的任何内容实际上是否为限定名。
The simplest approach is to retain all the namespace items of the [in-scope namespaces] and output corresponding namespace declaration attribute items in the [namespace attributes] of the [owner element] when re-encoding the extension. At best, an application can omit the namespace items that do not define the namespace prefix of any potential qualified name in the [normalized value].
最简单的方法是保留[in-scope namespaces]的所有命名空间项,并在重新编码扩展时在[owner element]的[namespace attributes]中输出相应的命名空间声明属性项。充其量,应用程序可以省略在[normalized value]中未定义任何潜在限定名称的名称空间前缀的名称空间项。
An application MUST retain the namespace items in the [in-scope namespaces] of the [owner element] that define the namespace prefixes of all the potential qualified names in the [normalized value] of the unknown attribute item. Other namespace items in the [in-scope namespaces] of the [owner element] MAY be retained.
应用程序必须在[owner element]的[in-scope namespaces]中保留命名空间项,这些命名空间项定义未知属性项的[normalized value]中所有潜在限定名的命名空间前缀。可以保留[owner元素]的[in-scope namespaces]中的其他命名空间项。
Aside: If the enclosing element item has more than one unknown attribute item, then it is sufficient to save the union of the retained namespace items with the element item, rather than saving the retained namespace items with each unknown attribute item.
旁白:如果封闭的元素项具有多个未知属性项,则保存保留的命名空间项与元素项的并集就足够了,而不是将保留的命名空间项与每个未知属性项一起保存。
When the unknown attribute item is re-encoded, the retained namespace items affect the [namespace attributes] and [in-scope namespaces] of the enclosing element item as specified in Section 6.2.2.1, and the [prefix] of the attribute item is determined as specified in Section 6.2.3.1.
当对未知属性项进行重新编码时,保留的名称空间项将影响第6.2.2.1节中规定的封闭元素项的[名称空间属性]和[范围内名称空间],并根据第6.2.3.1节的规定确定属性项的[前缀]。
Aside: The context attribute is not added to the [attributes] of the [owner element] when re-encoding an unknown attribute item because the type of a NamedType subject to an ATTRIBUTE or ATTRIBUTE-REF encoding instruction cannot be the Markup type.
旁白:当重新编码未知属性项时,上下文属性不会添加到[owner element]的[attributes],因为属性或attribute-REF编码指令的NamedType的类型不能是标记类型。
A value of an open type denoted by an ObjectClassFieldType [X.681] is translated according to the specific Type of the value.
由ObjectClassFieldType[X.681]表示的开放类型的值根据值的特定类型进行转换。
If the specific Type of the value is directly or indirectly the Markup type, then the enclosing element item MUST be self-contained.
如果值的特定类型直接或间接为标记类型,则封闭的元素项必须是自包含的。
For a non-canonical RXER encoding, if the translation of the value does not generate an attribute item with the [local name] "type" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance" (i.e., xsi:type) and the specific Type of the value is a
For a non-canonical RXER encoding, if the translation of the value does not generate an attribute item with the [local name] "type" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance" (i.e., xsi:type) and the specific Type of the value is a
namespace-qualified reference (Section 5), then an attribute item with the [local name] "type" and the [namespace name] "http://www.w3.org/2001/XMLSchema-instance" (i.e., xsi:type) MAY be added to the [attributes] of the enclosing element item. The [normalized value] of this attribute item is a qualified name for the expanded name of the referenced type, with the namespace prefix determined as specified in Section 6.7.11.1.
名称空间限定引用(第5节),然后是一个具有[local name]“type”和[namespace name]“type”的属性项http://www.w3.org/2001/XMLSchema-instance“(即xsi:type)可以添加到封闭元素项的[attributes]中。此属性项的[normalized value]是引用类型的扩展名称的限定名称,命名空间前缀按照第6.7.11.1节的规定确定。
Aside: The xsi:type attribute is added by RXER encoders for the benefit of XML Schema validators. This attribute tells an XML Schema validator which type definition in a compatible XML Schema translation of the ASN.1 specification it should use for validating the content and attributes of the enclosing element. For an RXER decoder, the actual type in an open type value is generally determined by an associated component relation constraint [X.682], so the xsi:type attribute can be ignored.
旁白:为了XML模式验证器的好处,RXER编码器添加了xsi:type属性。该属性告诉XML模式验证器在ASN.1规范的兼容XML模式转换中应该使用哪个类型定义来验证封闭元素的内容和属性。对于RXER解码器,开放类型值中的实际类型通常由关联的组件关系约束[X.682]确定,因此可以忽略xsi:type属性。
Example
实例
The content and attributes of the following <value> element are the RXER encoding of an open type value containing a BOOLEAN value:
以下<value>元素的内容和属性是包含布尔值的开放类型值的RXER编码:
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xsi:type="asnx:BOOLEAN"> true </value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asnx="urn:ietf:params:xml:ns:asnx" xsi:type="asnx:BOOLEAN"> true </value>
If the ObjectClassFieldType denoting an open type is not constrained by a TableConstraint, or is constrained by a TableConstraint where the constraining object set is extensible, then an application MUST accept and be prepared to re-encode (using the same encoding rules) any value of the open type where the specific Type of the value is unknown. In such cases, the enclosing element item is treated like an unknown element item in the value of an extensible combining ASN.1 type (see Section 6.8.8.1).
如果表示开放类型的ObjectClassFieldType不受TableConstraint约束,或者受约束对象集可扩展的TableConstraint约束,则应用程序必须接受并准备重新编码(使用相同的编码规则)开放类型的任何值,其中值的特定类型未知。在这种情况下,在可扩展组合ASN.1类型的值中,封闭元素项被视为未知元素项(参见第6.8.8.1节)。
Conceptually, a value of the Markup type holds the [prefix], [attributes], [namespace attributes], and [children] of an element item. The Infoset translation of a value of the Markup type initially simply sets the [prefix], [attributes], [namespace attributes], and [children] of the enclosing element item to the corresponding properties represented by the Markup value.
从概念上讲,标记类型的值包含元素项的[prefix]、[attributes]、[namespace attributes]和[children]。标记类型的值的信息集转换最初只是将封闭元素项的[prefix]、[attributes]、[namespace attributes]和[children]设置为标记值表示的相应属性。
Recall that the enclosing element item for the translation of a Markup value is required to be self-contained (Section 4.1.1).
回想一下,用于转换标记值的封闭元素项要求是自包含的(第4.1.1节)。
If the enclosing element item is not the [document element] of the document item, and the [in-scope namespaces] property of the enclosing element item's [parent] contains a namespace item for the default namespace, and the [namespace attributes] property represented by the Markup value does not contain a namespace item declaring or undeclaring the default namespace, then a namespace declaration attribute item that undeclares the default namespace SHALL be added to the enclosing element item's [namespace attributes].
如果封闭元素项不是文档项的[document element],并且封闭元素项的[parent]的[in-scope namespaces]属性包含默认名称空间的名称空间项和[namespace attributes]由标记值表示的属性不包含声明或取消声明默认命名空间的命名空间项,则应将取消声明默认命名空间的命名空间声明属性项添加到封闭元素项的[命名空间属性]。
It is not necessary to populate the [in-scope namespaces] of the enclosing element item for encoding purposes (though it may be warranted for other purposes).
出于编码目的,无需填充封闭元素项的[范围内名称空间](尽管出于其他目的可能需要填充)。
An element item nested in the [children] is potentially the Infoset translation of a value of a top-level NamedType (as allowed by Section 6.4), and the entire Markup value can represent the content and attributes of an element item that is the translation of a value of a top-level NamedType.
嵌套在[children]中的元素项可能是顶级NamedType值的信息集翻译(如第6.4节所允许),并且整个标记值可以表示作为顶级NamedType值翻译的元素项的内容和属性。
Aside: The latter case arises when an ELEMENT-REF encoding instruction references a top-level NamedType.
旁白:后一种情况发生在ELEMENT-REF编码指令引用顶级NamedType时。
The content and attributes of an element item nested in the [children] of a Markup value are potentially the Infoset translation of an abstract value of an ASN.1 type (as allowed by Section 6.4), and the entire Markup value can represent the translation of a single abstract value.
嵌套在标记值的[children]中的元素项的内容和属性可能是ASN.1类型的抽象值的信息集翻译(如第6.4节所允许),并且整个标记值可以表示单个抽象值的翻译。
Aside: The latter case arises when a TYPE-REF encoding instruction references an ASN.1 type.
旁白:当TYPE-REF编码指令引用ASN.1类型时,会出现后一种情况。
For a non-canonical RXER encoding, any element item, at any level of nesting (including the enclosing element item itself), that corresponds to the value of a top-level NamedType MAY be replaced with any valid translation of that value.
对于非规范RXER编码,任何嵌套级别(包括封闭元素项本身)上与顶级NamedType值对应的任何元素项都可以替换为该值的任何有效翻译。
For a non-canonical RXER encoding, any element item, at any level of nesting (including the enclosing element item itself), with content and attributes that correspond to an abstract value of an ASN.1 type MAY have that content and those attributes replaced with any valid translation of that abstract value. If the content and attributes are replaced, then the [prefix], [in-scope namespaces], and [namespace attributes] of the element item are constructed as specified in Sections 6.2.2.1 and 6.2.2.2. The enclosing element item for the Markup value is still required to be self-contained.
对于非规范RXER编码,具有与ASN.1类型的抽象值相对应的内容和属性的任何嵌套级别的任何元素项(包括封闭的元素项本身)都可以使用该抽象值的任何有效翻译替换该内容和这些属性。如果内容和属性被替换,则元素项的[前缀]、[范围内名称空间]和[名称空间属性]将按照第6.2.2.1节和第6.2.2.2节的规定构造。标记值的封闭元素项仍然需要是自包含的。
Aside: Insofar as a Markup value represents ASN.1 abstract values, it is sufficient for the RXER encoding of the Markup value to preserve the abstract values rather than preserve the exact Infoset representation.
旁白:只要标记值表示ASN.1抽象值,标记值的RXER编码就足以保留抽象值,而不是保留确切的信息集表示。
For a CRXER encoding, any element item, at any level of nesting (including the enclosing element item itself), that corresponds to a value of a top-level NamedType MUST be replaced with the CRXER translation of that value.
对于CRXER编码,任何嵌套级别(包括封闭元素项本身)上与顶级NamedType值对应的任何元素项都必须替换为该值的CRXER翻译。
For a CRXER encoding, any element item, at any level of nesting (including the enclosing element item itself), with content and attributes that correspond to an abstract value of an ASN.1 type MUST have that content and those attributes replaced with the CRXER translation of that abstract value. The [prefix], [in-scope namespaces], and [namespace attributes] of the element item are constructed as specified in Sections 6.2.2.1 and 6.2.2.2.
对于CRXER编码,具有与ASN.1类型的抽象值相对应的内容和属性的任何嵌套级别(包括封闭的元素项本身)的任何元素项都必须使用该抽象值的CRXER翻译替换该内容和属性。元素项的[前缀]、[范围内名称空间]和[名称空间属性]按照第6.2.2.1节和第6.2.2.2节的规定构造。
If the [attributes] property of the enclosing element item from a received RXER encoding contains an attribute item with the [local name] "context" and [namespace name] "urn:ietf:params:xml:ns:asnx" (i.e., asnx:context), then this attribute item MUST be omitted from the [attributes] represented by the Markup value, and each namespace declaration attribute item with a [local name] matching an NCName in the [normalized value] of the attribute item MUST be omitted from the [namespace attributes] represented by the Markup value.
如果接收到的RXER编码的封闭元素项的[attributes]属性包含具有[local name]“context”和[namespace name]“urn:ietf:params:xml:ns:asnx”(即asnx:context)的属性项,则必须从标记值表示的[attributes]中省略该属性项,并且在标记值表示的[namespace attributes]中,必须省略每个名称空间声明属性项,其中[local name]与属性项的[normalized value]中的NCName匹配。
The final step in translating the value of a top-level NamedType for a CRXER encoding, or an abstract value for a Standalone CRXER Encoding, is the replacement of the arbitrarily chosen namespace prefixes with algorithmically determined canonical namespace prefixes. This procedure for prefix replacement applies to each element item where the [namespace attributes] have been constructed according to Section 6.2.2.1. This includes any element item corresponding to a value of a top-level NamedType, or with content and attributes that correspond to an abstract value of an ASN.1 type, that is nested in a value of the Markup type.
转换CRXER编码的顶级NamedType值或独立CRXER编码的抽象值的最后一步是用算法确定的规范命名空间前缀替换任意选择的命名空间前缀。前缀替换程序适用于根据第6.2.2.1节构造[名称空间属性]的每个元素项。这包括与顶级NamedType的值对应的任何元素项,或与嵌套在标记类型的值中的ASN.1类型的抽象值对应的内容和属性。
For each element item where prefix replacement applies, the following sequence of steps is repeated until there are no more eligible attribute items to select in step (1):
对于应用前缀替换的每个元素项,重复以下步骤序列,直到在步骤(1)中没有更多符合条件的属性项可供选择:
(1) Select the attribute item with the least [normalized value] from amongst the attribute items of the [namespace attributes] that have a [local name] that is not a canonical namespace prefix (i.e., select from the namespace declaration attribute items that have not already been processed). A [normalized value] is less than another [normalized value] if the former appears before the latter in an ordering of the values determined by comparing the ISO 10646 code points [UCS] of their characters, from first to last. A shorter string of characters is ordered before a longer string of characters that is identical up to the length of the shorter string.
(1) 从[namespace attributes]的属性项中选择[normalized value]最少的属性项,这些属性项的[local name]不是规范名称空间前缀(即,从尚未处理的名称空间声明属性项中选择)。如果前一个[标准化值]出现在后一个[标准化值]之前,则[标准化值]小于另一个[标准化值],其顺序是通过比较字符的ISO 10646码点[UCS]自上而下确定的。一个较短的字符串在一个与较短字符串长度相同的较长字符串之前排序。
Aside: Note that when a namespace declaration (other than for the default namespace) is represented as an attribute item in the [namespace attributes], the attribute's [prefix] is "xmlns", its [local name] is the namespace prefix, and its [normalized value] is the namespace name.
旁白:请注意,当命名空间声明(默认命名空间除外)在[namespace attributes]中表示为属性项时,该属性的[prefix]是“xmlns”,其[local name]是命名空间前缀,其[normalized value]是命名空间名称。
(2) A canonical namespace prefix is unused if it is not currently the [prefix] of any namespace item in the [in-scope namespaces] of the element item. Replace the [local name] of the selected attribute item with the unused canonical namespace prefix that has the non-negative number string with the least integer value (e.g., n2 is less than n10).
(2) 如果规范命名空间前缀当前不是元素项的[in-scope namespaces]中任何命名空间项的[prefix],则该前缀未使用。将所选属性项的[local name]替换为未使用的规范名称空间前缀,该前缀具有具有最小整数值的非负数字符串(例如,n2小于n10)。
(3) The selected attribute item has a corresponding namespace item in the [in-scope namespaces] of the element. Replace the [prefix] of this corresponding namespace item with the canonical namespace prefix determined in step (2).
(3) 所选属性项在元素的[范围内命名空间]中具有相应的命名空间项。用步骤(2)中确定的规范名称空间前缀替换此对应名称空间项的[prefix]。
(4) The element item and its [attributes] property, and descendent element items and their [attributes] properties, may depend on the selected attribute item to determine the binding between their [prefix] and [namespace name]. Replace the [prefix] of any such dependent element items and attribute items with the canonical namespace prefix determined in step (2).
(4) 元素项及其[attributes]属性以及子元素项及其[attributes]属性可能取决于所选属性项,以确定其[prefix]和[namespace name]之间的绑定。用步骤(2)中确定的规范名称空间前缀替换任何此类依赖元素项和属性项的[prefix]。
Note that a namespace prefix can be redeclared (reused). Replacement of the prefix does not apply to an element item wherein the prefix is redeclared, or to the descendants of such an element item.
请注意,可以重新声明(重用)名称空间前缀。前缀的替换不适用于重新声明前缀的元素项,也不适用于此类元素项的后代。
(5) The character data translations for values of the QName ASN.1 type may depend on the selected attribute item to determine the binding between their namespace prefix and namespace name. Replace the namespace prefix of any such dependent character data translation with the canonical namespace prefix determined in step (2).
(5) QName ASN.1类型的值的字符数据转换可能取决于选定的属性项,以确定其命名空间前缀和命名空间名称之间的绑定。用步骤(2)中确定的规范名称空间前缀替换任何此类从属字符数据转换的名称空间前缀。
Note that a character data translation can appear in the [normalized value] of an attribute item, or as a sequence of character items in the [children] of an element item.
请注意,字符数据转换可以出现在属性项的[normalized value]中,也可以作为字符项序列出现在元素项的[children]中。
The final RXER encoding is produced by serializing the Infoset translation as an XML document. An implementation MUST serialize the Infoset translation as an XML document in such a way that the Infoset of the resulting XML document matches the Infoset translation, after ignoring the following properties:
最终的RXER编码是通过将信息集翻译序列化为XML文档来生成的。在忽略以下属性后,实现必须将信息集翻译序列化为XML文档,以使生成的XML文档的信息集与信息集翻译匹配:
(1) all properties of the document item except the [document element],
(1) 除[文档元素]之外的文档项的所有属性,
(2) the [base URI] of any item,
(2) 任何项的[base URI],
(3) the [element content whitespace] of character items,
(3) 字符项的[元素内容空白],
(4) the [notation] of processing instruction items,
(4) 处理指令项的[符号],
(5) the [in-scope namespaces] of element items.
(5) 元素项的[范围内命名空间]。
Aside: The [in-scope namespaces] of a parent element item are only selectively inherited by its child element items in the Infoset translations of ASN.1 values. This means that the Infoset reconstructed by parsing the XML document serialization of the original Infoset will generally have more namespace items in its [in-scope namespaces], but these extra namespace items will not be significant.
旁白:父元素项的[范围内名称空间]仅由其子元素项在ASN.1值的信息集翻译中选择性地继承。这意味着,通过解析原始信息集的XML文档序列化而重构的信息集在其[范围内名称空间]中通常会有更多的名称空间项,但这些额外的名称空间项并不重要。
Aside: A consequence of case (1) is that comments and PIs before and after the document element are permitted.
旁白:案例(1)的结果是允许在文档元素前后使用注释和PI。
In general, there is more than one possible serialization for any given Infoset translation. Section 6.12.1 highlights some important considerations in producing a correct serialization and discusses some of the serialization options.
通常,对于任何给定的信息集翻译,都有不止一种可能的序列化。第6.12.1节强调了生成正确序列化时的一些重要注意事项,并讨论了一些序列化选项。
Section 6.12.2 applies to CRXER encodings and limits the serialization options so that each distinct Infoset has only one possible serialization.
第6.12.2节适用于CRXER编码,并限制序列化选项,以便每个不同的信息集只有一个可能的序列化。
This section discusses aspects of Infoset serialization for non-canonical RXER encodings, but is not an exhaustive list of the options for non-canonical serialization.
本节讨论非规范RXER编码的信息集序列化方面,但不是非规范序列化选项的详尽列表。
If one or more character items have a [character code] in the range U+0001 to U+0008, U+000B to U+000C, or U+000E to U+001F, or one or more characters in any attribute's [normalized value] are in the range U+0001 to U+0008, U+000B to U+000C, or U+000E to U+001F, then the Infoset translation MUST be serialized as an XML version 1.1 document; otherwise, the Infoset translation is serialized as either an XML version 1.0 or version 1.1 document.
如果一个或多个字符项的[character code]范围在U+0001到U+0008、U+000B到U+000C或U+000E到U+001F之间,或者任何属性的[normalized value]中的一个或多个字符范围在U+0001到U+0008、U+000B到U+000C或U+000E到U+001F之间,则必须将信息集翻译序列化为XML版本1.1文档;否则,信息集翻译将序列化为XML 1.0版或1.1版文档。
A non-canonical RXER encoding may use any of the allowed character encoding schemes for XML. RXER encoders and decoders MUST support the UTF-8 character encoding.
非规范RXER编码可以使用任何允许的XML字符编码方案。RXER编码器和解码器必须支持UTF-8字符编码。
An element item may be serialized as an empty-element tag if it has no items in its [children].
如果元素项的[子项]中没有项,则可以将其序列化为空元素标记。
Attributes of an element can appear in any order since the [attributes] and [namespace attributes] of an element item are unordered.
元素的属性可以以任何顺序出现,因为元素项的[Attributes]和[namespace Attributes]是无序的。
Ampersand ('&', U+0026) and open angle bracket ('<', U+003C) characters in the [normalized value] of an attribute item must be escaped appropriately [XML10][XML11] (with a character reference or a predefined entity reference). Double quote (U+0022) and single quote (U+0027) characters in an attribute item's [normalized value] may also need to be escaped. Character items with the [character code] U+0026 (ampersand, '&') or U+003C (open angle bracket, '<') must be escaped appropriately (with a character reference, a predefined entity reference or a CDATA section).
属性项的[normalized value]中的符号('&',U+0026)和开角括号('<',U+003C)字符必须正确转义[XML10][XML11](使用字符引用或预定义的实体引用)。属性项的[normalized value]中的双引号(U+0022)和单引号(U+0027)字符也可能需要转义。必须对带有[Character code]U+0026(与“&”)或U+003C(开角括号“<”)的字符项进行适当转义(使用字符引用、预定义实体引用或CDATA节)。
Line break normalization by XML processors allows some freedom in how a character item for a line feed character (U+000A) is serialized:
XML处理器的换行符规范化允许在换行字符(U+000A)的字符项序列化方式方面有一定的自由度:
(1) If XML version 1.0 is selected, then a character item with the [character code] U+000A (line feed) is serialized as either a line feed character (U+000A), a carriage return character (U+000D) followed by a line feed character (U+000A), or just a carriage return character (U+000D) provided the next item is not a character item that is serialized as a line feed character (U+000A).
(1) 如果选择XML版本1.0,则带有[character code]U+000A(换行符)的字符项将序列化为换行符(U+000A)、回车符(U+000D)后跟换行符(U+000A)或仅回车符(U+000D)假设下一项不是序列化为换行符(U+000A)的字符项。
(2) If XML version 1.1 is selected, then a character item with the [character code] U+000A (line feed) is serialized as either a line feed character (U+000A), a next line character (U+0085), a line separator character (U+2028), a carriage return character (U+000D) followed by a line feed character (U+000A), a carriage return character (U+000D) followed by a next line character
(2) 如果选择XML版本1.1,则带有[字符代码]U+000A(换行符)的字符项将序列化为换行符(U+000A)、下一行字符(U+0085)、行分隔符(U+2028)、回车符(U+000D)、换行符(U+000A)、回车符(U+000D)后跟下一行字符
(U+0085), or just a carriage return character (U+000D) provided the next item is not a character item that is serialized as a line feed (U+000A) or next line (U+0085) character.
(U+0085),或仅为回车符(U+000D),前提是下一项不是序列化为换行符(U+000A)或下一行(U+0085)字符的字符项。
Aside: All these sequences will be normalized to a line feed character (U+000A) during decoding.
旁白:在解码期间,所有这些序列都将标准化为换行字符(U+000A)。
A character item with the [character code] U+000D (carriage return), U+0085 (next line), or U+2028 (line separator) must be serialized as a character reference to protect the character from line break normalization during decoding.
具有[character code]U+000D(回车符)、U+0085(下一行)或U+2028(行分隔符)的字符项必须序列化为字符引用,以保护该字符在解码期间不受换行规范化的影响。
The attribute value normalization performed by XML processors allows some freedom in how a space character (U+0020) is serialized:
XML处理器执行的属性值规范化允许在如何序列化空格字符(U+0020)方面有一定的自由度:
(1) If XML version 1.0 is selected, then a space character (U+0020) in an attribute item's [normalized value] is serialized as either a space character (U+0020), a tab character (U+0009), a carriage return character (U+000D), a line feed character (U+000A), a carriage return character (U+000D) followed by a line feed character (U+000A), or just a carriage return character (U+000D) provided the next character in the [normalized value] is not serialized as a line feed character (U+000A).
(1) 如果选择XML版本1.0,则属性项[标准化值]中的空格字符(U+0020)将序列化为空格字符(U+0020)、制表符(U+0009)、回车符(U+000D)、换行符(U+000A)、回车符(U+000D)和换行符(U+000A),或者只要[normalized value]中的下一个字符未序列化为换行字符(U+000A),就可以使用回车符(U+000D)。
(2) If XML version 1.1 is selected, then a space character (U+0020) in an attribute item's [normalized value] is serialized as either a space character (U+0020), a tab character (U+0009), a carriage return character (U+000D), a line feed character (U+000A), a next line character (U+0085), a line separator character (U+2028), a carriage return character (U+000D) followed by a line feed character (U+000A), a carriage return character (U+000D) followed by a next line character (U+0085), or just a carriage return character (U+000D) provided the next character in the [normalized value] is not serialized as a line feed (U+000A) or next line (U+0085) character.
(2) 如果选择了XML版本1.1,则属性项[标准化值]中的空格字符(U+0020)将序列化为空格字符(U+0020)、制表符(U+0009)、回车符(U+000D)、换行符(U+000A)、下一行字符(U+0085)、行分隔符(U+2028),如果[normalized value]中的下一个字符未序列化为换行符(U+000A)或下一行字符(U+0085),则回车符(U+000D)后跟换行符(U+000A)、回车符(U+000D)后跟下一行字符(U+0085)或仅回车符(U+000D)。
Aside: All these sequences will be normalized to a space character (U+0020) during decoding, through a combination of line break normalization and attribute value normalization.
旁白:在解码期间,所有这些序列都将通过断行规范化和属性值规范化的组合,规范化为一个空格字符(U+0020)。
Each tab (U+0009), line feed (U+000A), or carriage return (U+000D) character in an attribute item's [normalized value] must be serialized as a character reference to protect the character from attribute value normalization during decoding. In addition, if XML version 1.1 is selected, then each next line (U+0085) or line separator (U+2028) character must be serialized as a character reference.
属性项的[normalized value]中的每个制表符(U+0009)、换行符(U+000A)或回车符(U+000D)字符必须序列化为字符引用,以保护字符在解码期间不受属性值规范化的影响。此外,如果选择了XML版本1.1,则必须将下一行(U+0085)或行分隔符(U+2028)字符序列化为字符引用。
Parsed entity references may be used (unless the environment in which the RXER encoding is used disallows entity references). If entity references to other than the predefined entities are used, then the XML document containing the RXER encoding must necessarily contain a document type declaration, and the internal or external subset of the document type definition must contain entity declarations for those entities.
可以使用解析的实体引用(除非使用RXER编码的环境不允许实体引用)。如果使用预定义实体以外的实体引用,则包含RXER编码的XML文档必须包含文档类型声明,并且文档类型定义的内部或外部子集必须包含这些实体的实体声明。
This section discusses Infoset serialization for CRXER encodings. The serialization of an Infoset for a CRXER encoding is restricted so that each distinct Infoset has only one possible serialization as an XML document.
本节讨论CRXER编码的信息集序列化。CRXER编码的信息集序列化受到限制,因此每个不同的信息集只有一个可能的XML文档序列化。
Aside: These restrictions have been chosen so as to be consistent with Canonical XML [CXML], where possible.
旁白:选择这些限制是为了尽可能与规范XML[CXML]保持一致。
The document SHALL be encoded in UTF-8 without a leading Byte Order Mark [UCS].
文件应采用UTF-8编码,无前导字节顺序标记[UCS]。
The XMLDecl of the document SHALL be <?xml version="1.1"?>.
文件的XMLDecl应为<?xml version=“1.1”>。
A document type declaration (doctypedecl) SHALL NOT be used.
不得使用文件类型声明(doctypedecl)。
Aside: This has the effect of excluding entity references, except those for the predefined entities (e.g., &).
旁白:这具有排除实体引用的效果,预定义实体的引用除外(例如,&;)。
A single line feed character (U+000A) MUST be inserted immediately before the document element.
必须在文档元素的正前方插入单行换行符(U+000A)。
No other white space characters are permitted before or after the document element.
文档元素前后不允许有其他空白字符。
There SHALL NOT be any PIs or comments before or after the document element.
文件元素前后不得有任何PIs或评论。
An element item MUST NOT be serialized as an empty-element tag.
元素项不能序列化为空元素标记。
Aside: If an element item has no items in its [children], then it is serialized as a start-tag followed by an end-tag.
旁白:如果元素项在其[子项]中没有任何项,则将其序列化为开始标记,后跟结束标记。
There SHALL NOT be any white space characters immediately before the closing '>' of an element's start-tag and end-tag. The white space preceding each attribute SHALL be exactly one space character (U+0020). There SHALL NOT be any white space characters immediately before or after the equals sign (U+003D) in an attribute.
在元素的开始标记和结束标记的结束“>”之前不应有任何空格字符。每个属性前面的空白应正好是一个空格字符(U+0020)。属性中等号(U+003D)前后不应有任何空格字符。
The delimiter for attribute values SHALL be the double quote character (U+0022).
属性值的分隔符应为双引号字符(U+0022)。
Namespace declaration attributes MUST appear before any other attributes of an element. A namespace declaration for the default namespace, if present, MUST appear as the first attribute. The remaining namespace declaration attributes MUST appear in lexicographic order based on [local name].
命名空间声明属性必须出现在元素的任何其他属性之前。默认命名空间的命名空间声明(如果存在)必须作为第一个属性出现。其余的命名空间声明属性必须根据[本地名称]按字典顺序出现。
Aside: In particular, this means that xmlns:n10 comes before xmlns:n2.
旁白:特别是,这意味着xmlns:n10位于xmlns:n2之前。
The attributes that are not namespace declarations MUST be lexicographically ordered on [namespace name] as the primary key and [local name] as the secondary key.
非命名空间声明的属性必须在[namespace name]作为主键和[local name]作为辅助键上按字典顺序排列。
CDATA sections SHALL NOT be used.
不得使用CDATA节。
Each ampersand character ('&', U+0026) in an attribute item's [normalized value] MUST be serialized as the entity reference &. Each open angle bracket character ('<', U+003C) in an attribute item's [normalized value] MUST be serialized as the entity reference <. Each double quote character (U+0022) in an attribute item's [normalized value] MUST be serialized as the entity reference ". Each character in the range U+0001 to U+001F or U+007F to U+009F in an attribute item's [normalized value] MUST be serialized as a character reference. No other character in a [normalized value] is permitted to be serialized as an entity reference or character reference.
属性项的[normalized value]中的每个符号和字符('&',U+0026)必须序列化为实体引用&;。属性项的[normalized value]中的每个开角括号字符(“<”,U+003C)必须序列化为实体引用<;。属性项的[normalized value]中的每个双引号字符(U+0022)必须序列化为实体引用;。属性项的[normalized value]中U+0001到U+001F或U+007F到U+009F范围内的每个字符必须序列化为字符引用。不允许将[normalized value]中的任何其他字符序列化为实体引用或字符引用。
Each character item with the [character code] U+0026 (the ampersand character) MUST be serialized as the entity reference &. Each character item with the [character code] U+003C (the open angle bracket character) MUST be serialized as the entity reference <. Each character item with the [character code] U+003E (the closing angle bracket character) MUST be serialized as the entity reference >. Each character item with a [character code] in the range U+0001 to U+0008, U+000B to U+001F, or U+007F to U+009F MUST be serialized as a character reference. No other character item is permitted to be serialized as an entity reference or character reference.
具有[character code]U+0026(符号和字符)的每个字符项必须序列化为实体引用&;。具有[character code]U+003C(开角括号字符)的每个字符项必须序列化为实体引用<;。带有[character code]U+003E(收尾角括号字符)的每个字符项必须序列化为实体引用>;。在U+0001至U+0008、U+000B至U+001F或U+007F至U+009F范围内具有[字符代码]的每个字符项必须序列化为字符引用。不允许将任何其他字符项序列化为实体引用或字符引用。
Character references, where they are permitted, SHALL use uppercase hexadecimal with no leading zeroes. For example, the carriage return character is represented as 
.
在允许的情况下,字符引用应使用不带前导零的大写十六进制。例如,回车符表示为
;。
A space character (U+0020) in an attribute item's [normalized value] MUST be serialized as a single U+0020 character.
属性项的[normalized value]中的空格字符(U+0020)必须序列化为单个U+0020字符。
A character item with the [character code] U+000A MUST be serialized as a single U+000A character.
具有[字符代码]U+000A的字符项必须序列化为单个U+000A字符。
The white space separating the [target] and [content] in the serialization of a processing instruction item SHALL be exactly one space character (U+0020).
在处理指令项的序列化中,分隔[目标]和[内容]的空格应正好是一个空格字符(U+0020)。
Aside: A processing instruction or comment can only appear in a CRXER encoding if it is embedded in a Markup value.
旁白:只有在CRXER编码中嵌入标记值时,处理指令或注释才能出现。
XML Version 1.1 recommends, but does not absolutely require, that text be normalized according to Unicode Normalization Form C [UNICODE]. ASN.1 has no similar requirement on abstract values of string types, and ASN.1 canonical encoding rules depend on the code points of characters being preserved.
XMLVersion1.1建议(但并非绝对要求)根据Unicode规范化表单C[Unicode]对文本进行规范化。ASN.1对字符串类型的抽象值没有类似的要求,ASN.1规范编码规则依赖于被保留字符的代码点。
To accommodate both requirements, applications SHOULD normalize abstract values of ASN.1 character string types according to Unicode Normalization Form C at the time the values are created, but MUST NOT normalize a previously decoded abstract value of an ASN.1 character string type prior to re-encoding it. An application may, of course, normalize a decoded abstract value for other purposes, such as display to a user.
为了满足这两个要求,应用程序应在创建值时根据Unicode规范化表单C规范化ASN.1字符串类型的抽象值,但在重新编码之前,不得规范化先前解码的ASN.1字符串类型的抽象值。当然,应用程序可以出于其他目的(例如向用户显示)规范化解码的抽象值。
ASN.1 encoding rules are designed to preserve abstract values, but not to preserve every detail of each transfer syntax that is used. In the case of RXER, this means that the Infoset representation of an abstract value is not necessarily preserved when the abstract value is decoded and re-encoded (regardless of the encoding rules used). However, syntax-based canonicalization for XML documents (e.g., Canonical XML [CXML]) depends on the Infoset of an XML document being preserved. The Infoset representation of an XML document containing the RXER encoding of an ASN.1 abstract value potentially changes if that value is decoded and re-encoded, disrupting the Canonical XML representation. Extra normalization is required if RXER is to be usefully deployed in environments where syntax-based canonicalization is used.
ASN.1编码规则旨在保留抽象值,但不是保留所使用的每个传输语法的每个细节。在RXER的情况下,这意味着当对抽象值进行解码和重新编码时(无论使用何种编码规则),不一定保留抽象值的信息集表示。但是,基于语法的XML文档规范化(例如,规范XML[CXML])取决于所保留的XML文档的信息集。如果对包含ASN.1抽象值RXER编码的XML文档的信息集表示进行解码和重新编码,则该值可能会发生更改,从而破坏规范的XML表示。如果要在使用基于语法的规范化的环境中有效地部署RXER,则需要额外的规范化。
Prior to applying syntax-based canonicalization to an XML document, any element items in the Infoset representation of the document that correspond to the value of an ASN.1 top-level NamedType or have content and attributes that correspond to an ASN.1 abstract value MUST be replaced by the translation of the value according to CRXER.
在对XML文档应用基于语法的规范化之前,文档的信息集表示中与ASN.1顶级NamedType的值相对应或具有与ASN.1抽象值相对应的内容和属性的任何元素项都必须根据CRXER用值的转换来替换。
If an application uses Canonical XML but has no knowledge of RXER, then it will not know to normalize RXER encodings. If RXER is deployed into an environment containing such applications, then the Infoset translation for CRXER SHOULD be used for all RXER encodings.
如果应用程序使用规范XML,但不知道RXER,那么它将不知道如何规范RXER编码。如果将RXER部署到包含此类应用程序的环境中,则所有RXER编码都应使用CRXER的信息集转换。
The following OBJECT IDENTIFIER has been assigned by xmled.org to identify the Robust XML Encoding Rules, under an arc assigned to xmled.org by the Internet Assigned Numbers Authority (IANA):
以下对象标识符已由xmled.org分配,以识别可靠的XML编码规则,在互联网分配号码管理局(IANA)分配给xmled.org的arc下:
{ iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) encoding(1) rxer(0) }
{ iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) encoding(1) rxer(0) }
This OBJECT IDENTIFIER would be used, for example, to describe the transfer syntax for an RXER encoded data-value in an EMBEDDED PDV value.
例如,该对象标识符将用于描述嵌入PDV值中RXER编码数据值的传输语法。
The following OBJECT IDENTIFIER has been assigned by xmled.org to identify the Canonical Robust XML Encoding Rules, under an arc assigned to xmled.org by the IANA:
在IANA分配给xmled.org的arc下,xmled.org分配了以下对象标识符以识别规范的健壮XML编码规则:
{ iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) encoding(1) crxer(1) }
{ iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) encoding(1) crxer(1) }
This OBJECT IDENTIFIER would be used, for example, to describe the transfer syntax for a CRXER encoded data-value in an EMBEDDED PDV value.
例如,该对象标识符将用于描述嵌入式PDV值中CRXER编码数据值的传输语法。
The Robust XML Encoding Rules (RXER) and the XML Encoding Rules (XER) [X.693] are separate, distinctly different and incompatible ASN.1 encoding rules for producing XML markup from ASN.1 abstract values. RXER is therefore unrelated to the XML value notation of X.680 [X.680].
健壮的XML编码规则(RXER)和XML编码规则(XER)[X.693]是独立的、截然不同的、不兼容的ASN.1编码规则,用于从ASN.1抽象值生成XML标记。因此,RXER与X.680[X.680]的XML值表示法无关。
This section describes some of the major differences between RXER and XER.
本节介绍RXER和XER之间的一些主要区别。
There are essentially two varieties of XER: BASIC-XER (with a canonical form called CANONICAL-XER) and EXTENDED-XER. The significant difference between the two varieties is that XER encoding instructions are used by EXTENDED-XER, but are ignored by BASIC-XER (and therefore by CANONICAL-XER). There isn't a canonical variant of EXTENDED-XER. Characteristics that are common to BASIC-XER and EXTENDED-XER will simply be noted as being characteristics of XER.
XER基本上有两种类型:BASIC-XER(具有称为canonical-XER的规范形式)和EXTENDED-XER。这两种类型之间的显著区别在于,EXTENDED-XER使用XER编码指令,而BASIC-XER(以及CANONICAL-XER)忽略了XER编码指令。EXTENDED-XER没有一个规范变体。BASIC-XER和EXTENDED-XER共有的特性将被简单地称为XER的特性。
Elements and attributes are the fundamental discrete structures of an XML document. Not surprisingly, schema languages for XML typically have the means to describe, name, and reference global (i.e., top-level) elements and attributes. Global type definitions are seen more as a convenience for defining the contents of elements and attributes. Traditional ASN.1 has the means to define global types (and other global constructs that support the definition of types) but nothing akin to a global element or attribute definition. The fundamental difference between RXER and XER is in how this omission is addressed.
元素和属性是XML文档的基本离散结构。毫不奇怪,XML模式语言通常具有描述、命名和引用全局(即顶级)元素和属性的方法。全局类型定义更多地被视为定义元素和属性内容的便利。传统的ASN.1可以定义全局类型(以及支持类型定义的其他全局构造),但与全局元素或属性定义没有任何相似之处。RXER和XER的根本区别在于如何解决这一遗漏。
With XER, type definitions are also regarded as being element definitions by default, or as attribute definitions in the presence of an XER ATTRIBUTE encoding instruction. In some circumstances an anonymous Type is required to define an element, which leads to element names like <BOOLEAN> and <SEQUENCE>. NamedType notation also defines local elements, and there are some curious cases in EXTENDED-XER where NamedType notation can define a global type. So under XER, types can be defined by either Type or NamedType notation, and elements and attributes can also be defined by either Type or NamedType notation.
对于XER,类型定义在默认情况下也被视为元素定义,或者在存在XER属性编码指令时被视为属性定义。在某些情况下,需要匿名类型来定义元素,这会导致元素名,如<BOOLEAN>和<SEQUENCE>。NamedType表示法还定义了本地元素,在EXTENDED-XER中有一些奇怪的情况,NamedType表示法可以定义全局类型。因此,在XER下,类型可以用Type或NamedType表示法定义,元素和属性也可以用Type或NamedType表示法定义。
With RXER, types are only defined by Type notation and elements and attributes are only defined by NamedType notation. Global element and attribute definitions are made possible by top-level NamedType notation in an RXER encoding control section.
对于RXER,类型仅由类型表示法定义,元素和属性仅由NamedType表示法定义。全局元素和属性定义通过RXER编码控制部分中的顶级NamedType表示法实现。
RXER, with its clean separation of Type notation for types and NamedType notation for elements and attributes, is a better basis than XER for translating an ASN.1 specification into an XML representation (i.e., ASN.X [ASN.X]) or a compatible XML Schema, where type, element, and attribute definitions are also distinctly separate constructs.
RXER将类型的类型表示法与元素和属性的NamedType表示法完全分离,在将ASN.1规范转换为XML表示法(即ASN.X[ASN.X])或兼容的XML模式(其中类型、元素和属性定义也是明显分离的结构)方面,RXER比XER更适合。
There is usually a requirement on applications specified in ASN.1 to maintain backward compatibility with the encodings generated by previous versions. The encodings in question are typically BER. Even with the backward-compatibility constraint there is still considerable leeway for specification writers to rewrite the earlier specification. For example, they could rename types, factor out an
ASN.1中指定的应用程序通常需要与以前版本生成的编码保持向后兼容性。所讨论的编码通常是误码率。即使有向后兼容性约束,规范编写者仍有相当大的余地重写早期规范。例如,他们可以重命名类型,计算出
in-line type definition as a defined type (or the reverse), or replace a type definition with an equivalent parameterized reference. These changes produce no change to BER, DER, CER [X.690], Packed Encoding Rules (PER) [X.691], or Generic String Encoding Rules (GSER) [GSER] encodings (so specification writers have felt free to make such changes to improve their specification), but can change the names of elements in the XER encoding because XER uses types as element definitions. The RXER encoding is immune to this problem, thus RXER encodings are more stable than XER encodings over successive revisions of an ASN.1 specification (which explains the first 'R' in RXER). This has an obvious benefit for interoperability.
将内嵌类型定义作为已定义的类型(或相反),或使用等效的参数化引用替换类型定义。这些更改不会对BER、DER、CER[X.690]、压缩编码规则(PER)[X.691]或通用字符串编码规则(GSER)[GSER]编码产生任何更改(因此规范编写者可以随意进行此类更改以改进其规范),但是可以更改XER编码中元素的名称,因为XER使用类型作为元素定义。RXER编码不受此问题的影响,因此在ASN.1规范的连续修订中,RXER编码比XER编码更稳定(这解释了RXER中的第一个“R”)。这对互操作性有明显的好处。
RXER has special provisions for encoding values of the QName and Markup types. QName is used to hold qualified names and Markup can be used to hold arbitrary untyped markup. XER doesn't recognize any special types like these, but it is possible to get the same effects as RXER's QName and Markup types by using XER encoding instructions. Since CANONICAL-XER ignores encoding instructions, this means that under XER an application can either support qualified names and untyped markup, or support canonical XML encodings, but not both. In contrast, CRXER has canonicalization rules for qualified names and for Markup. Furthermore, EXTENDED-XER does not address the issues of normalization of untyped data for other ASN.1 canonical encoding rules (e.g., for DER; see Section 4.1.2) or normalization of XML encodings for syntax-based canonicalization (e.g., for Canonical XML; see Section 6.13).
RXER对QName和标记类型的值进行编码有特殊规定。QName用于保存限定名称,标记可用于保存任意非类型化标记。XER不能识别任何像这样的特殊类型,但是使用XER编码指令可以获得与RXER的QName和标记类型相同的效果。由于CANONICAL-XER忽略编码指令,这意味着在XER下,应用程序可以支持限定名称和非类型化标记,也可以支持规范XML编码,但不能同时支持两者。相反,CRXER对限定名和标记有规范化规则。此外,EXTENDED-XER没有解决其他ASN.1规范化编码规则的非类型化数据规范化问题(例如,对于DER,请参见第4.1.2节)或基于语法规范化的XML编码规范化问题(例如,对于规范化XML,请参见第6.13节)。
Both EXTENDED-XER and RXER use encoding instructions to define attributes, union types, and list types, among other things. Since CANONICAL-XER ignores encoding instructions, this means that under XER an application must choose between making use of attributes, union types, list types, etc., or supporting canonical XML encodings. In contrast, the canonicalization rules for CRXER encompass all the encoding instructions for RXER.
EXTENDED-XER和RXER都使用编码指令定义属性、联合类型和列表类型等。由于CANONICAL-XER忽略编码指令,这意味着在XER下,应用程序必须在使用属性、联合类型、列表类型等与支持规范XML编码之间进行选择。相反,CRXER的规范化规则包含了RXER的所有编码指令。
RXER does not necessarily enable the exact BER octet encoding of values of the TeletexString, VideotexString, GraphicString, or GeneralString types to be reconstructed, so a transformation from DER to RXER and back to DER may not reproduce the original DER encoding. This is a result of inadequate normalization of values of these string types in DER. A character in a TeletexString value (for example) that corresponds to a specific ISO 10646 character can be encoded for BER in a variety of ways that are indistinguishable in an
RXER不一定能够对要重建的TeletextString、VideotexString、GraphicsString或GeneralString类型的值进行精确的BER八位编码,因此从DER到RXER再回到DER的转换可能不会再现原始的DER编码。这是由于DER中这些字符串类型的值标准化不足造成的。例如,与特定ISO10646字符相对应的电传字符串值中的字符可以通过多种方式进行BER编码,而这些方式在同一种情况下是无法区分的
RXER re-encoding of the TeletexString value. DER does not mandate one of these possible character encodings in preference to all others.
电传字符串值的RXER重新编码。DER并不要求这些可能的字符编码中的一种优先于所有其他字符编码。
Because of the above, RXER MUST NOT be used to re-encode, whether for storage or transmission, ASN.1 abstract values whose original DER or CER encoding must be recoverable, and whose type definitions involve the TeletexString, VideotexString, GraphicString, or GeneralString type. Such recovery is needed for the verification of digital signatures. In such cases, protocols ought to use DER or a DER-reversible encoding. In other cases where ASN.1 canonical encoding rules are used, values of the Markup type must be normalized as described in Section 4.1.2.
由于上述原因,RXER不得用于重新编码ASN.1抽象值,无论是存储还是传输,其原始DER或CER编码必须是可恢复的,且其类型定义涉及TeletextString、VideotexString、GraphicsString或GeneralString类型。验证数字签名需要这种恢复。在这种情况下,协议应该使用DER或DER可逆编码。在使用ASN.1规范编码规则的其他情况下,标记类型的值必须按照第4.1.2节所述进行规范化。
A transformation from CRXER to BER and back to CRXER does reproduce the original CRXER encoding, therefore it is safe to use BER, DER, or CER to re-encode ASN.1 abstract values whose original CRXER encoding must be recoverable.
从CRXER到BER再到CRXER的转换确实会复制原始CRXER编码,因此使用BER、DER或CER重新编码其原始CRXER编码必须可恢复的ASN.1抽象值是安全的。
Digital signatures may also be calculated on the Canonical XML representation of an XML document. If RXER encodings appear in such documents, then applications must normalize the encodings as described in Section 6.13.
数字签名也可以根据XML文档的规范XML表示进行计算。如果RXER编码出现在此类文档中,则应用程序必须按照第6.13节所述规范化编码。
The null character (U+0000) cannot be represented in XML and hence cannot be transmitted in an RXER encoding. Null characters in abstract values of ASN.1 string types will be dropped if the values are RXER encoded; therefore, RXER MUST NOT be used by applications that attach significance to the null character.
空字符(U+0000)不能用XML表示,因此不能用RXER编码传输。如果值是RXER编码的,ASN.1字符串类型的抽象值中的空字符将被删除;因此,对空字符具有重要意义的应用程序不得使用RXER。
When interpreting security-sensitive fields, and in particular fields used to grant or deny access, implementations MUST ensure that any comparisons are done on the underlying abstract value, regardless of the particular encoding used. Comparisons of Markup values MUST operate as though the values have been normalized as specified in Section 4.1.2.
在解释安全敏感字段,尤其是用于授予或拒绝访问的特定字段时,实现必须确保对底层抽象值进行任何比较,而不管使用何种特定编码。标记值的比较必须按照第4.1.2节的规定进行规范化。
The technology described in this document is the product of a research project begun jointly by Adacel Technologies Limited and Deakin University, and subsequently refined and completed by eB2Bcom.
本文件中描述的技术是Adacel Technologies Limited和迪肯大学联合开展的一个研究项目的成果,随后由eB2Bcom完善和完成。
The IANA has registered a new XML namespace in accordance with RFC 3688 [XMLREG].
IANA已根据RFC 3688[XMLREG]注册了一个新的XML名称空间。
URI: urn:ietf:params:xml:ns:asnx
URI: urn:ietf:params:xml:ns:asnx
Registrant Contact: Steven Legg <steven.legg@eb2bcom.com>
Registrant Contact: Steven Legg <steven.legg@eb2bcom.com>
XML: None
XML:无
[BCP14] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[BCP14]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。
[UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC 3629, November 2003.
[UTF-8]Yergeau,F.,“UTF-8,ISO 10646的转换格式”,RFC 3629,2003年11月。
[XMLREG] Mealling, M., "The IETF XML Registry", RFC 3688, January 2004.
[XMLREG]Mealling,M.“IETF XML注册表”,RFC3682004年1月。
[URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", STD 66, RFC 3986, January 2005.
[URI]Berners Lee,T.,Fielding,R.和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。
[RXEREI] Legg, S., "Encoding Instructions for the Robust XML Encoding Rules (RXER)", RFC 4911, July 2007.
[RXEREI]Legg,S.,“健壮XML编码规则(RXER)的编码说明”,RFC 4911,2007年7月。
[ASN.X] Legg, S., "Abstract Syntax Notation X (ASN.X)", RFC 4912, July 2007.
[ASN.X]Legg,S.,“抽象语法符号X(ASN.X)”,RFC 4912,2007年7月。
[X.680] ITU-T Recommendation X.680 (07/02) | ISO/IEC 8824-1, Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation.
[X.680]ITU-T建议X.680(07/02)| ISO/IEC 8824-1,信息技术-抽象语法符号一(ASN.1):基本符号规范。
[X.680-1] ITU-T Recommendation X.680 (2002) Amendment 1 (10/03) | ISO/IEC 8824-1:2002/Amd 1:2004, Support for EXTENDED-XER.
[X.680-1]ITU-T建议X.680(2002)修改件1(10/03)| ISO/IEC 8824-1:2002/Amd 1:2004,对扩展XER的支持。
[X.681] ITU-T Recommendation X.681 (07/02) | ISO/IEC 8824-2, Information technology - Abstract Syntax Notation One (ASN.1): Information object specification.
[X.681]ITU-T建议X.681(07/02)| ISO/IEC 8824-2,信息技术-抽象语法符号1(ASN.1):信息对象规范。
[X.682] ITU-T Recommendation X.682 (07/02) | ISO/IEC 8824-3, Information technology - Abstract Syntax Notation One (ASN.1): Constraint specification.
[X.682]ITU-T建议X.682(07/02)| ISO/IEC 8824-3,信息技术-抽象语法符号1(ASN.1):约束规范。
[X.683] ITU-T Recommendation X.683 (07/02) | ISO/IEC 8824-4, Information technology - Abstract Syntax Notation One (ASN.1): Parameterization of ASN.1 specifications.
[X.683]ITU-T建议X.683(07/02)| ISO/IEC 8824-4,信息技术-抽象语法符号1(ASN.1):ASN.1规范的参数化。
[X.690] ITU-T Recommendation X.690 (07/02) | ISO/IEC 8825-1, Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER).
[X.690]ITU-T建议X.690(07/02)| ISO/IEC 8825-1,信息技术-ASN.1编码规则:基本编码规则(BER)、规范编码规则(CER)和区分编码规则(DER)规范。
[UCS] ISO/IEC 10646-1:2000, Information technology - Universal Multiple-Octet Coded Character Set (UCS) - Part 1: Architecture and Basic Multilingual Plane.
[UCS]ISO/IEC 10646-1:2000,信息技术-通用多八位编码字符集(UCS)-第1部分:体系结构和基本多语言平面。
[UNICODE] The Unicode Consortium, "The Unicode Standard, Version 4.0", Boston, MA, Addison-Wesley Developers Press, 2003. ISBN 0-321-18578-1.
[UNICODE]UNICODE联盟,“UNICODE标准,4.0版”,马萨诸塞州波士顿,Addison-Wesley开发者出版社,2003年。ISBN 0-321-18578-1。
[XML10] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E. and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C Recommendation, http://www.w3.org/TR/2006/REC-xml-20060816, August 2006.
[XML10]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.和F.Yergeau,“可扩展标记语言(XML)1.0(第四版)”,W3C建议,http://www.w3.org/TR/2006/REC-xml-20060816,2006年8月。
[XML11] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., Yergeau, F., and J. Cowan, "Extensible Markup Language (XML) 1.1 (Second Edition)", W3C Recommendation, http://www.w3.org/TR/2006/REC-xml11-20060816, August 2006.
[XML11]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,Yergeau,F.,和J.Cowan,“可扩展标记语言(XML)1.1(第二版)”,W3C建议,http://www.w3.org/TR/2006/REC-xml11-20060816,2006年8月。
[XMLNS10] Bray, T., Hollander, D., Layman, A., and R. Tobin, "Namespaces in XML 1.0 (Second Edition)", W3C Recommendation, http://www.w3.org/TR/2006/REC-xml-names-20060816, August 2006.
[XMLNS10]Bray,T.,Hollander,D.,Layman,A.,和R.Tobin,“XML 1.0中的名称空间(第二版)”,W3C建议,http://www.w3.org/TR/2006/REC-xml-names-20060816,2006年8月。
[XMLNS11] Bray, T., Hollander, D., Layman, A. and R. Tobin, "Namespaces in XML 1.1 (Second Edition)", W3C Recommendation, http://www.w3.org/TR/2006/REC-xml-names11-20060816, August 2006.
[XMLNS11]Bray,T.,Hollander,D.,Layman,A.和R.Tobin,“XML 1.1中的名称空间(第二版)”,W3C建议,http://www.w3.org/TR/2006/REC-xml-names11-20060816,2006年8月。
[INFOSET] Cowan, J. and R. Tobin, "XML Information Set (Second Edition)", W3C Recommendation, http://www.w3.org/TR/2004/REC-xml-infoset-20040204, February 2004.
[INFOSET]Cowan,J.和R.Tobin,“XML信息集(第二版)”,W3C建议,http://www.w3.org/TR/2004/REC-xml-infoset-20040204,2004年2月。
[XSD1] Thompson, H., Beech, D., Maloney, M. and N. Mendelsohn, "XML Schema Part 1: Structures Second Edition", W3C Recommendation, http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/, October 2004.
[XSD1]Thompson,H.,Beech,D.,Maloney,M.和N.Mendelsohn,“XML模式第1部分:结构第二版”,W3C建议,http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/,2004年10月。
[GSER] Legg, S., "Generic String Encoding Rules (GSER) for ASN.1 Types", RFC 3641, October 2003.
[GSER]Legg,S.,“ASN.1类型的通用字符串编码规则(GSER)”,RFC 36412003年10月。
[X.691] ITU-T Recommendation X.691 (07/02) | ISO/IEC 8825-4:2002, Information technology - ASN.1 encoding rules: Specification of Packed Encoding Rules (PER).
[X.691]ITU-T建议X.691(07/02)| ISO/IEC 8825-4:2002,信息技术-ASN.1编码规则:压缩编码规则规范(PER)。
[X.693] ITU-T Recommendation X.693 (12/01) | ISO/IEC 8825-4:2002, Information technology - ASN.1 encoding rules: XML encoding rules (XER).
[X.693]ITU-T建议X.693(12/01)| ISO/IEC 8825-4:2002,信息技术-ASN.1编码规则:XML编码规则(XER)。
[XSD2] Biron, P. and A. Malhotra, "XML Schema Part 2: Datatypes Second Edition", W3C Recommendation, http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/, October 2004.
[XSD2]Biron,P.和A.Malhotra,“XML模式第2部分:数据类型第二版”,W3C建议,http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/,2004年10月。
[CXML] Boyer, J., "Canonical XML Version 1.0", W3C Recommendation, http://www.w3.org/TR/2001/REC-xml-c14n-20010315, March 2001.
[CXML]Boyer,J.,“规范XML 1.0版”,W3C建议,http://www.w3.org/TR/2001/REC-xml-c14n-20010315,2001年3月。
This appendix is normative.
本附录为规范性附录。
AdditionalBasicDefinitions { iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) module(0) basic(0) }
AdditionalBasicDefinitions { iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) xmled(21472) asnx(1) module(0) basic(0) }
-- Copyright (C) The IETF Trust (2007). This version of -- this ASN.1 module is part of RFC 4910; see the RFC itself -- for full legal notices. -- -- Regarding this ASN.1 module or any portion of it, the authors -- make no guarantees and are not responsible for any damage -- resulting from its use. The authors grant irrevocable permission -- to anyone to use, modify, and distribute it in any way that does -- not diminish the rights of anyone else to use, modify, and -- distribute it, provided that redistributed derivative works do -- not contain misleading author or version information. -- Derivative works need not be licensed under similar terms.
-- Copyright (C) The IETF Trust (2007). This version of -- this ASN.1 module is part of RFC 4910; see the RFC itself -- for full legal notices. -- -- Regarding this ASN.1 module or any portion of it, the authors -- make no guarantees and are not responsible for any damage -- resulting from its use. The authors grant irrevocable permission -- to anyone to use, modify, and distribute it in any way that does -- not diminish the rights of anyone else to use, modify, and -- distribute it, provided that redistributed derivative works do -- not contain misleading author or version information. -- Derivative works need not be licensed under similar terms.
DEFINITIONS RXER INSTRUCTIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::= BEGIN
DEFINITIONS RXER INSTRUCTIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::= BEGIN
Markup ::= CHOICE { text SEQUENCE { prolog UTF8String (SIZE(1..MAX)) OPTIONAL, prefix NCName OPTIONAL, attributes UTF8String (SIZE(1..MAX)) OPTIONAL, content UTF8String (SIZE(1..MAX)) OPTIONAL } }
Markup ::= CHOICE { text SEQUENCE { prolog UTF8String (SIZE(1..MAX)) OPTIONAL, prefix NCName OPTIONAL, attributes UTF8String (SIZE(1..MAX)) OPTIONAL, content UTF8String (SIZE(1..MAX)) OPTIONAL } }
AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- })
AnyURI ::= UTF8String (CONSTRAINED BY { -- conforms to the format of a URI -- })
NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML 1.0 -- })
NCName ::= UTF8String (CONSTRAINED BY { -- conforms to the NCName production of -- Namespaces in XML 1.0 -- })
Name ::= UTF8String (CONSTRAINED BY { -- conforms to the Name production of XML -- })
Name ::= UTF8String (CONSTRAINED BY { -- conforms to the Name production of XML -- })
QName ::= SEQUENCE { namespace-name AnyURI OPTIONAL, local-name NCName }
QName ::= SEQUENCE { namespace-name AnyURI OPTIONAL, local-name NCName }
ENCODING-CONTROL RXER
编码控制RXER
TARGET-NAMESPACE "urn:ietf:params:xml:ns:asnx" PREFIX "asnx"
TARGET-NAMESPACE "urn:ietf:params:xml:ns:asnx" PREFIX "asnx"
COMPONENT context [ATTRIBUTE] [LIST] SEQUENCE OF prefix NCName
组件上下文[属性][列表]前缀NCName的序列
END
终止
Authors' Addresses
作者地址
Dr. Steven Legg eB2Bcom Suite 3, Woodhouse Corporate Centre 935 Station Street Box Hill North, Victoria 3129 AUSTRALIA
Steven Legg博士eB2Bcom澳大利亚维多利亚州博克斯山北站街935号伍德豪斯企业中心3号套房,邮编:3129
Phone: +61 3 9896 7830 Fax: +61 3 9896 7801 EMail: steven.legg@eb2bcom.com
Phone: +61 3 9896 7830 Fax: +61 3 9896 7801 EMail: steven.legg@eb2bcom.com
Dr. Daniel Prager
丹尼尔·普拉格博士
EMail: dap@austhink.com
EMail: dap@austhink.com
Full Copyright Statement
完整版权声明
Copyright (C) The IETF Trust (2007).
版权所有(C)IETF信托基金(2007年)。
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
本文件及其包含的信息以“原样”为基础提供,贡献者、他/她所代表或赞助的组织(如有)、互联网协会、IETF信托基金和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。
Intellectual Property
知识产权
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.
Acknowledgement
确认
Funding for the RFC Editor function is currently provided by the Internet Society.
RFC编辑功能的资金目前由互联网协会提供。