maci docs
  • maci
  • WATCH
    • Quick Start
    • Full Training Series
  • DOCS
    • maci
      • language
        • v1.0.0
      • functions
        • maci.build
        • maci.load
        • maci.loadstr
        • maci.loadattrs
        • maci.loadraw
        • maci.loaddict
        • maci.loadstrdict
        • maci.dump
        • maci.dumpstr
        • maci.dumpraw
      • object
        • methods
          • lock_attr
          • unlock_attr
          • hard_lock_attr
          • map_attr
          • unmap_attr
          • load_attrs
          • get_attrs
          • get_locked_list
          • get_hard_locked_list
          • get_all_maps
          • get_parent_maps
          • get_child_maps
          • get_parent_map_chains
          • is_parent_map
          • is_child_map
      • errors
      • hints
    • json
      • functions
        • maci.jsonload
        • maci.jsonloadstr
        • maci.jsondump
        • maci.jsondumpstr
    • yaml
      • functions
        • maci.yamlload
        • maci.yamlloadstr
        • maci.yamlloadall
        • maci.yamldump
        • maci.yamldumpstr
        • maci.yamldumpall
    • toml
      • functions
        • maci.tomlload
        • maci.tomlloadstr
        • maci.tomldump
        • maci.tomldumpstr
    • ini
      • functions
        • maci.iniload
        • maci.inidump
        • maci.inibuildauto
        • maci.inibuildmanual
    • xml
      • functions
        • maci.xmlload
        • maci.xmlloadstr
        • maci.xmlloaddict
        • maci.xmlloadstrdict
        • maci.xmldump
        • maci.xmldumpstr
        • maci.xmldumpdict
        • maci.xmldumpstrdict
        • maci.xmlbuildmanual
        • maci._defuse_xml_stdlib
    • pickle
      • functions
        • maci.pickleloadbytes
        • maci.pickledumpbytes
    • tools
      • hash functions
        • maci.createhash
        • maci.createfilehash
        • maci.comparefilehash
      • format functions
        • maci.cleanformat
  • Updates
    • Changelog
      • v1.1.0
      • v1.0.0
Powered by GitBook
On this page
  • loading a string
  • partner functions
  • parameters & arguments
  1. DOCS
  2. xml
  3. functions

maci.xmlloadstrdict

loads xml data to dict from a string

Last updated 1 year ago

loading a string

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

maci.xmlloadstrdict -> dict[str, Any]

Basic Example of loading a xml string using default positional parameter

data = maci.xmlloadstrdict('<mydata><data1>one</data1></mydata>')

In this example, we simply load xml data from a string using the xmlloadstrdict function and pass a string 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 xml data are returned as strings.

partner functions

Functions that are related for xml as dict

-> Loads xml data from a file as dict -> Dumps xml data to a file from dict -> Dumps xml data to a string from dict

parameters & arguments

Describes all parameter functionality and accepted data types

xml_str_data: str

First and only required positional argument. Accepts strings

Use this parameter to pass in your xml formatted string data

This function uses the xmltodict library installed as a dependency from pypi for its underlying functionality. For more information on xmltodict, visit:

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 .

maci.xmlloaddict
maci.xmldumpdict
maci.xmldumpstrdict
https://pypi.org/project/xmltodict/
official python documentation