Tech-invite3GPPspaceIETFspace
96959493929190898887868584838281807978777675747372717069686766656463626160595857565554535251504948474645444342414039383736353433323130292827262524232221201918171615141312111009080706050403020100
in Index   Prev   Next

RFC 4912

Abstract Syntax Notation X (ASN.X)

Pages: 165
Experimental
Part 4 of 6 – Pages 66 to 93
First   Prev   Next

Top   ToC   RFC4912 - Page 66   prevText

9. Translation of Object Classes

The translation of an ObjectClass is the translation of the DefinedObjectClass, ObjectClassDefn, or ParameterizedObjectClass in the ObjectClass. The translation of a ParameterizedObjectClass is described in Section 13.

9.1. DefinedObjectClass Translation

If a DefinedObjectClass is an objectclassreference (not a DummyReference), an ExternalObjectClassReference, or a UsefulObjectClassReference, then the translation of the
Top   ToC   RFC4912 - Page 67
   DefinedObjectClass is either the attribute form translation of an
   object class reference, or the element form translation of an object
   class reference.

   The attribute form translation of an object class reference is an
   attribute item with the [local name] "class".  The [normalized value]
   of this attribute item is a qualified name for the expanded name of
   the referenced object class definition (see Section 5.1).  In the
   case of a UsefulObjectClassReference, the namespace name of the
   expanded name is "urn:ietf:params:xml:ns:asnx", and the local name is
   either "TYPE-IDENTIFIER" or "ABSTRACT-SYNTAX", as the case may be.
   The attribute form translation SHALL NOT be used if the expanded name
   is not distinct with respect to the current module and the modules
   referenced by its <import> element items (see Section 5.1).
   Otherwise, the translator is free to choose either the attribute form
   or element form translation for an object class reference.

   The element form translation of an object class reference is an
   element item with the [local name] "class".  An element item with the
   [local name] "annotation" MAY be added to the [children] of the
   <class> element item.  An attribute item with the [local name] "ref"
   SHALL be added to the [attributes] of the <class> element item.  The
   [normalized value] of this attribute item is a qualified name for the
   expanded name of the referenced object class definition.  In the case
   of a UsefulObjectClassReference, the namespace name of the expanded
   name is "urn:ietf:params:xml:ns:asnx" and the local name is either
   "TYPE-IDENTIFIER" or "ABSTRACT-SYNTAX", as the case may be.  If the
   expanded name is not distinct with respect to the current module and
   the modules referenced by its <import> element items, then an
   attribute item with the [local name] "context" SHALL be added to the
   [attributes] of the <class> element item; otherwise, if the module
   containing the referenced object class definition has a schema
   identity URI, then an attribute item with the [local name] "context"
   MAY be added to the [attributes] of the <class> element item.  The
   [normalized value] of this attribute item is the schema identity URI
   of the module containing the referenced object class definition.

      Aside: If a reference name is not distinct, then the module
      containing the referenced definition must have a schema identity
      URI (see Section 5.1).

   The translation of the DefinedObjectClass is the same whether the
   object class definition is referenced by an objectclassreference or
   an ExternalObjectClassReference.

   If a DefinedObjectClass is a DummyReference, then the translation of
   the DefinedObjectClass is the translation of the DummyReference (see
   Section 13).
Top   ToC   RFC4912 - Page 68

9.2. ObjectClassDefn Translation

The translation of an ObjectClassDefn is an element item with the [local name] "class". An element item with the [local name] "annotation" MAY be added to the [children] of the <class> element item. The translation of each FieldSpec in the ObjectClassDefn SHALL be appended to the [children] of the <class> element item. The translation of a FieldSpec is the translation of the TypeFieldSpec, FixedTypeValueFieldSpec, VariableTypeValueFieldSpec, FixedTypeValueSetFieldSpec, VariableTypeValueSetFieldSpec, ObjectFieldSpec, or ObjectSetFieldSpec in the FieldSpec.

9.2.1. TypeFieldSpec Translation

The translation of a TypeFieldSpec where the TypeOptionalitySpec is absent is an element item with the [local name] "typeField". The translation of a TypeFieldSpec with a TypeOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "typeField" SHALL be added to the [children] of the <optional> element item. The translation of a TypeFieldSpec with a TypeOptionalitySpec of the "DEFAULT Type" form is an element item with the [local name] "optional". An element item with the [local name] "typeField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the Type in the TypeOptionalitySpec SHALL be added to the [children] or [attributes] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <typeField> element item. The [normalized value] of this attribute item is the typefieldreference in the TypeFieldSpec, without the ampersand character ('&', U+0026). An element item with the [local name] "annotation" MAY be added to the [children] of the <typeField> element item. Example CLASS { &One, &Two OPTIONAL, &Three DEFAULT OBJECT IDENTIFIER }
Top   ToC   RFC4912 - Page 69
      <class>
       <typeField name="One"/>
       <optional>
        <typeField name="Two"/>
       </optional>
       <optional>
        <typeField name="Three"/>
        <default type="asnx:OBJECT-IDENTIFIER"/>
       </optional>
      </class>

9.2.2. FixedTypeValueFieldSpec Translation

