Because a large number of local elements, and most attributes, have no
namespace associated with them, this is optimized for representing names
with an absent namespace. The hash and equality test methods are set so
that a plain string is equivalent to a tuple of None
and
that string.
Note that absent namespaces can be represented in two ways: with a
namespace of None
(the name "has no namespace"),
and with a namespace that is an absent namespace (the name "has an absent
namespace"). Hash code calculations are done so that the two
alternatives produce the same hash; however, comparison is done so that
the two are distinguished. The latter is the intended behavior; the
former should not be counted upon.
This class allows direct lookup of the named object within a category
by using the category name as an accessor function. That is, if the
namespace of the expanded name en
has a category
'typeDefinition', then the following two expressions are equivalent:
|
|
|
namespaceURI(self)
Return the URI of the namespace, or None if the
namespace is absent. |
source code
|
|
|
localName(self)
The local part of the expanded name. |
source code
|
|
|
validateComponentModel(self)
Pass model validation through to namespace part. |
source code
|
|
|
|
|
|
|
|
|
adoptName(self,
name)
Return the input name, except if the input name has no namespace,
return a name that uses the namespace from this name with the local
name from the input name. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAttribute(self,
dom_node)
Return the value of the attribute identified by this name in the
given node. |
source code
|
|
|
nodeMatches(self,
dom_node)
Return True iff the dom node expanded name matches this
expanded name. |
source code
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|