Office.CustomXmlPrefixMappings interface
Represents a collection of CustomXmlPart objects.
Remarks
Applications: Word
Methods
add |
Asynchronously adds a prefix to namespace mapping to use when querying an item. |
add |
Asynchronously adds a prefix to namespace mapping to use when querying an item. |
get |
Asynchronously gets the namespace mapped to the specified prefix. |
get |
Asynchronously gets the namespace mapped to the specified prefix. |
get |
Asynchronously gets the prefix for the specified namespace. |
get |
Asynchronously gets the prefix for the specified namespace. |
Method Details
addNamespaceAsync(prefix, ns, options, callback)
Asynchronously adds a prefix to namespace mapping to use when querying an item.
addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<void>) => void): void;
Parameters
- prefix
-
string
Specifies the prefix to add to the prefix mapping list. Required.
- ns
-
string
Specifies the namespace URI to assign to the newly added prefix. Required.
- options
- Office.AsyncContextOptions
Provides an option for preserving context data of any type, unchanged, for use in a callback.
- callback
-
(result: Office.AsyncResult<void>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult.
Returns
void
Remarks
Requirement set: CustomXmlParts
If no namespace is assigned to the requested prefix, the method returns an empty string ("").
addNamespaceAsync(prefix, ns, callback)
Asynchronously adds a prefix to namespace mapping to use when querying an item.
addNamespaceAsync(prefix: string, ns: string, callback?: (result: AsyncResult<void>) => void): void;
Parameters
- prefix
-
string
Specifies the prefix to add to the prefix mapping list. Required.
- ns
-
string
Specifies the namespace URI to assign to the newly added prefix. Required.
- callback
-
(result: Office.AsyncResult<void>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult.
Returns
void
Remarks
Requirement set: CustomXmlParts
If no namespace is assigned to the requested prefix, the method returns an empty string ("").
getNamespaceAsync(prefix, options, callback)
Asynchronously gets the namespace mapped to the specified prefix.
getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<string>) => void): void;
Parameters
- prefix
-
string
TSpecifies the prefix to get the namespace for. Required.
- options
- Office.AsyncContextOptions
Provides an option for preserving context data of any type, unchanged, for use in a callback.
- callback
-
(result: Office.AsyncResult<string>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult. The value
property of the result is a string that contains the namespace mapped to the specified prefix.
Returns
void
Remarks
Requirement set: CustomXmlParts
If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one added or used by the data store internally, in which case it will return an error.
getNamespaceAsync(prefix, callback)
Asynchronously gets the namespace mapped to the specified prefix.
getNamespaceAsync(prefix: string, callback?: (result: AsyncResult<string>) => void): void;
Parameters
- prefix
-
string
TSpecifies the prefix to get the namespace for. Required.
- callback
-
(result: Office.AsyncResult<string>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult. The value
property of the result is a string that contains the namespace mapped to the specified prefix.
Returns
void
Remarks
Requirement set: CustomXmlParts
If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one added or used by the data store internally, in which case it will return an error.
getPrefixAsync(ns, options, callback)
Asynchronously gets the prefix for the specified namespace.
getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<string>) => void): void;
Parameters
- ns
-
string
Specifies the namespace to get the prefix for. Required.
- options
- Office.AsyncContextOptions
Provides an option for preserving context data of any type, unchanged, for use in a callback.
- callback
-
(result: Office.AsyncResult<string>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult. The value
property of the result is a string that contains the prefix of the specified namespace.
Returns
void
Remarks
Requirement set: CustomXmlParts
If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in the namespace manager, the method returns the first prefix that matches the supplied namespace.
getPrefixAsync(ns, callback)
Asynchronously gets the prefix for the specified namespace.
getPrefixAsync(ns: string, callback?: (result: AsyncResult<string>) => void): void;
Parameters
- ns
-
string
Specifies the namespace to get the prefix for. Required.
- callback
-
(result: Office.AsyncResult<string>) => void
Optional. A function that is invoked when the callback returns, whose only parameter is of type Office.AsyncResult. The value
property of the result is a string that contains the prefix of the specified namespace.
Returns
void
Remarks
Requirement set: CustomXmlParts
If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in the namespace manager, the method returns the first prefix that matches the supplied namespace.
Office Add-ins