Help with mixed sequence with attributes?
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- Rust
- Stelle
- 1.6k
- Fork
- 299
- Merge medio
- 2g 4h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tafia/quick-xml
-
Parser accepts an empty element or attribute nameForse già presa @ychampion l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesForse già presa @emschwartz l’ha presa 4 giorni fa. Apertabug encoding
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
tafia/quick-xml#1040 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
encoding optimization
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
tafia/quick-xml#1039 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
optimization question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 1-2 giorni Idoneità per principianti 53/100
tafia/quick-xml#1035 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tafia/quick-xml
Issue simili
-
comp-formats
Difficoltà 2/5 Mezza giornata Idoneità per principianti 64/100
ClickHouse/ClickHouse#131694 ·
I maintainer di solito rispondono entro 1 giorno
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Copperpour/Copperpour#500 ·
I maintainer di solito rispondono entro 1 giorno
-
state:triage-needed
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno