3 import xml.dom.minidom
as md
5 import xml.etree.ElementTree
as ET
7 doc = md.parse(
'tables.html')
8 tables = doc.getElementsByTagName(
'table')
12 for T
in xrange(0, len(cvt)):
14 trs = cvt[T].getElementsByTagName(
'tr')
17 tds = tr.getElementsByTagName(
'td')
20 for p
in td.childNodes:
21 if p.nodeType == p.TEXT_NODE:
24 tree = ET.fromstring(p.toxml().encode(
'utf-8'))
25 text.append(
''.join(tree.itertext()))
26 row.append(
'<br>'.join(text))
41 cvtr[T][i - 1].append([static[0], static[1], model])
49 table[0][2] =
u'Возможные значения' 50 text +=
u"\page fptrValues{} {}\n".format(table[1][2], name)
55 text +=
u"\t\t<th>" + col +
u"</th>\n" 61 text +=
u"\t\t<td>" + col +
u"</td>\n" 64 text +=
u"</table>\n\n" 66 name = name.replace(
'/',
'')
67 with codecs.open(name +
u'.dox',
'w', encoding=
'utf-8')
as f:
75 table[0][2] =
u'Возможные значения' 76 text =
u"\page fptrCaptions{} {}\n".format(table[1][2], name)
81 text +=
u"\t\t<th>" + col +
u"</th>\n" 87 text +=
u"\t\t<td>" + col +
u"</td>\n" 94 name = name.replace(
'/',
'')
95 with codecs.open(name +
u'.dox',
'a+', encoding=
'utf-8')
as f: