
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 255
QName object
This object encapsulates a fully qualified XML name, the combination of a local XML name and its
namespace URI.
QName object constructors
The constructor takes several forms:
new QName ()
new QName (name)
new QName (ns)
new QName (uri, name)
When no arguments are supplies, creates a QName object with an empty local name and no URI.
QName object properties
Namespace object
This object encapsulates the definition of an XML namespace. A namespace associates an XML-name
prefix with a complete URI. The prefix is a string that precedes the local name of an XML element or
attribute and identifies the namespace, while the URI points to the actual location where the definition of
the namespace is found.
For example, this XML definition contains a namespace declaration:
<?xml xmlns:adobe=http://www.adobe.com/test?>
In the corresponding namespace, the prefix is adobe, and the URI is http://www.adobe.com/test.
name
String Creates a QName object with the given local name and the URI of the default
namespace. Can be the wildcard character,
“*”.
name
QName Creates a copy of an existing QName object.
ns
Namespace Creates a QName object with an empty local name and the URI of the
Namespace object
.
uri, name
String Create a QName object with the given namespace URI and local name.
If the local name is supplied as the wildcard character,
“*”, the uri argument
is ignored, and the URI value is that of the default namespace.
name
String The local element name portion of the XML element’s fully qualified XML name.
uri
String The namespace prefix of the XML element’s fully qualified XML name.
Comentarios a estos manuales