blob: 3db7105e90041fd8f68676677059a2e351207874 [file] [log] [blame]
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>TestON.core.xmldict</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="TestON-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>TestON</th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="TestON-module.html">Package&nbsp;TestON</a> ::
<a href="TestON.core-module.html">Package&nbsp;core</a> ::
Module&nbsp;xmldict
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="TestON.core.xmldict-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module xmldict</h1><p class="nomargin-top"><span class="codelink"><a href="TestON.core.xmldict-pysrc.html">source&nbsp;code</a></span></p>
<p>Created on 03-Dec-2012</p>
<hr />
<div class="fields"> <p><strong>Author:</strong>
Anil Kumar (anilkumar.s@paxterrasolutions.com)
<p>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.</p>
<p>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.</p>
<p>You should have received a copy of the GNU General Public
License along with TestON. If not, see
&lt;http://www.gnu.org/licenses/&gt;.</p>
</p>
</div><!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="xml_to_dict"></a><span class="summary-sig-name">xml_to_dict</span>(<span class="summary-sig-arg">root_or_str</span>,
<span class="summary-sig-arg">strict</span>=<span class="summary-sig-default">True</span>)</span><br />
Converts `root_or_str` which can be parsed xml or a xml string to
dict.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#xml_to_dict">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="dict_to_xml"></a><span class="summary-sig-name">dict_to_xml</span>(<span class="summary-sig-arg">dict_xml</span>)</span><br />
Converts `dict_xml` which is a python dict to corresponding xml.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#dict_to_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_to_xml"></a><span class="summary-sig-name">_to_xml</span>(<span class="summary-sig-arg">el</span>)</span><br />
Converts `el` to its xml representation.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_to_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="TestON.core.xmldict-module.html#_extract_attrs" class="summary-sig-name" onclick="show_private();">_extract_attrs</a>(<span class="summary-sig-arg">els</span>)</span><br />
Extracts attributes from dictionary `els`.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_extract_attrs">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_dict_to_xml"></a><span class="summary-sig-name">_dict_to_xml</span>(<span class="summary-sig-arg">els</span>)</span><br />
Converts `els` which is a python dict to corresponding xml.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_dict_to_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="TestON.core.xmldict-module.html#_is_xml_el_dict" class="summary-sig-name" onclick="show_private();">_is_xml_el_dict</a>(<span class="summary-sig-arg">el</span>)</span><br />
Returns true if `el` is supposed to be a dict.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_is_xml_el_dict">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="TestON.core.xmldict-module.html#_is_xml_el_list" class="summary-sig-name" onclick="show_private();">_is_xml_el_list</a>(<span class="summary-sig-arg">el</span>)</span><br />
Returns true if `el` is supposed to be a list.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_is_xml_el_list">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_str_to_datetime"></a><span class="summary-sig-name">_str_to_datetime</span>(<span class="summary-sig-arg">date_str</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_str_to_datetime">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_str_to_boolean"></a><span class="summary-sig-name">_str_to_boolean</span>(<span class="summary-sig-arg">bool_str</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_str_to_boolean">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_from_xml"></a><span class="summary-sig-name">_from_xml</span>(<span class="summary-sig-arg">el</span>,
<span class="summary-sig-arg">strict</span>)</span><br />
Extracts value of xml element element `el`.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_from_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_val_and_maybe_convert"></a><span class="summary-sig-name">_val_and_maybe_convert</span>(<span class="summary-sig-arg">el</span>)</span><br />
Converts `el.text` if `el` has attribute `type` with valid value.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_val_and_maybe_convert">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_list_from_xml"></a><span class="summary-sig-name">_list_from_xml</span>(<span class="summary-sig-arg">els</span>,
<span class="summary-sig-arg">strict</span>)</span><br />
Converts xml elements list `el_list` to a python list.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_list_from_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_dict_from_xml"></a><span class="summary-sig-name">_dict_from_xml</span>(<span class="summary-sig-arg">els</span>,
<span class="summary-sig-arg">strict</span>)</span><br />
Converts xml doc with root `root` to a python dict.</td>
<td align="right" valign="top">
<span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_dict_from_xml">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Variables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'TestON.core'"><code class="variable-quote">'</code><code class="variable-string">TestON.core</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Function Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-FunctionDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="_extract_attrs"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">_extract_attrs</span>(<span class="sig-arg">els</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_extract_attrs">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Extracts attributes from dictionary `els`. Attributes are keys which
start with '@'</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="_is_xml_el_dict"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">_is_xml_el_dict</span>(<span class="sig-arg">el</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_is_xml_el_dict">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Returns true if `el` is supposed to be a dict. This function makes
sense only in the context of making dicts out of xml.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="_is_xml_el_list"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">_is_xml_el_list</span>(<span class="sig-arg">el</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="TestON.core.xmldict-pysrc.html#_is_xml_el_list">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Returns true if `el` is supposed to be a list. This function makes
sense only in the context of making lists out of xml.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="TestON-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>TestON</th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Mon Aug 10 11:12:34 2015
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>