# maci.xmlloaddict

### loading a file

Loads xml file data, and returns data as a dictionary.

{% hint style="info" %}
maci.xmlloaddict  ->  dict\[str, Any]
{% endhint %}

*Basic Example of loading a xml file using default positional parameter*

```python
data = maci.xmlloaddict('mydata.xml')
```

In this example, we simply load xml data from a file using the xmlloaddict function and pass a string of the filepath to the file as an argument to the function to load the xml data, and assign the returned data to a variable.

Access data as you normally would with a dictionary in python.

Note: All values in a xml file are returned as strings.

### partner functions

Functions that are related for xml as dict

[maci.xmlloadstrdict](https://docs.macilib.org/docs/xml/functions/maci.xmlloadstrdict)  ->  Loads xml data from a string as dict\
[maci.xmldumpdict](https://docs.macilib.org/docs/xml/functions/maci.xmldumpdict)  ->  Dumps xml data to a file from dict\
[maci.xmldumpstrdict](https://docs.macilib.org/docs/xml/functions/maci.xmldumpstrdict)  ->  Dumps xml data to a string from dict

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>filename:  str | Path</summary>

First and only required positional argument. Accepts strings and [Path objects](https://docs.python.org/3/library/pathlib.html)

Use this parameter to point to your filepath

</details>

*This function uses the xmltodict library installed as a dependency from pypi for its underlying functionality. For more information on xmltodict, visit:* [*https://pypi.org/project/xmltodict/*](https://pypi.org/project/xmltodict/)

**Security awareness**: It is important to evaluate handling XML data carefully as there are known vulnerabilities in dealing with XML data. Please refer to the [official python documentation](https://docs.python.org/3/library/xml.etree.elementtree.html).
