| Package | Top Level |
| Class | public final class QName |
| Inheritance | QName Object |
null, the QName object matches any namespace.
Use the QName constructor to create a new QName object that is either a copy of another QName
object or a new QName object with a uri from a Namespace object and a
localName from a QName object.
Methods specific to E4X can use QName objects interchangeably with strings.
E4X methods are in the QName, Namespace, XML, and XMLList classes.
These E4X methods, which take a string, can also take a QName object.
This interchangeability is how namespace support works with, for example,
the XML.child() method.
This class (along with the XML, XMLList, and Namespace classes) implements powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2).
A qualified identifier evaluates to a QName object. If the QName object of an XML element is
specified without identifying a namespace, the uri
property of the associated QName object is set to the global default namespace. If the QName object of an XML
attribute is specified without identifying a namespace, the uri property is set to
an empty string.
| XML, XMLList, Namespace, ECMAScript for XML (E4X) specification (ECMA-357 edition 2) |
| Property | Defined by | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
| localName : String
[read-only]
The local name of the QName object.
| QName | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
| uri : String
[read-only]
The Uniform Resource Identifier (URI) of the QName object.
| QName | ||
| Function | Defined by | ||
|---|---|---|---|
|
Creates a QName object that is a copy of another QName object.
| QName | ||
|
Creates a QName object with a
uri from a Namespace object and a localName from a QName object. | QName | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
|
Returns a string composed of the URI, and the local name for the
QName object, separated by "::".
| QName | ||
![]() |
Returns the primitive value of the specified object.
| Object | |
localName:String [read-only] public function get localName():String
uri:String [read-only] public function get uri():String
public function QName(qname:QName)
localName property of the new QName instance.
If the parameter is undefined or unspecified, a new QName object
is created with the localName property set to the empty string.
Parameters
qname:QName — The QName object to be copied. Objects of any other type are
converted to a string that is assigned to the localName property
of the new QName object.
|
public function QName(uri:Namespace, localName:QName)
uri from a Namespace object and a localName from a QName object.
If either parameter is not the expected data type, the parameter is converted to a string and
assigned to the corresponding property of the new QName object.
For example, if both parameters are strings, a new QName object is returned with a uri property set
to the first parameter and a localName property set to the second parameter.
In other words, the following permutations, along with many others, are valid forms of the constructor:
QName (uri:Namespace, localName:String); QName (uri:String, localName: QName); QName (uri:String, localName: String);
If the parameter passed as the uri parameter is the value null,
the uri property of the new QName property is set to the value null.
uri:Namespace — A Namespace object from which to copy the uri value. A parameter of any other type is converted to a string.
|
|
localName:QName — A QName object from which to copy the localName value. A parameter of any other type is converted to a string.
|
public function toString():String
The format depends on the uri property of the QName object:
If uri == ""
toString returns localName
else if uri == null
toString returns *::localName
else
toString returns uri::localName
String —
The qualified name, as a string.
|