The translation of a FixedTypeValueFieldSpec where the ValueOptionalitySpec is absent is an element item with the [local name] "valueField". The translation of a FixedTypeValueFieldSpec with a ValueOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "valueField" SHALL be added to the [children] of the <optional> element item. The translation of a FixedTypeValueFieldSpec with a ValueOptionalitySpec of the "DEFAULT Value" form is an element item with the [local name] "optional". An element item with the [local name] "valueField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the Value in the ValueOptionalitySpec SHALL be added to the [children] or [attributes] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <valueField> element item. The [normalized value] of this attribute item is the valuefieldreference in the FixedTypeValueFieldSpec, without the ampersand character ('&', U+0026). If the "UNIQUE" keyword is present, then an attribute item with the [local name] "unique" and [normalized value] "true" or "1" SHALL be added to the [attributes] of the <valueField> element item; otherwise, an attribute item with the [local name] "unique" and [normalized value] "false" or "0" MAY be added to the [attributes] of the <valueField> element item. An element item with the [local name] "annotation" MAY be added to the [children] of the <valueField> element item. The translation of the Type in the FixedTypeValueFieldSpec SHALL be added to the [children] or [attributes] of the <valueField> element item.
Top   ToC   RFC4912 - Page 70
   Example

      CLASS {
          &one    OBJECT IDENTIFIER UNIQUE,
          &two    BOOLEAN OPTIONAL,
          &three  INTEGER DEFAULT 0
      }

      <class>
       <valueField name="one" unique="true"
                   type="asnx:OBJECT-IDENTIFIER"/>
       <optional>
        <valueField name="two" type="asnx:BOOLEAN"/>
       </optional>
       <optional>
        <valueField name="three" type="asnx:INTEGER"/>
        <default literalValue="0"/>
       </optional>
      </class>

9.2.3. FixedTypeValueSetFieldSpec Translation

The translation of a FixedTypeValueSetFieldSpec where the ValueSetOptionalitySpec is absent is an element item with the [local name] "valueSetField". The translation of a FixedTypeValueSetFieldSpec with a ValueSetOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "valueSetField" SHALL be added to the [children] of the <optional> element item. The translation of a FixedTypeValueSetFieldSpec with a ValueSetOptionalitySpec of the "DEFAULT ValueSet" form is an element item with the [local name] "optional". An element item with the [local name] "valueSetField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the ValueSet in the ValueSetOptionalitySpec SHALL be added to the [children] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <valueSetField> element item. The [normalized value] of this attribute item is the valuesetfieldreference in the FixedTypeValueSetFieldSpec, without the ampersand character ('&', U+0026). An element item with the [local name] "annotation" MAY be added to the [children] of the
Top   ToC   RFC4912 - Page 71
   <valueSetField> element item.  The translation of the Type in the
   FixedTypeValueSetFieldSpec SHALL be added to the [children] or
   [attributes] of the <valueSetField> element item.

   Example

      CLASS {
          &One    UTF8String,
          &Two    BOOLEAN OPTIONAL,
          &Three  INTEGER DEFAULT { 1 | 2 }
      }

      <class>
       <valueSetField name="One" type="asnx:UTF8String"/>
       <optional>
        <valueSetField name="Two" type="asnx:BOOLEAN"/>
       </optional>
       <optional>
        <valueSetField name="Three" type="asnx:INTEGER"/>
        <default>
         <valueSet>
          <union>
           <literalValue>1</literalValue>
           <literalValue>2</literalValue>
          </union>
         </valueSet>
        </default>
       </optional>
      </class>

9.2.4. VariableTypeValueFieldSpec Translation

The translation of a VariableTypeValueFieldSpec where the ValueOptionalitySpec is absent is an element item with the [local name] "valueField". The translation of a VariableTypeValueFieldSpec with a ValueOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "valueField" SHALL be added to the [children] of the <optional> element item. The translation of a VariableTypeValueFieldSpec with a ValueOptionalitySpec of the "DEFAULT Value" form is an element item with the [local name] "optional". An element item with the [local name] "valueField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional>
Top   ToC   RFC4912 - Page 72
   element item.  The translation of the Value in the
   ValueOptionalitySpec SHALL be added to the [children] or [attributes]
   of the <default> element item.

   An attribute item with the [local name] "name" SHALL be added to the
   [attributes] of the <valueField> element item.  The
   [normalized value] of this attribute item is the valuefieldreference
   in the VariableTypeValueFieldSpec, without the ampersand character
   ('&', U+0026).  An element item with the [local name] "annotation"
   MAY be added to the [children] of the <valueField> element item.  An
   element item with the [local name] "typeFromField" SHALL be appended
   to the [children] of the <valueField> element item.  The translation
   of the FieldName in the VariableTypeValueFieldSpec SHALL be added to
   the [children] or [attributes] of the <typeFromField> element item.

   Example

      CLASS {
          &Syntax DEFAULT INTEGER,
          &one    &Syntax,
          &two    &Syntax OPTIONAL,
          &three  &Syntax DEFAULT 0
      }

      <class>
       <optional>
        <typeField name="Syntax"/>
        <default type="asnx:INTEGER"/>
       </optional>
       <valueField name="one">
        <typeFromField fieldName="Syntax"/>
       </valueField>
       <optional>
        <valueField name="two">
         <typeFromField fieldName="Syntax"/>
        </valueField>
       </optional>
       <optional>
        <valueField name="three">
         <typeFromField fieldName="Syntax"/>
        </valueField>
        <default literalValue="0"/>
       </optional>
      </class>
Top   ToC   RFC4912 - Page 73

9.2.5. VariableTypeValueSetFieldSpec Translation

