oslo_reports.views.xml package

Submodules

oslo_reports.views.xml.generic module

Provides generic XML views

This modules defines several basic views for serializing data to XML. Submodels that have already been serialized as XML may have their string values marked with __is_xml__ = True using oslo_reports._utils.StringWithAttrs (each of the classes within this module does this automatically, and non-naive serializers check for this attribute and handle such strings specially)

class oslo_reports.views.xml.generic.KeyValueView(wrapper_name='model')

Bases: object

A Key-Value XML View

This view performs advanced serialization of a data model into XML. It first deserializes any values marked as XML so that they can be properly reserialized later. It then follows the following rules to perform serialization:

keytext/xml

The tag name is the key name, and the contents are the text or xml

keySequence

A wrapper tag is created with the key name, and each item is placed in an ‘item’ tag

keyMapping

A wrapper tag is created with the key name, and the serialize is called on each key-value pair (such that each key gets its own tag)

Parameters:

wrapper_name (str) – the name of the top-level element

Module contents

Provides basic XML views

This module provides several basic views which serialize models into XML.