XmlElement

Overview

XmlElement is a class in Aspose.Cells FOSS for C++.

Lightweight handle to an XML element. Default-constructed instances are null.

Methods

SignatureDescription
IsNull()bool
GetValue()std::stringGets the concatenated text of all descendant text nodes.
IsTextNode()boolReturns 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)XmlAttributeGets 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)XmlElementGets 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>)XmlElementCreates a new element with the given qualified name and no attributes or children.
MakeElement(qualifiedName: std::string)XmlElementCreates 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>)XmlElementCreates 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.

See Also