Revision | 137 (tree) |
---|---|
Time | 2019-04-01 10:40:38 |
Author | ksaito0717 |
fix.
@@ -129,7 +129,9 @@ | ||
129 | 129 | |
130 | 130 | level = 1 |
131 | 131 | |
132 | - for node in doc.documentElement.firstChild.childNodes: | |
132 | + #for node in doc.documentElement.firstChild.childNodes: | |
133 | + bodyElement = doc.getElementsByTagName("body")[0] | |
134 | + for node in bodyElement.childNodes: | |
133 | 135 | #if node.nodeType ==xml.dom.minidom.Node.TEXT_NODE: |
134 | 136 | # if node.data.strip() == "": |
135 | 137 | # continue |
@@ -196,7 +198,7 @@ | ||
196 | 198 | traverse(n,doc) |
197 | 199 | |
198 | 200 | ret = '' |
199 | - topLevelNode = doc.documentElement.firstChild.firstChild | |
201 | + topLevelNode = doc.documentElement.firstChild | |
200 | 202 | while (topLevelNode): |
201 | 203 | #ret = ret + topLevelNode.toxml('UTF-8') |
202 | 204 | ret = ret + topLevelNode.toxml() |
@@ -292,7 +294,7 @@ | ||
292 | 294 | traverse3(n,doc) |
293 | 295 | |
294 | 296 | ret = '' |
295 | - topLevelNode = doc.documentElement.firstChild.firstChild | |
297 | + topLevelNode = doc.documentElement.firstChild | |
296 | 298 | while (topLevelNode): |
297 | 299 | #ret = ret + topLevelNode.toxml('UTF-8') |
298 | 300 | ret = ret + topLevelNode.toxml() |
@@ -93,9 +93,9 @@ | ||
93 | 93 | self.type = Row.NOT_TABLE_ROW |
94 | 94 | |
95 | 95 | def initPipeRow(self,line): |
96 | - line = string.strip(line) | |
97 | - cols = string.split(line[1:],'|') | |
98 | - lastCol = string.strip(cols[-1]) | |
96 | + line = line.strip() | |
97 | + cols = line[1:].split('|') | |
98 | + lastCol = cols[-1].strip() | |
99 | 99 | if lastCol == 'h': |
100 | 100 | self.type = Row.HEADER_ROW |
101 | 101 | cols = cols[:-1] |
@@ -113,7 +113,7 @@ | ||
113 | 113 | self.cels = [Cel(col) for col in cols] |
114 | 114 | |
115 | 115 | def initCommaRow(self,line): |
116 | - line = string.strip(line) | |
116 | + line = line.strip() | |
117 | 117 | cols = splitCSV(line[1:]) |
118 | 118 | self.type = Row.CSV_ROW |
119 | 119 | self.cels = [Cel(col) for col in cols] |
@@ -143,7 +143,7 @@ | ||
143 | 143 | tmp = values[x] |
144 | 144 | if (tmp[0]=='"') and (tmp[-1]=='"'): |
145 | 145 | tmp = tmp[1:-1] |
146 | - tmp = string.replace(tmp,'""','"') | |
146 | + tmp = tmp.replace('""','"') | |
147 | 147 | values[x] = tmp |
148 | 148 | return values |
149 | 149 |
@@ -211,7 +211,7 @@ | ||
211 | 211 | continue |
212 | 212 | for x in range(0,colNo-1): |
213 | 213 | cel = row.cels[x] |
214 | - text = string.strip(cel.orgText) | |
214 | + text = cel.orgText.strip() | |
215 | 215 | if (row.type!=Row.CSV_ROW) and (text == '>'): |
216 | 216 | colPropagation(x,y,cel.colspan+1,table) |
217 | 217 | cel.colspan = -1 |
@@ -285,7 +285,7 @@ | ||
285 | 285 | # pukiwikiもそうみたいなのでいいかな. |
286 | 286 | def calNonCSVRowStyle(row): |
287 | 287 | for cel in row.cels: |
288 | - s = string.split(cel.orgText,':') | |
288 | + s = cel.orgText.split(':') | |
289 | 289 | endStyle = -1 |
290 | 290 | for x in range(len(s)): |
291 | 291 | if LEFT_RE.match(s[x]): |
@@ -330,7 +330,7 @@ | ||
330 | 330 | cel.align = 'text-align:center;' |
331 | 331 | else: |
332 | 332 | cel.align = 'text-align:right;' |
333 | - cel.text = string.strip(cel.orgText) | |
333 | + cel.text = cel.orgText.strip() | |
334 | 334 | |
335 | 335 | # 実際に表のデータを出力するための関数 |
336 | 336 | # ヘッダ,フッタ,それ以外の順に表示する |