Packagesekati.utils
Classpublic class XMLUtil

XMLUtil static class wrapping various XML and XMLList utilities.

See also

http://dispatchevent.org/roger/as3-e4x-rundown/


Public Methods
 MethodDefined by
  
XMLUtil Static Constructor
XMLUtil
  
byAttribute(x:XMLList, attr:String, value:String):XML
[static] Get the first attribute/value pair match from the XMLList.
XMLUtil
  
isValidXML(data:String):Boolean
[static] Checks whether the specified string is valid and well formed XML.
XMLUtil
Public Constants
 ConstantDefined by
  ATTRIBUTE : String = "attribute"
[static] Constant representing an attribute type returned from XML.nodeKind.
XMLUtil
  COMMENT : String = "comment"
[static] Constant representing a comment node type returned from XML.nodeKind.
XMLUtil
  ELEMENT : String = "element"
[static] Constant representing a element type returned from XML.nodeKind.
XMLUtil
  PROCESSING_INSTRUCTION : String = "processing-instruction"
[static] Constant representing a processing instruction type returned from XML.nodeKind.
XMLUtil
  TEXT : String = "text"
[static] Constant representing a text node type returned from XML.nodeKind.
XMLUtil
Constructor detail
XMLUtil()constructor
public function XMLUtil()

XMLUtil Static Constructor

Method detail
byAttribute()method
public static function byAttribute(x:XMLList, attr:String, value:String):XML

Get the first attribute/value pair match from the XMLList.

Parameters
x:XMLList
 
attr:String
 
value:String

Returns
XML

Example
    var data : XML = new XML( 'zeroonetwo' );
    trace( XMLUtil.byAttribute( data.stuff. 'id', '1' ) );
   

isValidXML()method 
public static function isValidXML(data:String):Boolean

Checks whether the specified string is valid and well formed XML.

Parameters
data:String — The string that is being checked to see if it is valid XML.

Returns
Boolean — A Boolean value indicating whether the specified string is valid XML.
Constant detail
ATTRIBUTEconstant
public static const ATTRIBUTE:String = "attribute"

Constant representing an attribute type returned from XML.nodeKind.

See also

XML.nodeKind()
COMMENTconstant 
public static const COMMENT:String = "comment"

Constant representing a comment node type returned from XML.nodeKind.

See also

XML.nodeKind()
ELEMENTconstant 
public static const ELEMENT:String = "element"

Constant representing a element type returned from XML.nodeKind.

See also

XML.nodeKind()
PROCESSING_INSTRUCTIONconstant 
public static const PROCESSING_INSTRUCTION:String = "processing-instruction"

Constant representing a processing instruction type returned from XML.nodeKind.

See also

XML.nodeKind()
TEXTconstant 
public static const TEXT:String = "text"

Constant representing a text node type returned from XML.nodeKind.

See also

XML.nodeKind()