LSLXmlNode class
An XML node in LibLSL's metadata structure.
This class represents a unified XML node that can contain both text content
and child elements, matching LibLSL's C API behavior. Unlike separate element
and text node classes, this unified approach handles both <name>value</name>
and <name><child/></name>
patterns seamlessly.
Key Features:
- Access text content via textValue getter/setter
- Access child elements via children getter
- Add child elements with addChildElement and addChildValue
- Navigate hierarchy with inherited methods from LSLXml
Example Usage:
final root = description.value;
// Add text content: <manufacturer>SCCN</manufacturer>
root.addChildValue('manufacturer', 'SCCN');
// Add container element: <channels></channels>
final channels = root.addChildElement('channels');
// Add nested structure
final channel = channels.addChildElement('channel');
channel.addChildValue('label', 'C3');
Constructors
- LSLXmlNode.fromXmlPtr(lsl_xml_ptr xmlPtr)
-
factory
Properties
-
children
→ List<
LSLXmlNode> -
Gets child elements of this element
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- name ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textValue ↔ String
-
Gets the text value of this element (if it has text content)
getter/setter pair
- xmlPtr → lsl_xml_ptr
-
The underlying LibLSL XML pointer.
finalinherited
Methods
-
addChildElement(
String name) → LSLXmlNode - Adds a child element (like <name></name>)
-
addChildValue(
String name, String value) → LSLXmlNode - Adds a child element with text content (like <name>value</name>)
-
childNamed(
String name) → LSLXmlNode? -
inherited
-
firstChild(
) → LSLXmlNode? -
inherited
-
isEmpty(
) → bool -
inherited
-
isText(
) → bool -
inherited
-
lastChild(
) → LSLXmlNode? -
inherited
-
nextSibling(
) → LSLXmlNode? -
inherited
-
nextSiblingNamed(
String name) → LSLXmlNode? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parent(
) → LSLXmlNode? -
inherited
-
previousSibling(
) → LSLXmlNode? -
inherited
-
previousSiblingNamed(
String name) → LSLXmlNode? -
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
check equality based on pointer address
override