Module processors.xml.section

Section processor

Classes

class SectionProcessor (reader, writer, doc_id)

A class to extract the sections in a standards document.

Ancestors

Class variables

var fieldnames

Column names.

Name Description Element
doc_id Document id
uuid Element UUID
section_id Section this element belongs to
id Section id id
type Section type sec-type
depth Section level
label Section label label
title Section title title

Methods

def converter(self, data)

Parse XML and extract committee.

Args

data : str
XML document

Returns

list
A list with dictionaries.
def process_section(self, node, depth)

Extract data from a section element.

Args

node : str
The section element
depth
The section depth

Returns

list
A dictionary.
def traverse_sections(self, node, depth=1, sections={})

Traverse section elements and get their tree depth.

Args

node : str
The section element
depth : int
The section depth
sections : dict

Returns

dict
A dictionary with sections indexed by depth.

Inherited members