forked from python/python-docs-zh-tw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml.sax.utils.po
More file actions
161 lines (146 loc) · 7.9 KB
/
xml.sax.utils.po
File metadata and controls
161 lines (146 loc) · 7.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Weilin Du, 2025
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2025-07-10 23:59+0800\n"
"Last-Translator: Weilin Du <1372449351@qq.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.6\n"
#: ../../library/xml.sax.utils.rst:2
msgid ":mod:`!xml.sax.saxutils` --- SAX Utilities"
msgstr ":mod:`!xml.sax.saxutils` --- SAX 工具程式"
#: ../../library/xml.sax.utils.rst:10
msgid "**Source code:** :source:`Lib/xml/sax/saxutils.py`"
msgstr "**原始碼:**\\ :source:`Lib/xml/sax/saxutils.py`"
#: ../../library/xml.sax.utils.rst:14
msgid ""
"The module :mod:`xml.sax.saxutils` contains a number of classes and "
"functions that are commonly useful when creating SAX applications, either in "
"direct use, or as base classes."
msgstr ""
"模組 :mod:`xml.sax.saxutils` 包含了許多在建立 SAX 應用程式時非常有用的類別和"
"函式,這些類別和函式可以直接使用,也可以作為基底類別。"
#: ../../library/xml.sax.utils.rst:21
msgid "Escape ``'&'``, ``'<'``, and ``'>'`` in a string of data."
msgstr "在資料字串中轉義 ``'&'``、``'<'`` 及 ``'>'``。"
#: ../../library/xml.sax.utils.rst:23
msgid ""
"You can escape other strings of data by passing a dictionary as the optional "
"*entities* parameter. The keys and values must all be strings; each key "
"will be replaced with its corresponding value. The characters ``'&'``, "
"``'<'`` and ``'>'`` are always escaped, even if *entities* is provided."
msgstr ""
"你可以透過傳入字典作為可選的 *entities* 參數,來轉換其他資料字串。鍵和值都必"
"須是字串;每個鍵都會被對應的值取代。即使提供 *entities*,``'&'``、``'<'`` "
"和 ``'>'`` 字元始終會被轉義。"
#: ../../library/xml.sax.utils.rst:30
msgid ""
"This function should only be used to escape characters that can't be used "
"directly in XML. Do not use this function as a general string translation "
"function."
msgstr ""
"這個函式只能用來轉換 XML 中無法直接使用的字元。請勿將此函式用作一般的字串轉"
"換函式。"
#: ../../library/xml.sax.utils.rst:36
msgid "Unescape ``'&'``, ``'<'``, and ``'>'`` in a string of data."
msgstr "取消轉義資料字串中的 ``'&'``、``'<'`` 和 ``'>'``。"
#: ../../library/xml.sax.utils.rst:38
msgid ""
"You can unescape other strings of data by passing a dictionary as the "
"optional *entities* parameter. The keys and values must all be strings; "
"each key will be replaced with its corresponding value. ``'&'``, "
"``'<'``, and ``'>'`` are always unescaped, even if *entities* is "
"provided."
msgstr ""
"你可以透過傳入字典作為可選的 *entities* 參數,來取消其他字串的資料。鍵和值都"
"必須是字串;每個鍵都會被對應的值取代。即使提供了 *entities*,``'&'``、"
"``'<’`` 和 ``‘>'`` 總是會取消轉換。"
#: ../../library/xml.sax.utils.rst:46
msgid ""
"Similar to :func:`escape`, but also prepares *data* to be used as an "
"attribute value. The return value is a quoted version of *data* with any "
"additional required replacements. :func:`quoteattr` will select a quote "
"character based on the content of *data*, attempting to avoid encoding any "
"quote characters in the string. If both single- and double-quote characters "
"are already in *data*, the double-quote characters will be encoded and "
"*data* will be wrapped in double-quotes. The resulting string can be used "
"directly as an attribute value::"
msgstr ""
"類似於 :func:`escape`,但也準備 *data* 作為屬性值。:func:`quoteattr` 會根據 "
"*data* 的內容選擇引號字元,嘗試避免在字串中編碼任何引號字元。如果 *data* 中已"
"經有單引號和雙引號字元,雙引號字元將被編碼,而 *data* 將被雙引號包覆。結果字"
"串可直接用作屬性值:"
#: ../../library/xml.sax.utils.rst:55
msgid ""
">>> print(\"<element attr=%s>\" % quoteattr(\"ab ' cd \\\" ef\"))\n"
"<element attr=\"ab ' cd " ef\">"
msgstr ""
">>> print(\"<element attr=%s>\" % quoteattr(\"ab ' cd \\\" ef\"))\n"
"<element attr=\"ab ' cd " ef\">"
#: ../../library/xml.sax.utils.rst:58
msgid ""
"This function is useful when generating attribute values for HTML or any "
"SGML using the reference concrete syntax."
msgstr "當使用參考具體語法為 HTML 或任何 SGML 產生屬性值時,此功能非常有用。"
#: ../../library/xml.sax.utils.rst:64
msgid ""
"This class implements the :class:`~xml.sax.handler.ContentHandler` interface "
"by writing SAX events back into an XML document. In other words, using "
"an :class:`XMLGenerator` as the content handler will reproduce the original "
"document being parsed. *out* should be a file-like object which will default "
"to *sys.stdout*. *encoding* is the encoding of the output stream which "
"defaults to ``'iso-8859-1'``. *short_empty_elements* controls the formatting "
"of elements that contain no content: if ``False`` (the default) they are "
"emitted as a pair of start/end tags, if set to ``True`` they are emitted as "
"a single self-closed tag."
msgstr ""
"這個類別透過將 SAX 事件寫回 XML 文件來實"
"作 :class:`~xml.sax.handler.ContentHandler` 介面。換句話說,使"
"用 :class:`XMLGenerator` 作為內容處理器將會重現被剖析的原始文件。*out* 應該"
"是類檔案物件,預設為 *sys.stdout*。*encoding* 是輸出串流的編碼,預設為"
"``'iso-8859-1'``。*short_empty_elements* 控制不包含內容的元素的格式:如果設"
"定為 ``False``\\ (預設值),它們會以一對開始/結束(start/end)標籤的形式輸出;如果設定為 "
"``True``,它們會以單一自封(self-closed)標籤的形式輸出。"
#: ../../library/xml.sax.utils.rst:74
msgid "Added the *short_empty_elements* parameter."
msgstr "新增 *short_empty_elements* 參數。"
#: ../../library/xml.sax.utils.rst:80
msgid ""
"This class is designed to sit between "
"an :class:`~xml.sax.xmlreader.XMLReader` and the client application's event "
"handlers. By default, it does nothing but pass requests up to the reader "
"and events on to the handlers unmodified, but subclasses can override "
"specific methods to modify the event stream or the configuration requests as "
"they pass through."
msgstr ""
"這個類別的設計是在 :class:`~xml.sax.xmlreader.XMLReader` 與用戶端應用程式的事"
"件處理程式之間。預設情況下,它什麼都不做,只是將要求傳送到閱讀器,並將事件未"
"經修改地傳送到處理程式,但子類別可以覆寫特定的方法,以在傳送它們的時候修改事件串"
"流或配置請求。"
#: ../../library/xml.sax.utils.rst:90
msgid ""
"This function takes an input source and an optional base URL and returns a "
"fully resolved :class:`~xml.sax.xmlreader.InputSource` object ready for "
"reading. The input source can be given as a string, a file-like object, or "
"an :class:`~xml.sax.xmlreader.InputSource` object; parsers will use this "
"function to implement the polymorphic *source* argument to "
"their :meth:`~xml.sax.xmlreader.XMLReader.parse` method."
msgstr ""
"這個函式接收一個輸入來源和一個可選的基底 URL,並回傳一個完全解析"
"的 :class:`~xml.sax.xmlreader.InputSource` 物件,以準備讀取。輸入來源可以是字"
"串、類檔案物件或 :class:`~xml.sax.xmlreader.InputSource` 物件;剖析器會使用這個"
"函式來實作它們的 :meth:`~xml.sax.xmlreader.XMLReader.parse` 方法的多型 "
"*source* 引數。"