Struct liblsl.XMLElement
A lightweight XML element tree; models the Desc() field of liblsl.StreamInfo.
Has a name and can have multiple named children or have text content as value; attributes are omitted. Insider note: The interface is modeled after a subset of pugixml's node type and is compatible with it.
Namespace: LSL4Unity
Assembly: cs.temp.dll.dll
Syntax
public struct XMLElement
Remarks
Constructors
XMLElement(IntPtr)
Initializes a new instance of liblsl.XMLElement struct.
Declaration
public XMLElement(IntPtr handle)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | handle | The handle. |
Methods
AppendChild(String)
Append a child element with the specified name.
Declaration
public liblsl.XMLElement AppendChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
AppendChildValue(String, String)
Append a child node with a given name, which has a (nameless) plain-text child with the given text value.
Declaration
public liblsl.XMLElement AppendChildValue(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
String | value | The child value. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
AppendCopy(liblsl.XMLElement)
Append a copy of the specified element as a child.
Declaration
public liblsl.XMLElement AppendCopy(liblsl.XMLElement e)
Parameters
Type | Name | Description |
---|---|---|
liblsl.XMLElement | e | The element to copy. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
Child(String)
Get a child with a specified name.
Declaration
public liblsl.XMLElement Child(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
ChildValue()
Get child value (value of the first child that is text).
Declaration
public string ChildValue()
Returns
Type | Description |
---|---|
String | the child value as |
ChildValue(String)
Get child value of a child with a specified name.
Declaration
public string ChildValue(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
Returns
Type | Description |
---|---|
String | the child value as |
Empty()
Whether this node is empty.
Declaration
public bool Empty()
Returns
Type | Description |
---|---|
Boolean |
|
FirstChild()
Get the first child of the element.
Declaration
public liblsl.XMLElement FirstChild()
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
IsText()
Whether this is a text body (instead of an XML element). True both for plain char data and CData.
Declaration
public bool IsText()
Returns
Type | Description |
---|---|
Boolean |
|
LastChild()
Get the last child of the element.
Declaration
public liblsl.XMLElement LastChild()
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
Name()
Name of the element.
Declaration
public string Name()
Returns
Type | Description |
---|---|
String | the name as |
NextSibling()
Get the next sibling in the children list of the parent node.
Declaration
public liblsl.XMLElement NextSibling()
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
NextSibling(String)
Get the next sibling with the specified name.
Declaration
public liblsl.XMLElement NextSibling(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The next sibling name. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
Parent()
Get the parent node.
Declaration
public liblsl.XMLElement Parent()
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
PrependChild(String)
Prepend a child element with the specified name.
Declaration
public liblsl.XMLElement PrependChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
PrependChildValue(String, String)
Prepend a child node with a given name, which has a (nameless) plain-text child with the given text value.
Declaration
public liblsl.XMLElement PrependChildValue(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
String | value | The child value. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
PrependCopy(liblsl.XMLElement)
Prepend a child element with the specified name.
Declaration
public liblsl.XMLElement PrependCopy(liblsl.XMLElement e)
Parameters
Type | Name | Description |
---|---|---|
liblsl.XMLElement | e | The element to copy. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
PreviousSibling()
Get the previous sibling in the children list of the parent node.
Declaration
public liblsl.XMLElement PreviousSibling()
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
PreviousSibling(String)
Get the previous sibling with the specified name.
Declaration
public liblsl.XMLElement PreviousSibling(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The previous sibling name. |
Returns
Type | Description |
---|---|
liblsl.XMLElement | New liblsl.XMLElement. |
RemoveChild(liblsl.XMLElement)
Remove a specified child element.
Declaration
public void RemoveChild(liblsl.XMLElement e)
Parameters
Type | Name | Description |
---|---|---|
liblsl.XMLElement | e | The element to remove. |
RemoveChild(String)
Remove a child element with the specified name.
Declaration
public void RemoveChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
SetChildValue(String, String)
Set the text value of the (nameless) plain-text child of a named child node.
Declaration
public bool SetChildValue(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The child name. |
String | value | The child value. |
Returns
Type | Description |
---|---|
Boolean | True if the wait was successful, false otherwise. |
SetName(String)
Set the element's name.
Declaration
public bool SetName(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name. |
Returns
Type | Description |
---|---|
Boolean |
|
SetValue(String)
Set the element's value.
Declaration
public bool SetValue(string value)
Parameters
Type | Name | Description |
---|---|---|
String | value | The new value. |
Returns
Type | Description |
---|---|
Boolean |
|
Value()
Value of the element.
Declaration
public string Value()
Returns
Type | Description |
---|---|
String | the value as |