A document may contain several scripts in different scripting
languages. Each script is represented by a <office:script> element.
All these script elements are contained in a single <office:scripts>
element.
Scripts do not imply a scripting language or an
object model. A script can for instance operate on the Document Object Model
(DOM) composed from the XML representation of a document in OpenDocument format
(see [DOM2]), or on an application specific API.
Scripts cannot modify a document while the document is
loading. However, some events are called immediately after the document is
loaded.
In addition to <office:script>
elements, the <office:scripts> element may
also contain an <office:event-listeners> element which contains
the events assigned to the document itself. Examples for these are events
called when the document is opened or closed. See section 12.4 for more
information on the <office:event-listeners> element.
<define name="office-scripts">
<optional>
<element
name="office:scripts">
<zeroOrMore>
<ref
name="office-script"/>
</zeroOrMore>
<optional>
<ref
name="office-event-listeners"/>
</optional>
</element>
</optional>
</define>