Help with mixed sequence with attributes?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Rust
- Estrellas
- 1.6k
- Forks
- 299
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 9
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tafia/quick-xml
-
Parser accepts an empty element or attribute namePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesPosiblemente ocupada @emschwartz la tomó hace 4 días. Abiertobug encoding
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
tafia/quick-xml#1040 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
encoding optimization
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
tafia/quick-xml#1039 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
optimization question
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 1-2 días Aptitud para principiantes 53/100
tafia/quick-xml#1035 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de tafia/quick-xml
Issues similares
-
ライブラリを追加Abiertopriority middle
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
KATO-Hiro/AtCoderClans#13015 ·
Los mantenedores suelen responder en 1 día
-
needs-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
UCS-Care-Group/mailcraft#1429 ·
Los mantenedores suelen responder en 1 día
-
priority: medium ready
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
TusanHomichi/PSIV#646 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
area:tui bug P1
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
agent-of-empires/agent-of-empires#5705 · 1 comentario ·
Los mantenedores suelen responder en 1 día