flow_segmenter.xml_utils.XMLUtils

class flow_segmenter.xml_utils.XMLUtils[source]

Utility class for XML operations on PageXML documents.

__init__()

Methods

__init__()

add_creator_metadata(xml_etree, creator[, ...])

Add creator information to the metadata of a PageXML document.

convert_textregions_to_textlines(xml_etree)

Convert TextRegion elements to TextLine if their ID contains 'textline'.

get_xml_namespace(xml_etree)

Extract the namespace from an XML element.

merge_xml_pages(existing_etree, new_etree)

Merge two PageXML documents by replacing the <Page> element.

safe_parse_xml(xml_content[, encoding])

Safely parse XML content with security measures against XXE attacks.

serialize_xml(xml_etree)

Serialize XML element tree to string with default encoding (utf-8).