XmlElement
Overview
XmlElement is a class in Aspose.Cells FOSS for C++.
Lightweight handle to an XML element. Default-constructed instances are null.
Methods
| Signature | Description |
|---|---|
IsNull() → bool | |
GetValue() → std::string | Gets the concatenated text of all descendant text nodes. |
IsTextNode() → bool | Returns true if this node represents a text node rather than an element. |
GetAttributes() → std::vector<std::pair<std::string, std::string>> | Gets all attributes as local-name/value pairs. |
GetChildNodes() → std::vector<XmlElement> | Gets all direct child nodes (elements and text nodes). |
GetAttribute(localName: std::string_view) → XmlAttribute | Gets an attribute by local name. Returns a null XmlAttribute if not found. |
GetElements(qualifiedName: std::string_view) → std::vector<XmlElement> | Gets all direct child elements with the given qualified name. |
GetElement(qualifiedName: std::string_view) → XmlElement | Gets the first direct child element with the given qualified name. |
GetDescendantsAndSelf() → std::vector<XmlElement> | Gets all descendant elements including self, in document order. |
MakeElement(node: std::shared_ptr<XmlNodeData>) → XmlElement | Creates a new element with the given qualified name and no attributes or children. |
MakeElement(qualifiedName: std::string) → XmlElement | Creates a new element with the given qualified name and no attributes or children. |
MakeElement(qualifiedName: std::string, attributes: std::vector<std::pair<std::string, std::string>>, children: std::vector<XmlElement>) → XmlElement | Creates a new element with the given qualified name and no attributes or children. |
AddChild(child: XmlElement) | Adds a child element to this element. |
AddChild(child: XmlElement) | Adds a child element to this element. |
SetAttribute(localName: std::string_view, value: std::string) | Sets an attribute value, adding it if absent or updating if present. |