:tocdepth: 3 :py:mod:`gws.lib.xmlx` ====================== .. py:module:: gws.lib.xmlx .. autoapi-nested-parse:: XML-related utilities and helpers. **Source code:** :source:`gws.lib.xmlx` Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 element/index.rst error/index.rst namespace/index.rst parser/index.rst serializer/index.rst tag/index.rst util/index.rst Package Contents ---------------- .. py:exception:: BuildError Bases: :py:obj:`Error` Generic GWS error. .. py:exception:: Error Bases: :py:obj:`gws.Error` Generic GWS error. .. py:function:: from_path(path: str, case_insensitive: bool = False, compact_whitespace: bool = False, normalize_namespaces: bool = False, remove_namespaces: bool = False) -> gws.XmlElement Creates an ``XmlElement`` object from a .xml file. :param path: Path to the .xml file. :param case_insensitive: If true tags will be written in lowercase into the XmlElement. :param compact_whitespace: If true all whitespaces and newlines are omitted. :param normalize_namespaces: :param remove_namespaces: Removes all occurrences of namespaces. .. py:function:: from_string(inp: str | bytes, case_insensitive: bool = False, compact_whitespace: bool = False, remove_namespaces: bool = False, normalize_namespaces: bool = False) -> gws.XmlElement Creates an ``XmlElement`` from a string or bytes. :param inp: .xml file as a string or bytes. :param case_insensitive: If true tags will be written in lowercase into the XmlElement. :param compact_whitespace: If true all whitespaces and newlines are omitted. :param normalize_namespaces: :param remove_namespaces: Removes all occurrences of namespaces. .. py:exception:: ParseError Bases: :py:obj:`Error` Generic GWS error. .. py:function:: tag(name: str, *args, **kwargs) -> gws.XmlElement Build an XML element from arguments. .. py:exception:: WriteError Bases: :py:obj:`Error` Generic GWS error.