The translation of a VariableTypeValueSetFieldSpec where the ValueSetOptionalitySpec is absent is an element item with the [local name] "valueSetField". The translation of a VariableTypeValueSetFieldSpec with a ValueSetOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "valueSetField" SHALL be added to the [children] of the <optional> element item. The translation of a VariableTypeValueSetFieldSpec with a ValueSetOptionalitySpec of the "DEFAULT ValueSet" form is an element item with the [local name] "optional". An element item with the [local name] "valueSetField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the ValueSet in the ValueSetOptionalitySpec SHALL be added to the [children] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <valueSetField> element item. The [normalized value] of this attribute item is the valuesetfieldreference in the VariableTypeValueSetFieldSpec, without the ampersand character ('&', U+0026). An element item with the [local name] "annotation" MAY be added to the [children] of the <valueSetField> element item. An element item with the [local name] "typeFromField" SHALL be appended to the [children] of the <valueSetField> element item. The translation of the FieldName in the VariableTypeValueSetFieldSpec SHALL be added to the [children] or [attributes] of the <typeFromField> element item. Example CLASS { &Syntax DEFAULT INTEGER, &One &Syntax, &Two &Syntax OPTIONAL, &Three &Syntax DEFAULT { 1 | 2 } } <class> <optional> <typeField name="Syntax"/> <default type="asnx:INTEGER"/> </optional>
Top   ToC   RFC4912 - Page 74
       <valueSetField name="One">
        <typeFromField fieldName="Syntax"/>
       </valueSetField>
       <optional>
        <valueSetField name="Two">
         <typeFromField fieldName="Syntax"/>
        </valueSetField>
       </optional>
       <optional>
        <valueSetField name="Three">
         <typeFromField fieldName="Syntax"/>
        </valueSetField>
        <default>
         <valueSet>
          <union>
           <literalValue>1</literalValue>
           <literalValue>2</literalValue>
          </union>
         </valueSet>
        </default>
       </optional>
      </class>

9.2.6. FieldName Translation

The translation of a FieldName is either, at the translator's option, an attribute item with the [local name] "fieldName" added to the [attributes] of the enclosing element item, or an element item with the [local name] "fieldName" appended to the [children] of the enclosing element item. The [normalized value] of the fieldName attribute item is a solidus ('/', U+002F) separated list of the PrimitiveFieldName instances in the FieldName, without the ampersand characters ('&', U+0026). Leading and/or trailing white space characters MAY be added to the [normalized value] of the attribute item. White space characters MAY be added immediately before and/or after any solidus character ('/', U+002F) in the [normalized value]. The [children] property of the <fieldName> element item is set to the sequence of character items for a solidus ('/', U+002F) separated list of the PrimitiveFieldName instances in the FieldName, without the ampersand characters ('&', U+0026). Leading and/or trailing white space character items MAY be added to the [children] of the <fieldName> element item. White space character items MAY be added immediately before and/or after any character item for the solidus character ('/', U+002F).
Top   ToC   RFC4912 - Page 75
   Example

      &Linked.&ArgumentType

      <fieldName>Linked/ArgumentType</fieldName>

9.2.7. ObjectFieldSpec Translation

The translation of an ObjectFieldSpec where the ObjectOptionalitySpec is absent is an element item with the [local name] "objectField". The translation of an ObjectFieldSpec with an ObjectOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "objectField" SHALL be added to the [children] of the <optional> element item. The translation of an ObjectFieldSpec with an ObjectOptionalitySpec of the "DEFAULT Object" form is an element item with the [local name] "optional". An element item with the [local name] "objectField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the Object in the ObjectOptionalitySpec SHALL be added to the [children] or [attributes] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <objectField> element item. The [normalized value] of this attribute item is the objectfieldreference in the ObjectFieldSpec, without the ampersand character ('&', U+0026). An element item with the [local name] "annotation" MAY be added to the [children] of the <objectField> element item. The translation of the DefinedObjectClass in the ObjectFieldSpec SHALL be added to the [children] or [attributes] of the <objectField> element item. Example CLASS { &one TYPE-IDENTIFIER, &two ABSTRACT-SYNTAX OPTIONAL, &three TYPE-IDENTIFIER DEFAULT myObject }
Top   ToC   RFC4912 - Page 76
      <class>
       <objectField name="one" class="asnx:TYPE-IDENTIFIER"/>
       <optional>
        <objectField name="two" class="asnx:ABSTRACT-SYNTAX"/>
       </optional>
       <optional>
        <objectField name="three" class="asnx:TYPE-IDENTIFIER"/>
        <default object="tns:myObject"/>
       </optional>
      </class>

9.2.8. ObjectSetFieldSpec Translation

The translation of an ObjectSetFieldSpec where the ObjectSetOptionalitySpec is absent is an element item with the [local name] "objectSetField". The translation of an ObjectSetFieldSpec with an ObjectSetOptionalitySpec of the "OPTIONAL" form is an element item with the [local name] "optional". An element item with the [local name] "objectSetField" SHALL be added to the [children] of the <optional> element item. The translation of an ObjectSetFieldSpec with an ObjectSetOptionalitySpec of the "DEFAULT ObjectSet" form is an element item with the [local name] "optional". An element item with the [local name] "objectSetField" SHALL be added to the [children] of the <optional> element item. An element item with the [local name] "default" SHALL be appended to the [children] of the <optional> element item. The translation of the ObjectSet in the ObjectSetOptionalitySpec SHALL be added to the [children] or [attributes] of the <default> element item. An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <objectSetField> element item. The [normalized value] of this attribute item is the objectsetfieldreference in the ObjectSetFieldSpec, without the ampersand character ('&', U+0026). An element item with the [local name] "annotation" MAY be added to the [children] of the <objectSetField> element item. The translation of the DefinedObjectClass in the ObjectSetFieldSpec SHALL be added to the [children] or [attributes] of the <objectSetField> element item.
Top   ToC   RFC4912 - Page 77
   Example

      CLASS {
          &One    TYPE-IDENTIFIER,
          &Two    ABSTRACT-SYNTAX OPTIONAL,
          &Three  TYPE-IDENTIFIER DEFAULT { myObject }
      }

      <class>
       <objectSetField name="One" class="asnx:TYPE-IDENTIFIER"/>
       <optional>
        <objectSetField name="Two" class="asnx:ABSTRACT-SYNTAX"/>
       </optional>
       <optional>
        <objectSetField name="Three" class="asnx:TYPE-IDENTIFIER"/>
        <default>
         <objectSet>
          <object ref="tns:myObject"/>
         </objectSet>
        </default>
       </optional>
      </class>

