Packageorg.igniterealtime.xiff.data
Classpublic class XMLStanza
InheritanceXMLStanza Inheritance ExtensionContainer Inheritance Object
Implements IXMLStanza
Subclasses BookmarkPrivatePayload, BrowseItem, DiscoFeature, DiscoIdentity, DiscoItem, Extension, Fill, FormField, FormItem, FormReported, GroupChatBookmark, MUCItem, MUCStatus, Path, RosterItem, SearchItem, Stroke, UrlBookmark, XMPPStanza

This is a base class for all classes that encapsulate XML stanza data. It provides a set of methods that faciliate easy manipulation of XML data.



Public Properties
 PropertyDefined By
 Inheritedxml : XML
The XML node that should be used for this stanza's internal XML representation, base of the XMLStanza, XML element.
ExtensionContainer
Public Methods
 MethodDefined By
  
XMPP is based on communication with XML stanzas
XMLStanza
 Inherited
Add extension to the list of the given namespace and insert to the XML element as a child.
ExtensionContainer
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(nameSpace:String):Array
ExtensionContainer
  
getAttribute(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
  
getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML.
XMLStanza
  
getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML.
XMLStanza
 Inherited
getExtension(elementName:String):IExtension
Get the extension having the given element name.
ExtensionContainer
  
getField(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
removeAllExtensions(nameSpace:String):void
ExtensionContainer
 Inherited
removeExtension(extension:IExtension):Boolean
ExtensionContainer
  
removeFields(name:String):void
Helper method for removing all child elements that have the given name.
XMLStanza
  
setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
  
setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML.
XMLStanza
  
setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML.
XMLStanza
  
setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
  
toString():String
Converts the base stanza XML to a string.
XMLStanza
Public Constants
 ConstantDefined By
  DEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
  FLASH_NS : Namespace
[static]
XMLStanza
  STREAM_NS : Namespace
[static]
XMLStanza
Constructor Detail
XMLStanza()Constructor
public function XMLStanza()

XMPP is based on communication with XML stanzas

Method Detail
getAttribute()method
public function getAttribute(name:String):String

Convinience method for getting element value from the XML.

Parameters

name:String

Returns
String
getChildAttribute()method 
public function getChildAttribute(elem:String, name:String):String

Convinience method for getting child element attribute value from the XML.

Parameters

elem:String
 
name:String

Returns
String
getChildField()method 
public function getChildField(elem:String, name:String):String

Convinience method for getting child element value from the XML.

Might seem over complex, but AS3 seems to handle different kind of XML differently, thus shorthands and even methods such as localName() do not work as expected.

Parameters

elem:String
 
name:String

Returns
String
getField()method 
public function getField(name:String):String

Convinience method for getting element value from the XML.

Might seem over complex, but AS3 seems to handle different kind of XML differently, thus shorthands and even methods such as localName() do not work as expected.

Parameters

name:String

Returns
String
removeFields()method 
public function removeFields(name:String):void

Helper method for removing all child elements that have the given name.

Parameters

name:String

setAttribute()method 
public function setAttribute(name:String, value:String):void

Convinience method for setting a value to a element in the XML.

Parameters

name:String
 
value:String

setChildAttribute()method 
public function setChildAttribute(elem:String, name:String, value:String):void

Convinience method for setting an attribute for a child element of the XML.

In case the child element does not exist, it will be created.

Parameters

elem:String
 
name:String
 
value:String

setChildField()method 
public function setChildField(elem:String, name:String, value:String):void

Convinience method for setting a value for a child element of the XML.

Parameters

elem:String
 
name:String
 
value:String

setField()method 
public function setField(name:String, value:String):void

Convinience method for setting a value to a element in the XML.

Parameters

name:String
 
value:String

toString()method 
public function toString():String

Converts the base stanza XML to a string.

Returns
String — The base XML in string form, as in toXMLString()
Constant Detail
DEFAULT_NSConstant
public static const DEFAULT_NS:Namespace

Default XML namespace. Must define in AS3.

See also

FLASH_NSConstant 
public static const FLASH_NS:Namespace

See also

STREAM_NSConstant 
public static const STREAM_NS:Namespace

See also