gws.lib.xmlx

XML-related utilities and helpers.

Source code: gws.lib.xmlx

Submodules

Package Contents

exception gws.lib.xmlx.BuildError

Bases: Error

Generic GWS error.

exception gws.lib.xmlx.Error

Bases: gws.Error

Generic GWS error.

gws.lib.xmlx.from_path(path: str, opts: gws.XmlOptions | None = None) gws.XmlElement

Creates an XmlElement object from a .xml file.

Parameters:
  • path – Path to the .xml file.

  • opts – XML options.

gws.lib.xmlx.from_string(inp: str | bytes, opts: gws.XmlOptions | None = None) gws.XmlElement

Creates an XmlElement from a string or bytes.

Parameters:
  • inp – .xml file as a string or bytes.

  • opts – XML options.

exception gws.lib.xmlx.ParseError

Bases: Error

Generic GWS error.

gws.lib.xmlx.tag(name: str, *args, **kwargs) gws.XmlElement

Build an XML element from arguments.

exception gws.lib.xmlx.WriteError

Bases: Error

Generic GWS error.