10. Translation of Objects

The translation of an Object is the translation of the DefinedObject, ObjectDefn, ObjectFromObject, or ParameterizedObject in the Object. The translation of a ParameterizedObject is described in Section 13.

10.1. DefinedObject Translation

If a DefinedObject is an objectreference (not a DummyReference) or an ExternalObjectReference, then the translation of the DefinedObject is either the attribute form translation of an object reference, or the element form translation of an object reference. The attribute form translation of an object reference is an attribute item with the [local name] "object". The [normalized value] of this attribute item is a qualified name for the expanded name of the referenced object definition (see Section 5.1). The attribute form translation SHALL NOT be used if this expanded name is not distinct with respect to the current module and the modules referenced by its <import> element items (see Section 5.1). The element form translation of an object reference is an element item with the [local name] "object". An element item with the [local name] "annotation" MAY be added to the [children] of the
Top   ToC   RFC4912 - Page 78
   <object> element item.  An attribute item with the [local name] "ref"
   SHALL be added to the [attributes] of the <object> element item.  The
   [normalized value] of this attribute item is a qualified name for the
   expanded name of the referenced object definition.  If this expanded
   name is not distinct with respect to the current module and the
   modules referenced by its <import> element items, then an attribute
   item with the [local name] "context" SHALL be added to the
   [attributes] of the <object> element item; otherwise, if the module
   containing the referenced object definition has a schema identity
   URI, then an attribute item with the [local name] "context" MAY be
   added to the [attributes] of the <object> element item.  The
   [normalized value] of this attribute item is the schema identity URI
   of the module containing the referenced object definition.

      Aside: If a reference name is not distinct, then the module
      containing the referenced definition must have a schema identity
      URI (see Section 5.1).

   The translation of the DefinedObject is the same whether the object
   definition is referenced by an objectreference or an
   ExternalObjectReference.

   Usually the translator is free to choose either the attribute form or
   element form translation for an object reference; however, in some
   contexts the attribute form is explicitly disallowed.

   If a DefinedObject is a DummyReference, then the translation of the
   DefinedObject is the translation of the DummyReference (see
   Section 13).

10.2. ObjectDefn Translation

An ObjectDefn that is a DefinedSyntax is first converted to the equivalent DefaultSyntax and then translated. The translation of an ObjectDefn is an element item with the [local name] "object". An element item with the [local name] "annotation" MAY be added to the [children] of the <object> element item. The translation of each FieldSetting in the DefaultSyntax in the ObjectClassDefn SHALL be appended to the [children] of the <object> element item. The translation of a FieldSetting is an element item with the [local name] "field". An attribute item with the [local name] "name" SHALL be added to the [attributes] of the <field> element item. The [normalized value] of this attribute item is the PrimitiveFieldName in the FieldSetting, without the ampersand character ('&', U+0026). The translation of the Type, Value, ValueSet, Object, or ObjectSet in
Top   ToC   RFC4912 - Page 79
   the Setting in the FieldSetting SHALL be added to the [children] or
   [attributes] of the <field> element item.

   Example

      -- This is the governing object class.
      ONE-OF-EVERYTHING ::= CLASS {
          &One,
          &two    INTEGER,
          &Three  INTEGER,
          &four   TYPE-IDENTIFIER,
          &Five   TYPE-IDENTIFIER
      }

      <namedClass name="ONE-OF-EVERYTHING">
       <class>
        <typeField name="One"/>
        <valueField name="two" type="asnx:INTEGER"/>
        <valueSetField name="Three" type="asnx:INTEGER"/>
        <objectField name="four" class="asnx:TYPE-IDENTIFIER"/>
        <objectSetField name="Five" class="asnx:TYPE-IDENTIFIER"/>
       </class>
      </namedClass>

      mixedBag ONE-OF-EVERYTHING ::= {
          &One    BOOLEAN,
          &two    99,
          &Three  { 1 | 2 },
          &four   myObject,
          &Five   { myObject }
      }

      <namedObject name="mixedBag" class="tns:ONE-OF-EVERYTHING">
       <object>
        <field name="One" type="asnx:BOOLEAN"/>
        <field name="two" literalValue="99"/>
        <field name="Three">
         <valueSet>
          <union>
           <literalValue>1</literalValue>
           <literalValue>2</literalValue>
          </union>
         </valueSet>
        </field>
        <field name="four" object="tns:myObject"/>
        <field name="Five">
         <objectSet>
          <object ref="tns:myObject"/>
Top   ToC   RFC4912 - Page 80
         </objectSet>
        </field>
       </object>
      </namedObject>

10.3. ObjectFromObject Translation

The translation of an ObjectFromObject is an element item with the [local name] "object". An element item with the [local name] "annotation" MAY be added to the [children] of the <object> element item. An element item with the [local name] "fromObjects" SHALL be appended to the [children] of the <object> element item. The translation of the ReferencedObjects instance in the ObjectFromObject SHALL be added to the [children] or [attributes] of the <fromObjects> element item. The translation of the FieldName in the ObjectFromObject SHALL be added to the [children] or [attributes] of the <fromObjects> element item.

11. Translation of Object Sets

