@@ -7,22 +7,22 @@ use crate::engine::Engine;
77use crate :: foundations:: { dict, func, scope, Array , Dict , IntoValue , Str , Value } ;
88use crate :: loading:: { DataSource , Load , Readable } ;
99
10- /// Reads structured data from an XML file.
10+ /// XMLファイルから構造化データを読み込む。
1111///
12- /// The XML file is parsed into an array of dictionaries and strings. XML nodes
13- /// can be elements or strings. Elements are represented as dictionaries with
14- /// the following keys:
12+ /// XMLファイルは辞書と文字列からなる配列にパースされます。
13+ /// XMLノードは要素または文字列になり得ます。
14+ /// 要素は以下のキーを持つ辞書として表現されます。
1515///
16- /// - `tag`: The name of the element as a string.
17- /// - `attrs`: A dictionary of the element's attributes as strings.
18- /// - `children`: An array of the element's child nodes.
16+ /// - `tag`: 要素の名称を表す文字列。
17+ /// - `attrs`: 要素の属性を表す文字列からなる辞書。
18+ /// - `children`: 要素の子ノードからなる配列。
1919///
20- /// The XML file in the example contains a root `news` tag with multiple
21- /// `article` tags. Each article has a ` title`, `author`, and `content` tag. The
22- /// `content` tag contains one or more paragraphs, which are represented as `p`
23- /// tags.
20+ /// この例におけるXMLファイルは、ルート要素である `news`タグと複数の`article`タグを含んでいます。
21+ /// それぞれのarticleは` title`、 `author`、および `content`タグを持っています。
22+ /// `content`タグは1つ以上の段落を含んでおり、
23+ /// これらは`p`タグとして表現されています。
2424///
25- /// # Example
25+ /// # 例
2626/// ```example
2727/// #let find-child(elem, tag) = {
2828/// elem.children
@@ -58,7 +58,7 @@ use crate::loading::{DataSource, Load, Readable};
5858#[ func( scope, title = "XML" ) ]
5959pub fn xml (
6060 engine : & mut Engine ,
61- /// A [path ]($syntax/#paths) to an XML file or raw XML bytes.
61+ /// XMLファイルの[パス ]($syntax/#paths)または生のXMLバイト列。
6262 source : Spanned < DataSource > ,
6363) -> SourceResult < Value > {
6464 let data = source. load ( engine. world ) ?;
@@ -74,12 +74,12 @@ pub fn xml(
7474
7575#[ scope]
7676impl xml {
77- /// Reads structured data from an XML string/bytes.
77+ /// XMLの文字列やバイト列から構造化データを読み込む。
7878 #[ func( title = "Decode XML" ) ]
79- #[ deprecated = "`xml.decode` is deprecated, directly pass bytes to `xml` instead " ]
79+ #[ deprecated = "`xml.decode`は非推奨です。代わりにバイト列を直接 `xml`に渡してください。 " ]
8080 pub fn decode (
8181 engine : & mut Engine ,
82- /// XML data.
82+ /// XMLデータ。
8383 data : Spanned < Readable > ,
8484 ) -> SourceResult < Value > {
8585 xml ( engine, data. map ( Readable :: into_source) )
0 commit comments