lxml.etree.QName

Package lxml :: Module etree :: Class QName |
[hide private]
[frames] | no frames]

# Class QName

    object --+
             |
            QName

QName(text_or_uri, tag=None)

QName wrapper for qualified XML names.

Pass a tag name by itself or a namespace URI and a tag name to create a qualified name.

The `text` property holds the qualified name in `{namespace}tagname` notation. The `namespace` and `localname` properties hold the respective parts of the tag name.

You can pass QName objects wherever a tag name is expected. Also, setting Element text from a QName will resolve the namespace prefix and set a qualified text value.

Instance Methods | [hide private]
__eq__(x, y) x==y |
__ge__(x, y) x>=y |
__gt__(x, y) x>y |
__hash__(x) hash(x) |
__init__(text_or_uri, tag=None) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
__le__(x, y) x<=y |
__lt__(x, y) x<y |
__ne__(x, y) x!=y |
a new object with type S, a subtype of T |
__new__(T, S, ...) |
__str__(x) str(x) |
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
| localname
| namespace
| text
Inherited from `object`: `__class__`

Method Details | [hide private]

### __hash__(x) (Hashing function) |
hash(x) Overrides: object.__hash__

### __init__(text_or_uri, tag=None) (Constructor) |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__

### __new__(T, S, ...) |
Returns: a new object with type S, a subtype of T Overrides: object.__new__

### __str__(x) (Informal representation operator) |
str(x) Overrides: object.__str__