@@ -17,9 +17,8 @@ msgstr ""
17
17
"Generated-By : Babel 2.17.0\n "
18
18
19
19
#: ../../library/xml.dom.minidom.rst:2
20
- #, fuzzy
21
20
msgid ":mod:`!xml.dom.minidom` --- Minimal DOM implementation"
22
- msgstr ":mod:`xml.dom.minidom` --- 최소 DOM 구현"
21
+ msgstr ":mod:`! xml.dom.minidom` --- 최소 DOM 구현"
23
22
24
23
#: ../../library/xml.dom.minidom.rst:11
25
24
msgid "**Source code:** :source:`Lib/xml/dom/minidom.py`"
@@ -66,6 +65,14 @@ msgid ""
66
65
"\n"
67
66
"dom3 = parseString('<myxml>Some data<empty/> some more data</myxml>')"
68
67
msgstr ""
68
+ "from xml.dom.minidom import parse, parseString\n"
69
+ "\n"
70
+ "dom1 = parse('c:\\\\ temp\\\\ mydata.xml') # 파일명으로 XML 파일을 구문 분석합니다\n"
71
+ "\n"
72
+ "datasource = open('c:\\\\ temp\\\\ mydata.xml')\n"
73
+ "dom2 = parse(datasource) # 열린 파일을 구문 분석합니다\n"
74
+ "\n"
75
+ "dom3 = parseString('<myxml>Some data<empty/> some more data</myxml>')"
69
76
70
77
#: ../../library/xml.dom.minidom.rst:41
71
78
msgid ""
@@ -145,6 +152,14 @@ msgid ""
145
152
"text = newdoc.createTextNode('Some textual content.')\n"
146
153
"top_element.appendChild(text)"
147
154
msgstr ""
155
+ "from xml.dom.minidom import getDOMImplementation\n"
156
+ "\n"
157
+ "impl = getDOMImplementation()\n"
158
+ "\n"
159
+ "newdoc = impl.createDocument(None, \" some_tag\" , None)\n"
160
+ "top_element = newdoc.documentElement\n"
161
+ "text = newdoc.createTextNode('Some textual content.')\n"
162
+ "top_element.appendChild(text)"
148
163
149
164
#: ../../library/xml.dom.minidom.rst:86
150
165
msgid ""
@@ -164,9 +179,10 @@ msgid ""
164
179
"dom3 = parseString(\" <myxml>Some data</myxml>\" )\n"
165
180
"assert dom3.documentElement.tagName == \" myxml\" "
166
181
msgstr ""
182
+ "dom3 = parseString(\" <myxml>Some data</myxml>\" )\n"
183
+ "assert dom3.documentElement.tagName == \" myxml\" "
167
184
168
185
#: ../../library/xml.dom.minidom.rst:95
169
- #, fuzzy
170
186
msgid ""
171
187
"When you are finished with a DOM tree, you may optionally call the "
172
188
":meth:`unlink` method to encourage early cleanup of the now-unneeded "
@@ -233,6 +249,8 @@ msgid ""
233
249
"with xml.dom.minidom.parse(datasource) as dom:\n"
234
250
" ... # Work with dom."
235
251
msgstr ""
252
+ "with xml.dom.minidom.parse(datasource) as dom:\n"
253
+ " ... # dom으로 작업합니다."
236
254
237
255
#: ../../library/xml.dom.minidom.rst:138
238
256
msgid ""
@@ -257,7 +275,6 @@ msgstr ""
257
275
"지정할 수 있습니다."
258
276
259
277
#: ../../library/xml.dom.minidom.rst:148
260
- #, fuzzy
261
278
msgid ""
262
279
"Similarly, explicitly stating the *standalone* argument causes the "
263
280
"standalone document declarations to be added to the prologue of the XML "
@@ -266,8 +283,8 @@ msgid ""
266
283
"omit the declaration from the document."
267
284
msgstr ""
268
285
"유사하게, *standalone* 인자를 명시적으로 지정하면 standalone 문서 선언이 XML 문서의 프롤로그에 추가됩니다. "
269
- "값이 `True`\\ 로 설정되면 `standalone=\" yes\" `\\ 가 추가되고, 그렇지 않으면 `\" no\" `\\ 로 "
270
- "설정됩니다. 인자를 명시하지 않으면 문서에서 선언을 생략합니다."
286
+ "값이 `` True`` \\ 로 설정되면 `` standalone=\" yes\" `` \\ 가 추가되고, 그렇지 않으면 `` \" no\" `` \\ 로"
287
+ " 설정됩니다. 인자를 명시하지 않으면 문서에서 선언을 생략합니다."
271
288
272
289
#: ../../library/xml.dom.minidom.rst:155
273
290
msgid ""
@@ -278,7 +295,7 @@ msgstr ":meth:`writexml` 메서드는 이제 사용자가 지정한 어트리뷰
278
295
#: ../../library/xml.dom.minidom.rst:159 ../../library/xml.dom.minidom.rst:180
279
296
#: ../../library/xml.dom.minidom.rst:199
280
297
msgid "The *standalone* parameter was added."
281
- msgstr ""
298
+ msgstr "*standalone* 매개 변수를 추가했습니다. "
282
299
283
300
#: ../../library/xml.dom.minidom.rst:164
284
301
msgid ""
@@ -408,6 +425,70 @@ msgid ""
408
425
"\n"
409
426
"handleSlideshow(dom)\n"
410
427
msgstr ""
428
+ "import xml.dom.minidom\n"
429
+ "\n"
430
+ "document = \"\"\"\\ \n"
431
+ "<slideshow>\n"
432
+ "<title>Demo slideshow</title>\n"
433
+ "<slide><title>Slide title</title>\n"
434
+ "<point>This is a demo</point>\n"
435
+ "<point>Of a program for processing slides</point>\n"
436
+ "</slide>\n"
437
+ "\n"
438
+ "<slide><title>Another demo slide</title>\n"
439
+ "<point>It is important</point>\n"
440
+ "<point>To have more than</point>\n"
441
+ "<point>one slide</point>\n"
442
+ "</slide>\n"
443
+ "</slideshow>\n"
444
+ "\"\"\" \n"
445
+ "\n"
446
+ "dom = xml.dom.minidom.parseString(document)\n"
447
+ "\n"
448
+ "def getText(nodelist):\n"
449
+ " rc = []\n"
450
+ " for node in nodelist:\n"
451
+ " if node.nodeType == node.TEXT_NODE:\n"
452
+ " rc.append(node.data)\n"
453
+ " return ''.join(rc)\n"
454
+ "\n"
455
+ "def handleSlideshow(slideshow):\n"
456
+ " print(\" <html>\" )\n"
457
+ " handleSlideshowTitle(slideshow.getElementsByTagName(\" title\" )[0])\n"
458
+ " slides = slideshow.getElementsByTagName(\" slide\" )\n"
459
+ " handleToc(slides)\n"
460
+ " handleSlides(slides)\n"
461
+ " print(\" </html>\" )\n"
462
+ "\n"
463
+ "def handleSlides(slides):\n"
464
+ " for slide in slides:\n"
465
+ " handleSlide(slide)\n"
466
+ "\n"
467
+ "def handleSlide(slide):\n"
468
+ " handleSlideTitle(slide.getElementsByTagName(\" title\" )[0])\n"
469
+ " handlePoints(slide.getElementsByTagName(\" point\" ))\n"
470
+ "\n"
471
+ "def handleSlideshowTitle(title):\n"
472
+ " print(f\" <title>{getText(title.childNodes)}</title>\" )\n"
473
+ "\n"
474
+ "def handleSlideTitle(title):\n"
475
+ " print(f\" <h2>{getText(title.childNodes)}</h2>\" )\n"
476
+ "\n"
477
+ "def handlePoints(points):\n"
478
+ " print(\" <ul>\" )\n"
479
+ " for point in points:\n"
480
+ " handlePoint(point)\n"
481
+ " print(\" </ul>\" )\n"
482
+ "\n"
483
+ "def handlePoint(point):\n"
484
+ " print(f\" <li>{getText(point.childNodes)}</li>\" )\n"
485
+ "\n"
486
+ "def handleToc(slides):\n"
487
+ " for slide in slides:\n"
488
+ " title = slide.getElementsByTagName(\" title\" )[0]\n"
489
+ " print(f\" <p>{getText(title.childNodes)}</p>\" )\n"
490
+ "\n"
491
+ "handleSlideshow(dom)\n"
411
492
412
493
#: ../../library/xml.dom.minidom.rst:216
413
494
msgid "minidom and the DOM standard"
0 commit comments