XML class
195
See also
XML.nodeName
,
XML.prefix
XML.namespaceURI
Availability
Flash Media Server 2.
Usage
my_xml
.namespaceURI
Description
Property (read-only); if the XML node has a prefix,
namespaceURI
is the value of the xmlns
declaration for that prefix (the URI), which is typically called the namespace URI. The xmlns
declaration is in the current node or in a node higher in the XML hierarchy.
If the XML node does not have a prefix, the value of the
namespaceURI
property depends on
whether there is a default namespace defined (as in xmlns="http://www.example.com/"). If
there is a default namespace, the value of the
namespaceURI
property is the value of the
default namespace. If there is no default namespace, the
namespaceURI
property for that
node is an empty string (
""
).
You can use the
XML.getNamespaceForPrefix()
method to identify the namespace
associated with a specific prefix. The
namespaceURI
property returns the prefix associated
with the node name.
Example
The following example shows how the
namespaceURI
property is affected by the use of
prefixes. The XML file used in the example is named SoapSample.xml and contains the
following tags:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope">
<soap:Body xmlns:w="http://www.example.com/weather">
<w:GetTemperature>
<w:City>San Francisco</w:City>
</w:GetTemperature>
</soap:Body>
</soap:Envelope>