If an ObjectSet matches the form "{ DefinedObjectSet }" (i.e., a DefinedObjectSet in an ObjectSetElements instance in an Elements instance in a lone IntersectionElements instance in a lone Intersections instance in a Unions instance in an ElementSetSpec in a RootElementSetSpec in an ObjectSetSpec without an AdditionalElementSetSpec), then the translator MAY use the translation of the DefinedObjectSet as the translation of the ObjectSet; otherwise, the translation of an ObjectSet is an element item with the [local name] "objectSet". An element item with the [local name] "annotation" MAY be added to the [children] of the <objectSet> element item. The translation of the ObjectSetSpec in the ObjectSet SHALL be appended to the [children] of the <objectSet> element item. Aside: An ObjectSet that is directly a DefinedObjectSet is a notational capability that does not exist in ASN.1, but is allowed in ASN.X to avoid excessive nesting of <objectSet> element items in the expansion of parameterized definitions. If an ObjectSetSpec contains only a RootElementSetSpec, then the translation of the ObjectSetSpec is the translation of the ElementSetSpec in the RootElementSetSpec.
Top   ToC   RFC4912 - Page 81
   If an ObjectSetSpec contains a RootElementSetSpec and an ellipsis
   ("..."), then the translation of the ObjectSetSpec is the translation
   of the ElementSetSpec in the RootElementSetSpec followed by an
   element item with the [local name] "extension".  If an
   AdditionalElementSetSpec is present, then the translation of the
   ElementSetSpec in the AdditionalElementSetSpec SHALL be added to the
   [children] of the <extension> element item.

   If an ObjectSetSpec does not contain a RootElementSetSpec, then the
   translation of the ObjectSetSpec is an element item with the
   [local name] "extension".  If an AdditionalElementSetSpec is present,
   then the translation of the ElementSetSpec in the
   AdditionalElementSetSpec SHALL be added to the [children] of the
   <extension> element item.

   Nested within the ElementSetSpec will be one or more
   ObjectSetElements instances.

11.1. DefinedObjectSet Translation

If a DefinedObjectSet is an objectsetreference (not a DummyReference) or an ExternalObjectSetReference, then the translation of the DefinedObjectSet is either the attribute form translation of an object set reference, or the element form translation of an object set reference. The attribute form translation of an object set reference is an attribute item with the [local name] "objectSet". The [normalized value] of this attribute item is a qualified name for the expanded name of the referenced object set definition (see Section 5.1). The attribute form translation SHALL NOT be used if this expanded name is not distinct with respect to the current module and the modules referenced by its <import> element items (see Section 5.1). The element form translation of an object set reference is an element item with the [local name] "objectSet". An element item with the [local name] "annotation" MAY be added to the [children] of the <objectSet> element item. An attribute item with the [local name] "ref" SHALL be added to the [attributes] of the <objectSet> element item. The [normalized value] of this attribute item is a qualified name for the expanded name of the referenced object set definition. If this expanded name is not distinct with respect to the current module and the modules referenced by its <import> element items, then an attribute item with the [local name] "context" SHALL be added to the [attributes] of the <objectSet> element item; otherwise, if the module containing the referenced object set definition has a schema identity URI, then an attribute item with the [local name] "context"
Top   ToC   RFC4912 - Page 82
   MAY be added to the [attributes] of the <objectSet> element item.
   The [normalized value] of this attribute item is the schema identity
   URI of the module containing the referenced object set definition.

      Aside: If a reference name is not distinct, then the module
      containing the referenced definition must have a schema identity
      URI (see Section 5.1).

   The translation of the DefinedObjectSet is the same whether the
   object definition is referenced by an objectsetreference or an
   ExternalObjectSetReference.

   Usually the translator is free to choose either the attribute form or
   element form translation for an object set reference; however, in
   some contexts the attribute form is explicitly disallowed.

   If a DefinedObjectSet is a DummyReference, then the translation of
   the DefinedObjectSet is the translation of the DummyReference (see
   Section 13).

11.2. ObjectSetElements Translation

If an ObjectSetElements instance is an Object, then the translation of the ObjectSetElements instance is the translation of the Object, except that the attribute form of the DefinedObject translation SHALL NOT be used if the Object is a DefinedObject. If an ObjectSetElements instance is a DefinedObjectSet, then the translation of the ObjectSetElements instance is the translation of the DefinedObjectSet, except that the attribute form of the DefinedObjectSet translation SHALL NOT be used. If an ObjectSetElements instance is an ObjectSetFromObjects, then the translation of the ObjectSetElements instance is the translation of the ObjectSetFromObjects. If an ObjectSetElements instance is a ParameterizedObjectSet, then the translation of the ObjectSetElements instance is the translation of the ParameterizedObjectSet (see Section 13). Aside: The in-line expansion of a ParameterizedObjectSet results in an ObjectSet. An ObjectSetElements instance that is an ObjectSet is a notational capability that does not exist in ASN.1, but is allowed in ASN.X to avoid the need to manufacture a reference name for the expanded parameterized definition.
Top   ToC   RFC4912 - Page 83

11.2.1. ObjectSetFromObjects Translation

The translation of an ObjectSetFromObjects instance is an element item with the [local name] "objectSet". An element item with the [local name] "annotation" MAY be added to the [children] of the <objectSet> element item. An element item with the [local name] "fromObjects" SHALL be appended to the [children] of the <objectSet> element item. The translation of the ReferencedObjects instance in the ObjectSetFromObjects SHALL be added to the [children] or [attributes] of the <fromObjects> element item. The translation of the FieldName in the ObjectSetFromObjects SHALL be added to the [children] or [attributes] of the <fromObjects> element item.

12. Translation of Information From Objects

