From 7d5045309a7100dfd2404f0bcdf73d27f4883ab1 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Aug 2014 10:48:30 +0100 Subject: Add parsing of footnotes XML --- mammoth/docx/footnotes_xml.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 mammoth/docx/footnotes_xml.py (limited to 'mammoth') diff --git a/mammoth/docx/footnotes_xml.py b/mammoth/docx/footnotes_xml.py new file mode 100644 index 0000000..c5ea746 --- /dev/null +++ b/mammoth/docx/footnotes_xml.py @@ -0,0 +1,21 @@ +#~ from .. import documents +#~ from .. import results +from .. import lists +#~ from .xmlparser import node_types +#~ + +def read_footnotes_xml_element(element): + return lists.map( + _read_footnote_element, + element.find_children("w:footnote"), + ) + + +def _read_footnote_element(element): + return FootnoteElement(element.attributes["w:id"], element.children) + + +class FootnoteElement(object): + def __init__(self, id, body): + self.id = id + self.body = body -- cgit v1.2.3