Поделиться через


VTArray Class

Array.When the object is serialized out as xml, its qualified name is vt:array.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.VariantTypes.VTArray

Namespace:  DocumentFormat.OpenXml.VariantTypes
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(VTShort))> _
<ChildElementInfoAttribute(GetType(VTBool))> _
<ChildElementInfoAttribute(GetType(VTError))> _
<ChildElementInfoAttribute(GetType(VTUnsignedInt32))> _
<ChildElementInfoAttribute(GetType(Variant))> _
<ChildElementInfoAttribute(GetType(VTByte))> _
<ChildElementInfoAttribute(GetType(VTInt32))> _
<ChildElementInfoAttribute(GetType(VTInteger))> _
<ChildElementInfoAttribute(GetType(VTUnsignedByte))> _
<ChildElementInfoAttribute(GetType(VTUnsignedShort))> _
<ChildElementInfoAttribute(GetType(VTUnsignedInteger))> _
<ChildElementInfoAttribute(GetType(VTFloat))> _
<ChildElementInfoAttribute(GetType(VTDouble))> _
<ChildElementInfoAttribute(GetType(VTDecimal))> _
<ChildElementInfoAttribute(GetType(VTBString))> _
<ChildElementInfoAttribute(GetType(VTDate))> _
<ChildElementInfoAttribute(GetType(VTCurrency))> _
Public Class VTArray _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As VTArray
[ChildElementInfoAttribute(typeof(VTShort))]
[ChildElementInfoAttribute(typeof(VTBool))]
[ChildElementInfoAttribute(typeof(VTError))]
[ChildElementInfoAttribute(typeof(VTUnsignedInt32))]
[ChildElementInfoAttribute(typeof(Variant))]
[ChildElementInfoAttribute(typeof(VTByte))]
[ChildElementInfoAttribute(typeof(VTInt32))]
[ChildElementInfoAttribute(typeof(VTInteger))]
[ChildElementInfoAttribute(typeof(VTUnsignedByte))]
[ChildElementInfoAttribute(typeof(VTUnsignedShort))]
[ChildElementInfoAttribute(typeof(VTUnsignedInteger))]
[ChildElementInfoAttribute(typeof(VTFloat))]
[ChildElementInfoAttribute(typeof(VTDouble))]
[ChildElementInfoAttribute(typeof(VTDecimal))]
[ChildElementInfoAttribute(typeof(VTBString))]
[ChildElementInfoAttribute(typeof(VTDate))]
[ChildElementInfoAttribute(typeof(VTCurrency))]
public class VTArray : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • Variant <vt:variant>

  • VTByte <vt:i1>

  • VTShort <vt:i2>

  • VTInt32 <vt:i4>

  • VTInteger <vt:int>

  • VTUnsignedByte <vt:ui1>

  • VTUnsignedShort <vt:ui2>

  • VTUnsignedInt32 <vt:ui4>

  • VTUnsignedInteger <vt:uint>

  • VTFloat <vt:r4>

  • VTDouble <vt:r8>

  • VTDecimal <vt:decimal>

  • VTBString <vt:bstr>

  • VTDate <vt:date>

  • VTBool <vt:bool>

  • VTError <vt:error>

  • VTCurrency <vt:cy>

[ISO/IEC 29500-1 1st Edition]

22.4.2.1 array (Array)

The array element defines the array variant type. Array contents shall be of uniform type as specified by the baseType attribute. The contents of an array are defined using repeated child elements of the appropriate variant type.

Multi-dimensional arrays can be defined by specifying the length of each dimension in the lBound and uBound attributes through the use of the "," delimiter. Child elements of multi-dimensional arrays are indexed along each dimension in the order the dimensions are declared.

In other words, the array shall be filled as follows:

  • The first index shall be incremented to its maximum value [Example: [0,0,0] to [max,0,0] end example]

  • The second index shall be incremented to its maximum value [Example: [0,1,0] to [0,max,0] end example]

  • Subsequent indices shall be filled until all provided values have been added

  • All other values shall have null values within the array (i.e. no default value shall be assumed).

[Example: A 2x3 variant type array of type "i4" is specified as follows:

<vt:array lBounds="0,0" uBounds="1,2" baseType="i4">
<vt:i4>0</vt:i4>
<vt:i4>1</vt:i4>
<vt:i4>2</vt:i4>
<vt:i4>3</vt:i4>
<vt:i4>4</vt:i4>
</vt:array>

The resulting array: [0,0] = 0, [1,0] = 1, [0,1] = 2, [1,1] = 3, [0,2] = 4. end example]

Parent Elements

property (§22.3.2.2); variant (§22.4.2.32)

Child Elements

Subclause

bool (Boolean)

§22.4.2.3

bstr (Basic String)

§22.4.2.4

cy (Currency)

§22.4.2.6

date (Date and Time)

§22.4.2.7

decimal (Decimal)

§22.4.2.8

error (Error Status Code)

§22.4.2.10

i1 (1-Byte Signed Integer)

§22.4.2.12

i2 (2-Byte Signed Integer)

§22.4.2.13

i4 (4-Byte Signed Integer)

§22.4.2.14

int (Integer)

§22.4.2.16

r4 (4-Byte Real Number)

§22.4.2.23

r8 (8-Byte Real Number)

§22.4.2.24

ui1 (1-Byte Unsigned Integer)

§22.4.2.27

ui2 (2-Byte Unsigned Integer)

§22.4.2.28

ui4 (4-Byte Unsigned Integer)

§22.4.2.29

uint (Unsigned Integer)

§22.4.2.31

variant (Variant)

§22.4.2.32

Attributes

Description

baseType (Array Base Type)

The baseType attribute specifies the base variant type of an array.

The allowed values are: variant, i1, i2, i4, int, ui1, ui2, ui4, uint, r4, r8, decimal, bstr, date, bool, cy, and error.

The possible values for this attribute are defined by the ST_ArrayBaseType simple type (§22.4.3.1).

lBounds (Array Lower Bounds Attribute)

The lBounds attribute specifies the lower bound of an array in the format: #, #, # … # where each # represents an integer.

The possible values for this attribute are defined by the W3C XML Schema int datatype.

uBounds (Array Upper Bounds Attribute)

The uBounds attribute specifies the upper bound of an array in the format: #, #, # … # where each # represents an integer.

The possible values for this attribute are defined by the W3C XML Schema int datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_Array) is located in §A.6.4. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

VTArray Members

DocumentFormat.OpenXml.VariantTypes Namespace