If a ReferencedObjects instance is a DefinedObject (not a DummyReference), then the translation of the ReferencedObjects instance is the translation of the DefinedObject. If a ReferencedObjects instance is a DefinedObjectSet (not a DummyReference), then the translation of the ReferencedObjects instance is the translation of the DefinedObjectSet. If a ReferencedObjects instance is a DummyReference, ParameterizedObject, or ParameterizedObjectSet, then the translation of the ReferencedObjects instance is the translation of that DummyReference, ParameterizedObject, or ParameterizedObjectSet (see Section 13). Aside: The in-line expansion of a ParameterizedObject or ParameterizedObjectSet results in an Object or ObjectSet, respectively. A ReferencedObjects instance that is an Object or ObjectSet is a notational capability that does not exist in ASN.1, but is allowed in ASN.X to avoid the need to manufacture a reference name for an expanded parameterized definition.

13. Translation of Parameterized Definitions

The translation of an ASN.1 specification into ASN.X replaces any DummyReference [X.683] or reference to a parameterized definition [X.683] with the definition expanded in-line (except for a special case involving recursive parameterized types). For example, a ParameterizedObject is replaced by the Object on the right-hand side of the referenced ParameterizedObjectAssignment.
Top   ToC   RFC4912 - Page 84
   The definition that substitutes for a DummyReference or parameterized
   reference (e.g., the Object that substitutes for a
   ParameterizedObject) potentially comes from a different module from
   the reference.  Expanding a DummyReference or parameterized reference
   in-line puts the substitute definition into the context of the module
   containing the reference, which could therefore alter the
   interpretation of the substitute definition.

   A type definition is potentially dependent on the TagDefault and
   ExtensionDefault of the module in which it appears, and may also be
   affected by encoding instructions in an XML Encoding Rules (XER)
   [X.693] encoding control section [X.693-1].  Other kinds of
   definitions are not dependent on the module context; however, type
   definitions can be nested within the other kinds of definitions, so a
   change of context can still be significant.

      Aside: Type definitions are not dependent on their module's RXER
      or Generic String Encoding Rules (GSER) [GSER] encoding control
      section [RXEREI][GSEREI] (as they are currently defined), so the
      presence of an encoding control section for RXER or GSER is not
      significant in a change of context.

   The remainder of this section describes how and when a change of
   context is indicated in the ASN.X translation of a DummyReference or
   parameterized reference.

   In any instance of use, the module containing the DummyReference or
   parameterized reference is the referencing module, and the module
   providing the substitute definition is the referenced module.  The
   referenced and referencing modules may be the same module.

   In the case of a ParameterizedType, the substitute definition is the
   Type on the right-hand side of the referenced
   ParameterizedTypeAssignment.

   In the case of a ParameterizedValueSetType, the substitute definition
   is the constrained type on the right-hand side of the notional
   ParameterizedTypeAssignment equivalent to the referenced
   ParameterizedValueSetTypeAssignment (see Clause 15.8 of X.680
   [X.680]).

   In the case of a ParameterizedValue, the substitute definition is the
   Value on the right-hand side of the referenced
   ParameterizedValueAssignment.

   In the case of a ParameterizedObjectClass, the substitute definition
   is the ObjectClass on the right-hand side of the referenced
   ParameterizedObjectClassAssignment.
Top   ToC   RFC4912 - Page 85
   In the case of a ParameterizedObject, the substitute definition is
   the Object on the right-hand side of the referenced
   ParameterizedObjectAssignment.

   In the case of a ParameterizedObjectSet, the substitute definition is
   the ObjectSet on the right-hand side of the referenced
   ParameterizedObjectSetAssignment.

   If the ActualParameter corresponding to a DummyReference is not a
   ValueSet, then the substitute definition for that DummyReference is
   the Type, Value, DefinedObjectClass, Object, or ObjectSet in the
   ActualParameter.

   If the ActualParameter corresponding to a DummyReference is a
   ValueSet, then the substitute definition for that DummyReference is
   the notional constrained type equivalent to the ValueSet; the
   ElementSetSpecs of the ValueSet contributes to the constraint of the
   constrained type, and the governor of the Parameter corresponding to
   the ActualParameter is used as the parent type that is constrained.

   Definition (interchangeable):  The contexts of the referencing and
   referenced modules are interchangeable with respect to interpreting
   the substitute definition if:

   (1) the referenced module is the referencing module and does not
       contain an XER encoding control section, or

   (2) the referenced module and referencing module have the same
       TagDefault (where an absent TagDefault is taken to be equivalent
       to "EXPLICIT TAGS"), the referenced module and referencing module
       have the same ExtensionDefault, and neither module has an XER
       encoding control section.

      Aside: A module with an XER encoding control section is not
      considered to have a context interchangeable with another module,
      including itself, because the typereference by which a substitute
      type definition is identified may appear in a TargetList in the
      XER encoding control section of the referenced module, and because
      the in-line expansion of a substitute definition may cause its
      text to come within the scope of a TargetList in the XER encoding
      control section of the referencing module that would not apply
      otherwise.

   Definition (recursively contained):  A ParameterizedType is
   recursively contained if its translation will be nested within the
   translation (i.e., in-line expansion) of another ParameterizedType to
