XEP 0122¶
- class slixmpp.plugins.xep_0122.XEP_0122(xmpp, config=None)[source]¶
XEP-0122: Data Forms
- stanza = <module 'slixmpp.plugins.xep_0004.stanza' from '/home/docs/checkouts/readthedocs.org/user_builds/slixmpp/checkouts/slix-1.7.1/slixmpp/plugins/xep_0004/stanza/__init__.py'>¶
Stanza elements¶
- class slixmpp.plugins.xep_0122.stanza.FormValidation(xml=None, parent=None)[source]¶
Validation values for form fields.
Example:
<field var='evt.date' type='text-single' label='Event Date/Time'> <validate xmlns='http://jabber.org/protocol/xdata-validate' datatype='xs:dateTime'/> <value>2003-10-06T11:22:00-07:00</value> </field>
Questions:
Should this look at the datatype value and convert the range values as appropriate?
Should this stanza provide a pass/fail for a value from the field, or convert field value to datatype?
- interfaces = {'basic', 'datatype', 'open', 'range', 'regex'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name = 'validate'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace = 'http://jabber.org/protocol/xdata-validate'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib = 'validate'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- plugin_attrib_map = {}¶
A mapping of the
plugin_attrib
values of registered plugins to their respective classes.
- plugin_tag_map = {}¶
A mapping of root element tag names (in
'{namespace}elementname'
format) to the plugin classes responsible for them.
- sub_interfaces = {'basic', 'open', 'range', 'regex'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.