Python LMF library
 All Classes Namespaces Files Functions Variables
Functions
pylmflib.pylmflib.utils.xml_format Namespace Reference

Functions

def prettify
 Return a pretty-printed XML string for the given XML element. More...
 
def write_result
 Write an XML element into a pretty XML output file. More...
 
def parse_xml
 Parse an XML file. More...
 

Function Documentation

def pylmflib.pylmflib.utils.xml_format.parse_xml (   filename)

Parse an XML file.

Parameters
filenameThe name of the XML file to parse with full path, for instance 'input.xml'.
Returns
The root XML element.

Definition at line 35 of file xml_format.py.

def pylmflib.pylmflib.utils.xml_format.prettify (   element,
  encoding = ENCODING 
)

Return a pretty-printed XML string for the given XML element.

Parameters
elementAn XML element.
encodingEncoding mode. Default value is 'utf-8'.
Returns
A Python string containing the printed version of the XML element.

Definition at line 13 of file xml_format.py.

def pylmflib.pylmflib.utils.xml_format.write_result (   element,
  filename,
  encoding = ENCODING 
)

Write an XML element into a pretty XML output file.

Parameters
elementAn XML element.
filenameThe name of the XML file to write with full path, for instance 'output.xml'.
encodingEncoding mode. Default value is 'utf-8'.

Definition at line 24 of file xml_format.py.