Top   ToC   RFC4912 - Page 86
   which it is equivalent.  A ParameterizedValueSetType is recursively
   contained if its translation will be nested within the translation of
   another ParameterizedValueSetType to which it is equivalent.

      Aside: ASN.1 does not permit the other kinds of parameterized
      reference to be recursive.

   The translation of a DummyReference, a ParameterizedType that is not
   recursively contained, a ParameterizedValue, a
   ParameterizedValueSetType that is not recursively contained, a
   ParameterizedObjectClass, a ParameterizedObject, or a
   ParameterizedObjectSet is either:

   (a) the translation of the substitute definition, or

   (b) an element item with the [local name] "type" if the substitute
       definition is a Type, "value" if the substitute definition is a
       Value, "class" if the substitute definition is an ObjectClass or
       DefinedObjectClass, "object" if the substitute definition is an
       Object, or "objectSet" if the substitute definition is an
       ObjectSet.  A fully expanded reference (described shortly) SHALL
       be added to the [children] of the element item.

   The translation in case (b) is always allowed and provides
   information to identify the referenced module and the referenced
   definition.

   The translation in case (a) MAY be used instead if and only if the
   contexts of the referencing and referenced modules are
   interchangeable, or the contexts of the referencing and referenced
   modules are not interchangeable, but the difference between them does
   not affect how the substitute definition is interpreted.

      Aside: There are many ways in which the substitute definition can
      be unaffected by a difference between the contexts of the
      referencing and referenced modules.  One example would be where
      the referencing and referenced modules differ only in their
      TagDefault, but the substitute definition does not contain any
      TaggedType notation.

   Note that if the translation in case (a) is used, then the
   referencing module is still the referencing module when considering a
   nested in-line expansion.  If the translation in case (b) is used,
   then the referenced module becomes the referencing module when
   considering a nested in-line expansion.
Top   ToC   RFC4912 - Page 87
   If case (a) is used for the translation of a DummyReference where the
   substitute definition is a Type, then an attribute form translation
   of the substitute definition SHALL NOT be used, and an attribute item
   with the [local name] "explicit" and [normalized value] "true" or "1"
   SHALL be added to the [attributes] of the <type> element item
   resulting from the translation of the substitute definition.  Where
   the automatic tagging transformation applies [X.680], this attribute
   item indicates that explicit tagging applies to the type instead of
   the usual implicit tagging.

   If case (b) is used for the translation of a DummyReference where the
   substitute definition is a Type, then an attribute item with the
   [local name] "explicit" and [normalized value] "true" or "1" SHALL be
   added to the [attributes] of the <type> element item generated by
   case (b).

   A fully expanded reference is an element item with the [local name]
   "expanded".  Except in the case of a DummyReference, the reference
   name is indicated by an attribute item with the [local name] "name"
   added to the [attributes] of the <expanded> element item.

   In the case of a ParameterizedType or ParameterizedValueSetType, the
   [normalized value] of this attribute item is the typereference of the
   ParameterizedType or ParameterizedValueSetType.

   In the case of a ParameterizedValue, the [normalized value] of this
   attribute item is the valuereference of the ParameterizedValue.

   In the case of a ParameterizedObjectClass, the [normalized value] of
   this attribute item is the objectclassreference of the
   ParameterizedObjectClass.

   In the case of a ParameterizedObject, the [normalized value] of this
   attribute item is the objectreference of the ParameterizedObject.

   In the case of a ParameterizedObjectSet, the [normalized value] of
   this attribute item is the objectsetreference of the
   ParameterizedObjectSet.

   The "name" attribute item MAY be omitted if:

   (1) the conditions permitting the use of the translation in case (a)
       are satisfied, or

   (2) the reference is not a typereference, or
Top   ToC   RFC4912 - Page 88
   (3) the reference is a typereference that does not appear in any
       TargetList in an XER encoding control section of the referenced
       module.

   The "name" attribute SHALL NOT appear in the translation of a
   DummyReference.

   The referenced module is indicated by an element item with the
   [local name] "module" added to the [children] of the <expanded>
   element item.  The <module> element item MAY be omitted if the
   conditions permitting the use of the translation in case (a) are
   satisfied, or if the referencing module is the referenced module.
   When the <module> element item is present:

   (1) An attribute item with the [local name] "name" SHOULD be added to
       the [attributes] of the <module> element item.  The
       [normalized value] of this attribute item is the modulereference
       in the ModuleIdentifier in the ModuleDefinition of the referenced
       module.

   (2) If the DefinitiveIdentifier in the ModuleIdentifier in the
       ModuleDefinition of the referenced module is not empty, then an
       attribute item with the [local name] "identifier" SHALL be added
       to the [attributes] of the <module> element item.  The
       [normalized value] of this attribute item is the RXER character
       data translation of the DefinitiveIdentifier.

   (3) If the referenced module has a schema identity URI, then an
       attribute item with the [local name] "schemaIdentity" SHALL be
       added to the [attributes] of the <module> element item.  The
       [normalized value] of this attribute item is the schema identity
       URI of the referenced module.

   The [attributes] of the <module> element item MUST contain at least
   one of the attribute items specified in cases (1), (2), and (3).

   The translation of the substitute definition SHALL be added to the
   [children] or [attributes] of the <expanded> element item.
Top   ToC   RFC4912 - Page 89
   Example

      Consider these module definitions:

         Templates
         DEFINITIONS
         AUTOMATIC TAGS ::=
         BEGIN

         CollectionOfThings { Thing } ::= SEQUENCE OF thing Thing
             -- the Thing on the right-hand side of the assignment is
             -- a DummyReference

         END

         ProtocolDefinitions
         DEFINITIONS
         AUTOMATIC TAGS ::=
         BEGIN

         IMPORTS
             CollectionOfThings{}
                 FROM Templates
             ;

         CollectionOfIntegers ::= CollectionOfThings { INTEGER }
             -- the right-hand side of the assignment is
             -- a ParameterizedType

         END

      Without using the translation in case (a), the translations of
      these modules are:

         <asnx:module name="Templates"/>

         <asnx:module xmlns:asnx="urn:ietf:params:xml:ns:asnx"
                      name="ProtocolDefinitions">

          <namedType name="CollectionOfIntegers">
           <type>
            <expanded name="CollectionOfThings">
             <module name="Templates"/>
             <type>
              <sequenceOf>
               <element name="thing">
                <type>
                 <expanded>
