Package TestON :: Package core :: Module xmldict
[hide private]
[frames] | no frames]

Module xmldict

source code

Created on 03-Dec-2012


Author: Anil Kumar (anilkumar.s@paxterrasolutions.com)

TestON is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

TestON is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with TestON. If not, see <http://www.gnu.org/licenses/>.

Functions [hide private]
 
xml_to_dict(root_or_str, strict=True)
Converts `root_or_str` which can be parsed xml or a xml string to dict.
source code
 
dict_to_xml(dict_xml)
Converts `dict_xml` which is a python dict to corresponding xml.
source code
 
_to_xml(el)
Converts `el` to its xml representation.
source code
 
_extract_attrs(els)
Extracts attributes from dictionary `els`.
source code
 
_dict_to_xml(els)
Converts `els` which is a python dict to corresponding xml.
source code
 
_is_xml_el_dict(el)
Returns true if `el` is supposed to be a dict.
source code
 
_is_xml_el_list(el)
Returns true if `el` is supposed to be a list.
source code
 
_str_to_datetime(date_str) source code
 
_str_to_boolean(bool_str) source code
 
_from_xml(el, strict)
Extracts value of xml element element `el`.
source code
 
_val_and_maybe_convert(el)
Converts `el.text` if `el` has attribute `type` with valid value.
source code
 
_list_from_xml(els, strict)
Converts xml elements list `el_list` to a python list.
source code
 
_dict_from_xml(els, strict)
Converts xml doc with root `root` to a python dict.
source code
Variables [hide private]
  __package__ = 'TestON.core'
Function Details [hide private]

_extract_attrs(els)

source code 

Extracts attributes from dictionary `els`. Attributes are keys which start with '@'

_is_xml_el_dict(el)

source code 

Returns true if `el` is supposed to be a dict. This function makes sense only in the context of making dicts out of xml.

_is_xml_el_list(el)

source code 

Returns true if `el` is supposed to be a list. This function makes sense only in the context of making lists out of xml.