Package genshi :: Module core :: Class QName

Class QName



object --+        
         |        
basestring --+    
             |    
       unicode --+
                 |
                QName

A qualified element or attribute name.

The unicode value of instances of this class contains the qualified name of the element or attribute, in the form {namespace}localname. The namespace URI can be obtained through the additional namespace attribute, while the local name can be accessed through the localname attribute.

>>> qname = QName('foo')
>>> qname
QName(u'foo')
>>> qname.localname
u'foo'
>>> qname.namespace
>>> qname = QName('http://www.w3.org/1999/xhtml}body')
>>> qname
QName(u'http://www.w3.org/1999/xhtml}body')
>>> qname.localname
u'body'
>>> qname.namespace
u'http://www.w3.org/1999/xhtml'


Instance Methods
 
__getnewargs__(self)
 
__repr__(self)
repr(x)

Inherited from unicode: __add__, __cmp__, __contains__, __getattribute__, __getitem__, __getslice__, __hash__, __len__, __mod__, __mul__, __rmod__, __rmul__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, index, isalnum, isalpha, isdecimal, isdigit, islower, isnumeric, isspace, istitle, isupper, join, ljust, lower, lstrip, replace, rfind, rindex, rjust, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__

Static Methods
 
__new__(cls, qname)
Returns: a new object with type S, a subtype of T
Properties
  localname
  namespace

Inherited from object: __class__

Method Details

__new__(cls, qname)
Static Method

 
Returns:
a new object with type S, a subtype of T

Overrides: unicode.__new__
(inherited documentation)

__getnewargs__(self)

 
Overrides: unicode.__getnewargs__

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: unicode.__repr__
(inherited documentation)