Docs for XML

[ Python Tutorial ] [ Python Libraries ] [ web2py epydoc ]

Description


<type 'type'> extends (<class 'gluon.html.XmlComponent'>,)











use it to wrap a string that contains XML/HTML so that it will not be
escaped by the template

Examples:

>>>
XML('<h1>Hello</h1>').xml()
'<h1>Hello</h1>'


Attributes


XML.__add__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__class__ <type 'type'> extends (<type 'object'>,) belongs to class <type 'type'>
type(object) -> the object's type type(name, bases, dict) -> a new type

XML.__cmp__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__delattr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__delattr__('name') <==> del x.name

XML.__dict__ <type 'dictproxy'> belongs to class <type 'dictproxy'>

XML.__doc__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

XML.__format__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
default object formatter

XML.__getattribute__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__getattribute__('name') <==> x.name

XML.__getitem__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__getslice__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__hash__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__init__ <type 'instancemethod'> belongs to class <type 'instancemethod'>
Args: text: the XML text sanitize: sanitize text using the permitted tags and allowed attributes (default False) permitted_tags: list of permitted tags (default: simple list of tags) allowed_attributes: dictionary of allowed attributed (default for A, IMG and BlockQuote). The key is the tag; the value is a list of allowed attributes.

XML.__iter__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__len__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__module__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

XML.__mul__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__new__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
T.__new__(S, ...) -> a new object with type S, a subtype of T

XML.__radd__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__reduce__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
helper for pickle

XML.__reduce_ex__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
helper for pickle

XML.__repr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__repr__() <==> repr(x)

XML.__setattr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__setattr__('name', value) <==> x.name = value

XML.__sizeof__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
__sizeof__() -> int size of object in memory, in bytes

XML.__str__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

XML.__subclasshook__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

XML.__weakref__ <type 'getset_descriptor'> belongs to class <type 'getset_descriptor'>
list of weak references to the object (if defined)

XML.add_class <type 'instancemethod'> belongs to class <type 'instancemethod'>
add a class to _class attribute

XML.elements <type 'instancemethod'> belongs to class <type 'instancemethod'>
to be considered experimental since the behavior of this method is questionable another option could be `TAG(self.text).elements(*args,**kwargs)`

XML.flatten <type 'instancemethod'> belongs to class <type 'instancemethod'>
returns the text stored by the XML object rendered by the `render` function

XML.remove_class <type 'instancemethod'> belongs to class <type 'instancemethod'>
remove a class from _class attribute

XML.xml <type 'instancemethod'> belongs to class <type 'instancemethod'>