renoise.Document.DocumentNode

A document node is a sub component in a document which contains other documents or observables.


Functions

__init(self)

Base constructor, only necessary to be called in your custom class constructor, when inheriting from renoise.Document.DocumentNode.

add_properties(self, properties : ObservableProperties)

Add a batch of properties in one go, similar to renoise.Document.create.

add_property(self, name : string, value : renoise.Document.DocumentNode)

->renoise.Document.DocumentNode

Add a new property. Name must be unique: overwriting already existing properties with the same name is not allowed and will fire an error. If you want to replace a property, remove it first, then add it again.

from_string(self, string : string)

->success : boolean, error : string?

Parse document tree from the given string data. See renoise.Document.DocumentNode:load_from for details about how properties are parsed and errors are handled.

has_property(self, property_name : string)

->boolean

Check if the given property exists.

load_from(self, file_name : string)

->success : boolean, error : string?

Load the document tree from an XML file. This will NOT create new properties, except for list items, but will only assign existing property values in the document node with existing property values from the XML. This means: nodes that only exist in the XML will silently be ignored. Nodes that only exist in the document, will not be altered in any way. The loaded document's type must match the document type that saved the XML data. A document's type is specified in the renoise.Document.create() function as "model_name". For classes which inherit from renoise.Document.DocumentNode it's the class name.

property(self, property_name : string)

->DocumentMember?

Access a property by name. Returns the property, or nil when there is no such property.

remove_property(self, value : DocumentMember)

Remove a previously added property. Property must exist.

In order to remove a value by it's key, use my_document:remove_property(my_document["some_member"])

save_as(self, file_name : string)

->success : boolean, error : string?

Save the whole document tree to an XML file. Overwrites all contents of the file when it already exists.

to_string(self)

->string

Serialize the whole document tree to a XML string.


Local Aliases

DocumentMember

renoise.Document.DocumentList | renoise.Document.DocumentNode | renoise.Document.Observable | renoise.Document.ObservableList

Track changes to document properties or general states by attaching listener functions to it.

ObservableProperties

table<string, ObservableTypes | renoise.Document.DocumentList | renoise.Document.DocumentNode>

ObservableTypes

boolean | string | number | boolean[] | number[] | string[]