File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1244,6 +1244,8 @@ msgid ""
12441244"reordering was removed in Python 3.8 to preserve the order in which "
12451245"attributes were originally parsed or created by user code."
12461246msgstr ""
1247+ "在 Python 3.8 之前,元素的 XML 属性的序列化顺序会通过按其名称排序来强制使其可被预期。 由于现在字典已保证是有序的,这个强制重排序在 "
1248+ "Python 3.8 中已被移除以保留原本由用户代码解析或创建的属性顺序。"
12471249
12481250#: ../../library/xml.etree.elementtree.rst:1053
12491251msgid ""
@@ -1255,6 +1257,9 @@ msgid ""
12551257"signing or test data sets, canonical serialisation is available with the "
12561258":func:`canonicalize` function."
12571259msgstr ""
1260+ "通常,用户代码应当尽量不依赖于特定的属性顺序,因为 `XML 信息设定 <https://www.w3.org/TR/xml-infoset/>`_ "
1261+ "明确地排除了用属性顺序转递信息的做法。 代码应当准备好处理任何输入顺序。 对于要求确定性的 XML "
1262+ "输出的情况,例如加密签名或检测数据集等,可以通过规范化 :func:`canonicalize` 函数来进行传统的序列化。"
12581263
12591264#: ../../library/xml.etree.elementtree.rst:1061
12601265msgid ""
@@ -1265,6 +1270,8 @@ msgid ""
12651270"like the following can be applied prior to serialisation to enforce an order"
12661271" independently from the Element creation::"
12671272msgstr ""
1273+ "对于规范化输出不可用但仍然要求输出特定属性顺序的情况,代码应当设法直接按要求的顺序来创建属性,以避免代码阅读者产生不匹配的感觉。 "
1274+ "如果这一点是难以做到的,可以在序列化之前应用以下写法来强制实现顺序不依赖于元素的创建::"
12681275
12691276#: ../../library/xml.etree.elementtree.rst:1081
12701277msgid "ElementTree Objects"
You can’t perform that action at this time.
0 commit comments