@@ -655,23 +655,26 @@ msgid ""
655655":meth:`getElementsByTagName` and :meth:`getElementsByTagNameNS` methods of "
656656":class:`Node` return objects with this interface to represent query results."
657657msgstr ""
658+ ":class:`NodeList` 代表一个节点列表。 在 DOM 核心建议中这些对象有两种使用方式: 由 :class:`Element` "
659+ "对象提供作为其子节点列表,以及由 :class:`Node` 的 :meth:`getElementsByTagName` 和 "
660+ ":meth:`getElementsByTagNameNS` 方法通过此接口返回对象来表示查询结果。"
658661
659662#: ../../library/xml.dom.rst:412
660663msgid ""
661664"The DOM Level 2 recommendation defines one method and one attribute for "
662665"these objects:"
663- msgstr ""
666+ msgstr "DOM 第 2 层级建议为这些对象定义一个方法和一个属性: "
664667
665668#: ../../library/xml.dom.rst:418
666669msgid ""
667670"Return the *i*'th item from the sequence, if there is one, or ``None``. The"
668671" index *i* is not allowed to be less than zero or greater than or equal to "
669672"the length of the sequence."
670- msgstr ""
673+ msgstr "从序列中返回第 *i* 项,如果序列不为空的话,否则返回 ``None``。 索引号 *i* 不允许小于零或大于等于序列的长度。 "
671674
672675#: ../../library/xml.dom.rst:425
673676msgid "The number of nodes in the sequence."
674- msgstr ""
677+ msgstr "序列中的节点数量。 "
675678
676679#: ../../library/xml.dom.rst:427
677680msgid ""
@@ -682,13 +685,19 @@ msgid ""
682685"iteration over the :class:`NodeList` in :keyword:`for` statements and proper"
683686" support for the :func:`len` built-in function."
684687msgstr ""
688+ "此外,Python DOM 接口还要求提供一些额外支持来允许将 :class:`NodeList` 对象用作 Python 序列。 所有 "
689+ ":class:`NodeList` 实现都必须包括对 :meth:`~object.__len__` 和 "
690+ ":meth:`~object.__getitem__` 的支持;这样 :class:`NodeList` 就允许使用 :keyword:`for` "
691+ "语句进行迭代并能正确地支持 :func:`len` 内置函数。"
685692
686693#: ../../library/xml.dom.rst:435
687694msgid ""
688695"If a DOM implementation supports modification of the document, the "
689696":class:`NodeList` implementation must also support the "
690697":meth:`~object.__setitem__` and :meth:`~object.__delitem__` methods."
691698msgstr ""
699+ "如果一个 DOM 实现支持文档的修改,则 :class:`NodeList` 实现还必须支持 :meth:`~object.__setitem__` 和"
700+ " :meth:`~object.__delitem__` 方法。"
692701
693702#: ../../library/xml.dom.rst:443
694703msgid "DocumentType Objects"
@@ -704,6 +713,10 @@ msgid ""
704713"for the document, the document's :attr:`doctype` attribute will be set to "
705714"``None`` instead of an instance of this interface."
706715msgstr ""
716+ "有关一个文档所声明的标注和实体的信息(包括解析器所使用并能提供信息的外部子集)可以从 :class:`DocumentType` 对象获取。 文档的 "
717+ ":class:`DocumentType` 可从 :class:`Document` 对象的 :attr:`doctype` "
718+ "属性中获取;如果一个文档没有 ``DOCTYPE`` 声明,则该文档的 :attr:`doctype` 属性将被设为 ``None`` "
719+ "而非此接口的一个实例。"
707720
708721#: ../../library/xml.dom.rst:453
709722msgid ""
0 commit comments