.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.pubsub.utils.xmltopicdefnprovider

.. currentmodule:: wx.lib.pubsub.utils.xmltopicdefnprovider

.. highlight:: python



.. _wx.lib.pubsub.utils.xmltopicdefnprovider:

==========================================================================================================================================
|phoenix_title|  **wx.lib.pubsub.utils.xmltopicdefnprovider**
==========================================================================================================================================

Contributed by Joshua R English, adapted by Oliver Schoenborn to be
consistent with pubsub API.

An extension for pubsub (http://pubsub.sourceforge.net) so topic tree
specification can be encoded in XML format rather than pubsub's default
Python nested class format.

To use:

    xml = '''
        <topicdefntree>
        <description>Test showing topic hierarchy and inheritance</description>
        <topic id="parent">
            <description>Parent with a parameter and subtopics</description>
            <listenerspec>
                <arg id="name" optional="true">given name</arg>
                <arg id="lastname">surname</arg>
            </listenerspec>

            <topic id="child">
                <description>This is the first child</description>
                <listenerspec>
                    <arg id="nick">A nickname</arg>
                </listenerspec>
            </topic>
        </topic>
        </topicdefntree>
    '''

These topic definitions are loaded through an XmlTopicDefnProvider:

    pub.addTopicDefnProvider( XmlTopicDefnProvider(xml) )

The XmlTopicDefnProvider also accepts a filename instead of XML string:

    provider = XmlTopicDefnProvider("path/to/XMLfile.xml", TOPIC_TREE_FROM_FILE)
    pub.addTopicDefnProvider( provider )

Topics can be exported to an XML file using the exportTopicTreeSpecXml function.
This will create a text file for the XML and return the string representation
of the XML tree.

:copyright: Copyright since 2013 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.pubsub.utils.xmltopicdefnprovider.exportTopicTreeSpecXml`         If rootTopic is None, then pub.getDefaultTopicTreeRoot() is assumed.
:func:`~wx.lib.pubsub.utils.xmltopicdefnprovider.indent`                         
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

=================================================================================================== ================================================================================
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider`                               
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.UnrecognizedSourceFormatError` 
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.XmlParserError`                
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlVisitor`                                         
=================================================================================================== ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider
   wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.UnrecognizedSourceFormatError
   wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.XmlParserError
   wx.lib.pubsub.utils.xmltopicdefnprovider.XmlVisitor





Functions
------------

.. function:: exportTopicTreeSpecXml(moduleName=None, rootTopic=None, bak='bak', moduleDoc=None)

   If rootTopic is None, then pub.getDefaultTopicTreeRoot() is assumed.


.. function:: indent(elem, level=0)


