All Bundles
XmlElement
Represents an XML element
Operations
New
Constructor
New(type:XmlElement->Type, name:String)
Parameters
Constructor
New(type:XmlElement->Type, name:String, content:String)
Parameters
Constructor
New(type:XmlElement->Type, name:String, attribs:Hash<String,XmlAttribute>, content:String)
Parameters
AddAttribute
Adds an element attribute
method : public : AddAttribute(attrib:XmlAttribute) ~ Nil
Parameters
AddChild
Adds an XML subelement tag
method : public : AddChild(tag:XmlElement) ~ Nil
Parameters
DecodeString
Decodes an XML string
function : DecodeString(in:String) ~ String
Parameters
Name | Type | Description |
---|
in | String | string to decode |
Return
Type | Description |
---|
String | decoded string |
EncodeString
Encodes an XML string
function : EncodeString(in:String) ~ String
Parameters
Name | Type | Description |
---|
in | String | string to encode |
Return
Type | Description |
---|
String | encoded string |
FindElements
Finds matching XML elements using xpath like syntax. Supports 'first()', 'last()' and '[cdata]' functions.
method : public : FindElements(path:String) ~ Vector<XmlElement>
Parameters
Name | Type | Description |
---|
path | String | search string |
Return
Get
Gets a child element
method : public : Get(i:Int) ~ XmlElement
Parameters
Name | Type | Description |
---|
i | Int | child index |
Return
Type | Description |
---|
XmlElement | child element, Nil if not found |
GetAttribute
Gets an element attribute
method : public : GetAttribute(key:String) ~ XmlAttribute
Parameters
Name | Type | Description |
---|
key | String | attribute name |
Return
GetChildren
Get all child elements that matchs the given filter
method : public : native : GetChildren(name:String) ~ Vector<XmlElement>
Parameters
Name | Type | Description |
---|
name | String | element name |
Return
Get all child elements that matchs the given filter
method : public : native : GetChildren(name:String, attrib:String) ~ Vector<XmlElement>
Parameters
Name | Type | Description |
---|
name | String | element name |
attrib | String | attrib name |
Return
Get all child elements that matchs the given filter
method : public : native : GetChildren(name:String, max:Int) ~ Vector<XmlElement>
Parameters
Name | Type | Description |
---|
name | String | element name |
max | Int | max number of elements to return |
Return
Get all children
method : public : GetChildren() ~ Vector<XmlElement>
Return
GetContent
Gets the element content
method : public : GetContent() ~ String
Return
Type | Description |
---|
String | element content |
GetFirstChild
Get the first element that matchs the given filter
method : public : native : GetFirstChild(name:String) ~ XmlElement
Parameters
Name | Type | Description |
---|
name | String | element name |
Return
Type | Description |
---|
XmlElement | first match, Nil otherwise |
GetLastChild
Get the last element that matchs the given filter
method : public : native : GetLastChild(name:String) ~ XmlElement
Parameters
Name | Type | Description |
---|
name | String | element name |
Return
Type | Description |
---|
XmlElement | last match, Nil otherwise |
GetName
Gets the element name
method : public : GetName() ~ String
Return
Type | Description |
---|
String | element name |
GetNamespace
Gets the element namespace
method : public : GetNamespace() ~ String
Return
Type | Description |
---|
String | element namespace |
GetParent
Gets a child's parent element
method : public : GetParent() ~ XmlElement
Return
GetType
Gets the element type
method : public : GetType() ~ XmlElement->Type
Return
SetContent
Sets the element content
method : public : SetContent(content:String) ~ Nil
Parameters
Name | Type | Description |
---|
content | String | element content |
SetName
Sets the element name
method : public : SetName(name:String) ~ Nil
Parameters
Name | Type | Description |
---|
name | String | element name |
SetNamespace
Sets the element namespace
method : public : SetNamespace(namespace:String) ~ Nil
Parameters
Name | Type | Description |
---|
namespace | String | element namespace |
SetParent
Set a child's parent element
method : public : SetParent(parent:XmlElement) ~ Nil
Parameters
SetType
Sets the element type
method : public : SetType(type:XmlElement->Type) ~ Nil
Parameters
Size
Get the number of child elements
method : public : Size() ~ Int
Return
Type | Description |
---|
Int | number of child elements |
ToString
Creates a string representation of the element
method : public : ToString() ~ String
Return
Type | Description |
---|
String | string representation of the element |