= Attaching To Events = == Statically in RML == The easiest way to attach to events with python is to write your code directly into the RML files, using the on* attributes. When the event is fired three global variables are set up, ''document'', ''event'' and ''self''. ||self||The element thats currently being processed|| ||[wiki:documentation/PythonManual/Documents document]||The document the element thats currently being processed belongs to|| ||[wiki:documentation/PythonManual/Events event]||The event thats currently being processed|| Example: {{{