@@ -38,25 +38,31 @@ msgid ""
3838"Users who are not already proficient with the DOM should consider using the "
3939":mod:`xml.etree.ElementTree` module for their XML processing instead."
4040msgstr ""
41+ ":mod:`xml.dom.minidom` 是文档对象模型接口的最小化实现,具有与其他语言类似的 API。 它的目标是比完整 DOM "
42+ "更简单并且更为小巧。 对于 DOM 还不十分熟悉的用户则应当考虑改用 :mod:`xml.etree.ElementTree` 模块来进行 XML "
43+ "处理。"
4144
4245#: ../../library/xml.dom.minidom.rst:24
4346msgid ""
4447"The :mod:`xml.dom.minidom` module is not secure against maliciously "
4548"constructed data. If you need to parse untrusted or unauthenticated data "
4649"see :ref:`xml-vulnerabilities`."
4750msgstr ""
51+ ":mod:`xml.dom.minidom` 模块对于恶意构建的数据是不安全的。 如果你需要解析不受信任或未经身份验证的数据,请参阅 :ref"
52+ ":`xml-vulnerabilities`。"
4853
4954#: ../../library/xml.dom.minidom.rst:29
5055msgid ""
5156"DOM applications typically start by parsing some XML into a DOM. With "
5257":mod:`xml.dom.minidom`, this is done through the parse functions::"
5358msgstr ""
59+ "DOM 应用程序通常会从将某个 XML 解析为 DOM 开始。 使用 :mod:`xml.dom.minidom` 时,这是通过各种解析函数来完成的::"
5460
5561#: ../../library/xml.dom.minidom.rst:41
5662msgid ""
5763"The :func:`parse` function can take either a filename or an open file "
5864"object."
59- msgstr ""
65+ msgstr ":func:`parse` 函数可接受一个文件名或者打开的文件对象。 "
6066
6167#: ../../library/xml.dom.minidom.rst:46
6268msgid ""
@@ -66,6 +72,9 @@ msgid ""
6672"parser and activate namespace support; other parser configuration (like "
6773"setting an entity resolver) must have been done in advance."
6874msgstr ""
75+ "根据给定的输入返回一个 :class:`Document`。 *filename_or_file* 可以是一个文件名,或是一个文件类对象。 如果给定 "
76+ "*parser* 则它必须是一个 SAX2 解析器对象。 "
77+ "此函数将修改解析器的处理程序并激活命名空间支持;其他解析器配置(例如设置一个实体求解器)必须已经提前完成。"
6978
7079#: ../../library/xml.dom.minidom.rst:52
7180msgid ""
@@ -79,12 +88,16 @@ msgid ""
7988" an :class:`io.StringIO` object for the string and passes that on to "
8089":func:`parse`."
8190msgstr ""
91+ "返回一个代表 *string* 的 :class:`Document`。 此方法会为指定字符串创建一个 :class:`io.StringIO` "
92+ "对象并将其传递给 :func:`parse`。"
8293
8394#: ../../library/xml.dom.minidom.rst:61
8495msgid ""
8596"Both functions return a :class:`Document` object representing the content of"
8697" the document."
8798msgstr ""
99+ "两个函数均返回一个代表文档内容的 :class:`Document` 对象。object representing the content of the"
100+ " document."
88101
89102#: ../../library/xml.dom.minidom.rst:64
90103msgid ""
@@ -96,6 +109,9 @@ msgid ""
96109"it's simply that these functions do not provide a parser implementation "
97110"themselves."
98111msgstr ""
112+ ":func:`parse` 和 :func:`parseString` 函数所做的是将 XML 解析器连接到一个 \" DOM 构建器\" ,它可以从任意 "
113+ "SAX 解析器接收解析事件并将其转换为 DOM 树结构。 这两个函数的名称可能有些误导性,但在学习此接口时是很容易掌握的。 "
114+ "文档解析操作将在这两个函数返回之前完成;简单地说这两个函数本身并不提供解析器实现。"
99115
100116#: ../../library/xml.dom.minidom.rst:71
101117msgid ""
@@ -105,6 +121,9 @@ msgid ""
105121":mod:`xml.dom.minidom` module. Once you have a :class:`Document`, you can "
106122"add child nodes to it to populate the DOM::"
107123msgstr ""
124+ "你也可以通过在一个 \" DOM 实现\" 对象上调用方法来创建 :class:`Document`。 此对象可通过调用 :mod:`xml.dom` "
125+ "包或者 :mod:`xml.dom.minidom` 模块中的 :func:`getDOMImplementation` 函数来获取。 一旦你获得了一个"
126+ " :class:`Document`,你就可以向它添加子节点来填充 DOM::"
108127
109128#: ../../library/xml.dom.minidom.rst:86
110129msgid ""
0 commit comments