Package web2py :: Package gluon :: Module html :: Class XML
[hide private]
[frames] | no frames]

Class XML

source code

  object --+    
           |    
XmlComponent --+
               |
              XML

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

example:

>>> XML('<h1>Hello</h1>').xml()
'<h1>Hello</h1>'
Instance Methods [hide private]
 
__init__(self, text, sanitize=False, permitted_tags=['a', 'b', 'blockquote', 'br/', 'i', 'li', 'ol', 'ul', 'p', 'c..., allowed_attributes={'a': ['href', 'title'], 'blockquote': ['type'], 'img': ['src'...)
:param text: the XML text :param sanitize: sanitize text using the permitted tags and allowed attributes (default False) :param permitted_tags: list of permitted tags (default: simple list of tags) :param allowed_attributes: dictionary of allowed attributed (default for A, IMG and BlockQuote).
source code
 
xml(self) source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, text, sanitize=False, permitted_tags=['a', 'b', 'blockquote', 'br/', 'i', 'li', 'ol', 'ul', 'p', 'c..., allowed_attributes={'a': ['href', 'title'], 'blockquote': ['type'], 'img': ['src'...)
(Constructor)

source code 

:param text: the XML text
:param sanitize: sanitize text using the permitted tags and allowed
    attributes (default False)
:param permitted_tags: list of permitted tags (default: simple list of
    tags)
:param 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.

Overrides: object.__init__

xml(self)

source code 
Overrides: XmlComponent.xml

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)