Edit

Share via


Word.Interfaces.XmlNodeData interface

An interface describing the data returned by calling xmlNode.toJSON().

Properties

baseName

Gets the name of the element without any prefix.

hasChildNodes

Gets whether this XML node has child nodes. Always returns false for attribute nodes since they cannot have children.

level

Gets whether this XML element is part of a paragraph, is a paragraph, or is contained within a table cell or contains a table row. Returns null if the node type is attribute.

namespaceUri

Gets the Uniform Resource Identifier (URI) of the schema namespace for this XML node.

nodeType

Gets the type of node.

nodeValue

Specifies the value of this XML node. For element nodes, represents the text content; for attribute nodes, represents the attribute value.

placeholderText

Specifies the text displayed for this element if it contains no text. Only applies to element nodes, not attribute nodes.

text

Specifies the text contained within the XML element. Returns an empty string if the node type is attribute.

validationErrorText

Gets the description for a validation error on this XmlNode object. May not be meaningful for attribute nodes.

validationStatus

Gets whether this element is valid according to the attached schema. May not be meaningful for attribute nodes.

Property Details

baseName

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the name of the element without any prefix.

baseName?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

hasChildNodes

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets whether this XML node has child nodes. Always returns false for attribute nodes since they cannot have children.

hasChildNodes?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

level

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets whether this XML element is part of a paragraph, is a paragraph, or is contained within a table cell or contains a table row. Returns null if the node type is attribute.

level?: Word.XmlNodeLevel | "Inline" | "Paragraph" | "Row" | "Cell";

Property Value

Word.XmlNodeLevel | "Inline" | "Paragraph" | "Row" | "Cell"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

namespaceUri

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the Uniform Resource Identifier (URI) of the schema namespace for this XML node.

namespaceUri?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

nodeType

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the type of node.

nodeType?: Word.XmlNodeType | "Element" | "Attribute";

Property Value

Word.XmlNodeType | "Element" | "Attribute"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

nodeValue

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the value of this XML node. For element nodes, represents the text content; for attribute nodes, represents the attribute value.

nodeValue?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

placeholderText

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the text displayed for this element if it contains no text. Only applies to element nodes, not attribute nodes.

placeholderText?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

text

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the text contained within the XML element. Returns an empty string if the node type is attribute.

text?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

validationErrorText

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the description for a validation error on this XmlNode object. May not be meaningful for attribute nodes.

validationErrorText?: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

validationStatus

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets whether this element is valid according to the attached schema. May not be meaningful for attribute nodes.

validationStatus?: Word.XmlValidationStatus | "Ok" | "Custom";

Property Value

Word.XmlValidationStatus | "Ok" | "Custom"

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]