CustomXmlPartCollection Object (JavaScript API for Excel)

A collection of custom XML parts.

Properties

Property Type Description Req. Set
items CustomXmlPart[] A collection of customXmlPart objects. Read-only. 1.5

See property access examples.

Relationships

None

Methods

Method Return Type Description Req. Set
add(xml: string) CustomXmlPart Adds a new custom XML part to the workbook. 1.5
getByNamespace(namespaceUri: string) CustomXmlPartScopedCollection Gets a new scoped collection of custom XML parts whose namespaces match the given namespace. 1.5
getCount() int Gets the number of CustomXml parts in the collection. 1.5
getItem(id: string) CustomXmlPart Gets a custom XML part based on its ID. 1.5
getItemOrNullObject(id: string) CustomXmlPart Gets a custom XML part based on its ID. 1.5

Method Details

add(xml: string)

Adds a new custom XML part to the workbook.

Syntax

customXmlPartCollectionObject.add(xml);

Parameters

Parameter Type Description
xml string XML content. Must be a valid XML fragment.

Returns

CustomXmlPart

getByNamespace(namespaceUri: string)

Gets a new scoped collection of custom XML parts whose namespaces match the given namespace.

Syntax

customXmlPartCollectionObject.getByNamespace(namespaceUri);

Parameters

Parameter Type Description
namespaceUri string This must be a fully qualified schema URI; for example, "http://schemas.contoso.com/review/1.0"

Returns

CustomXmlPartScopedCollection

getCount()

Gets the number of CustomXml parts in the collection.

Syntax

customXmlPartCollectionObject.getCount();

Parameters

None

Returns

int

getItem(id: string)

Gets a custom XML part based on its ID.

Syntax

customXmlPartCollectionObject.getItem(id);

Parameters

Parameter Type Description
id string ID of the object to be retrieved.

Returns

CustomXmlPart

getItemOrNullObject(id: string)

Gets a custom XML part based on its ID.

Syntax

customXmlPartCollectionObject.getItemOrNullObject(id);

Parameters

Parameter Type Description
id string ID of the object to be retrieved.

Returns

CustomXmlPart