The customxmlhandler module provides the XML functionality for custom slides

The basic XML is of the format:

<?xml version="1.0" encoding="UTF-8"?>
<song version="1.0">
    <lyrics language="en">
        <verse type="chorus" label="1">
            <![CDATA[ ... ]]>
class openlp.plugins.custom.lib.customxmlhandler.CustomXMLBuilder[source]

Bases: object

This class builds the XML used to describe songs.


Set up and add a <lyrics> tag which contains the lyrics of the custom item.

add_verse_to_lyrics(verse_type, number, content)[source]

Add a verse to the <lyrics> tag.

  • verse_type – A string denoting the type of verse. Possible values are “Chorus”, “Verse”, “Bridge”, and “Custom”.
  • number – An integer denoting the number of the item, for example: verse 1.
  • content – The actual text of the verse to be stored.

Extract our newly created XML custom.


Create a new custom XML document.

class openlp.plugins.custom.lib.customxmlhandler.CustomXMLParser(xml)[source]

Bases: object

A class to read in and parse a custom’s XML.


Iterates through the verses in the XML and returns a list of verses and their attributes.