Help with mixed sequence with attributes?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading the deserialization guide and tests for overlapped-lists, then compare how the XML element names map to the Rust field names in the supplied structs. Reproduce the reported None values with the example XML; done means identifying whether the field naming or list handling causes the mismatch and documenting a working approach or a focused fix. The issue has had no reply for over two years.
索引モデルが issue の本文から書いたものです。
説明
Hi there! Thank you for the excellent library.
I'm quite stuck and I was hoping someone might be able to help me. I'm trying to switch to quick-xml from serde-xml-rs and I've got everything switched except this last bit. I've got some XML that looks like this (excuse the escaped quotes):
<ifi-parties>
<ifi-standardized-name country=\"CH\" type=\"U.S. Company or Corporation\" number=\"070058\">
<addressbook>
<name>Company Name</name>
</addressbook>
</ifi-standardized-name>
<ifi-standardized-name-current country=\"CH\" number=\"070058\">
<addressbook>
<name>Company Name</name>
</addressbook>
</ifi-standardized-name-current>
</ifi-parties>
There's more deserialisation code, but the relevant bits are:
#[derive(Debug, Deserialize, PartialEq, NifMap)]
struct IfiParties {
ifi_standardized_name: Option<Vec<IfiStandardizedName>>,
ifi_standardized_name_current: Option<Vec<IfiStandardizedNameCurrent>>,
ifi_standardized_name_probable: Option<Vec<IfiStandardizedNameProbable>>,
}
#[derive(Debug, Deserialize, PartialEq, NifMap)]
struct IfiStandardizedName {
#[serde(rename = "@country")]
country: Option<String>,
#[serde(rename = "@type")]
r#type: Option<String>,
#[serde(rename = "@number")]
number: Option<u64>,
addressbook: Addressbook,
}
#[derive(Debug, Deserialize, PartialEq, NifMap)]
struct IfiStandardizedNameCurrent {
#[serde(rename = "@country")]
country: Option<String>,
#[serde(rename = "@type")]
r#type: Option<String>,
#[serde(rename = "@number")]
number: Option<u64>,
addressbook: Addressbook,
}
#[derive(Debug, Deserialize, PartialEq, NifMap)]
struct IfiStandardizedNameProbable {
#[serde(rename = "@country")]
country: Option<String>,
#[serde(rename = "@type")]
r#type: Option<String>,
#[serde(rename = "@number")]
addressbook: Addressbook,
}
#[derive(Debug, Deserialize, PartialEq, NifMap)]
struct Addressbook {
#[serde(rename = "$value", default)]
name: String,
}
No matter what I do, I'm getting None for ifi_standardized_name, ifi_standardized_name_current, and ifi_standardized_name_probable. I've got overlapped-lists enabled. If I rename them to kebab-case, I get a deserialization error. I'm at a loss here and am not really sure how to figure it out, so I was hoping someone might be able to point out something obvious I'm doing wrong here.
Thank you in advance!
- 主要言語
- Rust
- スター
- 1.6k
- フォーク
- 299
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tafia/quick-xml のほかの issue
-
Parser accepts an empty element or attribute name対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytes対応中かも @emschwartz が 4 日前に担当しました。 オープンbug encoding
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
tafia/quick-xml#1040 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
encoding optimization
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
tafia/quick-xml#1039 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
optimization question
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 1〜2日 初心者へのやさしさ 53/100
tafia/quick-xml#1035 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
tafia/quick-xml の issue をすべて見る
似ている issue
-
ライブラリを追加オープンpriority middle
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
KATO-Hiro/AtCoderClans#13015 ·
メンテナーはふだん 1 日以内に返信
-
needs-review
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UCS-Care-Group/mailcraft#1429 ·
メンテナーはふだん 1 日以内に返信
-
priority: medium ready
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
TusanHomichi/PSIV#646 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
area:tui bug P1
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
agent-of-empires/agent-of-empires#5705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信