gisserver.output.utils module

General utilities for outputting XML content

gisserver.output.utils.attr_escape(s: str)

Escape a value for usage in an XML attribute. This is slightly faster than html.escape() as it doesn’t replace single quotes.

gisserver.output.utils.render_xmlns_attributes(xml_namespaces: dict[str, str])

Render XML Namespace declaration attributes, i.e. xmlns:prefix="uri" for each dict item.

gisserver.output.utils.tag_escape(s: str)

Escape a value for usage in XML text.

gisserver.output.utils.to_qname(namespace, localname, namespaces: dict[str, str]) str

Convert a fully qualified XML tag name to a prefixed short name.

gisserver.output.utils.value_to_text(value)

Format a Python value for usage in plain text output. This doesn’t do any XML escaping.

gisserver.output.utils.value_to_xml_string(value)

Format a Python value for usage in XML text.