Class Jabber::Protocol::XMLElement
In: lib/jabber4r/protocol.rb
Parent: Object

Utility class to create valid XML strings

Methods

Attributes

parent  [RW]  The parent XMLElement

Public Class methods

Construct an XMLElement for the supplied tag and attributes

tag:[String] XML tag
attributes:[Hash = {}] The attribute hash[attribute]=value

Public Instance methods

Adds an attribute to this element

attrib:[String] The attribute name
value:[String] The attribute value
return:[Jabber::Protocol::XMLElement] self for chaining

Adds cdata to this element

cdata:[String] The cdata to add
return:[Jabber::Protocol::XMLElement] self for chaining

Adds a child to this element of the supplied tag

tag:[String] The element tag
attributes:[Hash = {}] The attributes hash[attribute]=value
return:[Jabber::Protocol::XMLElement] newly created child element

Adds data to this element

data:[String] The data to add
return:[Jabber::Protocol::XMLElement] self for chaining

Adds arbitrary XML data to this object

xml:[String] the xml to add

Sets the namespace for this tag

ns:[String] The namespace
return:[Jabber::Protocol::XMLElement] self for chaining

Returns the parent element

return:[Jabber::Protocol::XMLElement] The parent XMLElement

Climbs to the top of this elements parent tree and then returns the to_xml XML string.

return:[String] The XML string of this element (from the topmost parent).

Recursively builds the XML string by traversing this element‘s children.

format:[Boolean] True to pretty-print (format) the output string
indent:[Integer = 0] The indent level (recursively more)

[Validate]