Top   ToC   RFC4912 - Page 90
                  <module name="ProtocolDefinitions"/>
                  <type ref="asnx:INTEGER"/>
                 </expanded>
                </type>
               </element>
              </sequenceOf>
             </type>
            </expanded>
           </type>
          </namedType>

         </asnx:module>

      The translation of the Templates module is empty because the
      module contains only a parameterized assignment.

      Since the contexts of the Templates and ProtocolDefinitions
      modules are interchangeable, a simpler translation of the
      ProtocolDefinitions module is permitted:

         <asnx:module xmlns:asnx="urn:ietf:params:xml:ns:asnx"
                      name="ProtocolDefinitions">

          <namedType name="CollectionOfIntegers">
           <type>
            <sequenceOf>
             <element name="thing">
              <type ref="asnx:INTEGER" explicit="true"/>
             </element>
            </sequenceOf>
           </type>
          </namedType>

         </asnx:module>

   If a ParameterizedType or ParameterizedValueSetType is recursively
   contained, then its translation is an element item with the
   [local name] "type".  An attribute item with the [local name]
   "ancestor" SHALL be added to the [attributes] of the <type> element
   item.  The [normalized value] of this attribute item is the decimal
   digit string representing the integer value of one plus the number of
   intermediate enclosing <type> element items between the <type>
   element items resulting from the translations of the two equivalent
   instances of ParameterizedType or ParameterizedValueSetType.  An
   element item with the [local name] "annotation" MAY be added to the
   [children] of the <type> element item.
Top   ToC   RFC4912 - Page 91
   A <type> element item with an ancestor attribute item is a reference
   to an ancestor <type> element item.  This form for a <type> element
   item SHOULD NOT be used in original specifications written in ASN.X.

      Aside: The form is only intended for the purpose of handling
      recursive parameterized type definitions in an ASN.1 specification
      being translated into ASN.X.  Such definitions are
      self-referencing, but have no obvious name.  It is also not easy
      to construct a suitable name from the surrounding context because
      recursive parameterized types can be embedded in other constructs,
      such as information objects, that are themselves unnamed.

   Example

      Consider these type definitions, assumed to be defined in a module
      that does not have an XER encoding control section:

         Tree { ValueType } ::= SEQUENCE {
             value          [0] ValueType,
             left-subtree   [1] Tree { ValueType } OPTIONAL,
             right-subtree  [2] Tree { ValueType } OPTIONAL
         }

         NumberTree ::= [APPLICATION 13] Tree { INTEGER }

      The assignment for "Tree" is not directly translated because it is
      a ParameterizedAssignment.  The translation for the "NumberTree"
      assignment, up to but not yet including the Type in the
      TaggedType, is as follows:

         <namedType name="NumberTree">
          <type>
           <tagged tagClass="application" number="13"/>
          </type>
         </namedType>

      The Type in the TaggedType is a ParameterizedType.  Since the
      ParameterizedType is not recursively contained, the translation of
      the ParameterizedType (using the translation in case (a) above) is
      the translation of the Type on the right-hand side of the
      referenced ParameterizedTypeAssignment, namely this type:

         SEQUENCE {
             value          [0] ValueType,
             left-subtree   [1] Tree { ValueType } OPTIONAL,
             right-subtree  [2] Tree { ValueType } OPTIONAL
         }
Top   ToC   RFC4912 - Page 92
      ValueType is a DummyReference.  The translation of the actual
      parameter substitutes for the DummyReference.  In this case, the
      actual parameter is the INTEGER type.

      The translation for the SEQUENCE type, up to the first component,
      is added to the <tagged> element:

         <namedType name="NumberTree">
          <type>
           <tagged tagClass="application" number="13">
            <type><!-- Tree { INTEGER } -->
             <sequence>
              <element name="value">
               <type>
                <tagged number="0">
                 <type ref="asnx:INTEGER"
                       explicit="true"/><!-- ValueType -->
                </tagged>
               </type>
              </element>
             </sequence>
            </type>
           </tagged>
          </type>
         </namedType>

      The Type in the TaggedType for the second component is a
      ParameterizedType.  Since this ParameterizedType is recursively
      contained, its translation is a <type> element with the ancestor
      attribute.  The value of the ancestor attribute is "2" because
      there is one intermediate <type> element (for a TaggedType).  Put
      another way, the translations of the equivalent instances of
      ParameterizedType are two <type> steps apart.

      The translation of the third component of the SEQUENCE type
      follows the same pattern as the second component.  The completed
      translation is as follows:

         <namedType name="NumberTree">
          <type>
           <tagged tagClass="application" number="13">
            <type><!-- Tree { INTEGER } -->
             <sequence>
              <element name="value">
               <type>
                <tagged number="0">
                 <type ref="asnx:INTEGER"
                       explicit="true"/><!-- ValueType -->
Top   ToC   RFC4912 - Page 93
                </tagged>
               </type>
              </element>
              <optional>
               <element name="left-subtree">
                <type>
                 <tagged number="1">
                  <type ancestor="2"/><!-- Tree { ValueType } -->
                 </tagged>
                </type>
               </element>
              </optional>
              <optional>
               <element name="right-subtree">
                <type>
                 <tagged number="2">
                  <type ancestor="2"/><!-- Tree { ValueType } -->
                 </tagged>
                </type>
               </element>
              </optional>
             </sequence>
            </type>
           </tagged>
          </type>
         </namedType>



(page 93 continued on part 5)

Next Section