mx.utils

# XMLUtil - AS3 Flex

Package | mx.utils
Class | public class XMLUtil
Inheritance | XMLUtil Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The XMLUtil class is an all-static class with methods for working with XML within Flex. You do not create instances of XMLUtil; instead you simply call static methods such as the `XMLUtil.qnamesEqual()` method.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | createXMLDocument(str:String):XMLDocument [static] Creates XML out of the specified string, ignoring whitespace. | XMLUtil
|  | getAttributeByQName(xml:XML, attrQName:QName):XMLList [static] Returns the XML value of an attribute matching the given QName | XMLUtil
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | qnamesEqual(qname1:QName, qname2:QName):Boolean [static] Returns true if the two QName parameters have identical uri and localName properties. | XMLUtil
|  | qnameToString(qname:QName):String [static] Returns the concatenation of a Qname object's uri and localName properties, separated by a colon. | XMLUtil
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Method Detail

### createXMLDocument

()
method

`public static function createXMLDocument(str:String):XMLDocument`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Creates XML out of the specified string, ignoring whitespace. This method is used to create objects defined in `<mx:XML>` tags and WebService requests, although they, in turn, get the `firstChild` of the structure.

Parameters

| `str:String` — XML string.

Returns

| `XMLDocument` — New XML object that ignored whitespace.

### getAttributeByQName

()
method

`public static function getAttributeByQName(xml:XML, attrQName:QName):XMLList`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns the XML value of an attribute matching the given QName

Parameters

| `xml:XML` — the XML object being inspected
| `attrQName:QName` — the QName of the attribute to find

Returns

| `XMLList` — XMLList of matching attributes or an empty list if none are found.

### qnamesEqual

()
method

`public static function qnamesEqual(qname1:QName, qname2:QName):Boolean`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns `true` if the two QName parameters have identical `uri` and `localName` properties.

Parameters

| `qname1:QName` — First QName object.
| `qname2:QName` — Second QName object.

Returns

| `Boolean` — `true` if the two QName parameters have identical `uri` and `localName` properties.

### qnameToString

()
method

`public static function qnameToString(qname:QName):String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns the concatenation of a Qname object's `uri` and `localName` properties, separated by a colon. If the object does not have a `uri` property, or the value of `uri` is the empty string, returns the `localName` property.

Parameters

| `qname:QName` — QName object.

Returns

| `String` — Concatenation of a Qname object's `uri` and `localName` properties, separated by a colon.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00