Ignore undeclared element when a $value field is present
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading the deserialization handling for the rename="$value" field and compare it with the $text path; the issue provides a minimal Rust example that reproduces the UnexpectedStart error for <Foo/>. Determine whether undeclared elements should be ignored in this case, then add a regression test for the chosen behavior. The issue has had no comment for over three years, so check for maintainer guidance before starting.
由索引模型根据 Issue 内容生成。
描述
The default behaviour of ignoring XML elements that are not declared is very useful when dealing with XML that follows an extensible schema. However, including a rename="$value" field changes this behaviour, and undeclared elements generate an UnexpectedStart parse error.
#[derive(Debug, Default, Serialize, Deserialize)]
struct Root {
#[serde(rename = "$value")]
content: Option<String>,
}
let xml = r#"<Root><Foo/></Root>"#;
let r1: Result<Root, quick_xml::DeError> = quick_xml::de::from_str(xml);
// Parse error: UnexpectedStart([70, 111, 111])
If the rename = "$value" is replaced by rename = "$text" then the problem does not arise (parsing is successful and the Foo element is ignored). Is this the intended behaviour?
- 主要语言
- Rust
- 星标
- 1.6k
- 派生
- 299
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tafia/quick-xml 的其他 Issue
-
Parser accepts an empty element or attribute name可能已有人在做 @ychampion 今天认领。 未关闭
难度 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 天内回复
相似的 Issue
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openai可能已有人在做 @arvindkumar-ship-it 今天认领。 未关闭llm translation
难度 2/5 1-3 小时 新手友好度 70/100
BerriAI/litellm#51871 · 1 条评论 ·
维护者通常 1 天内回复
-
comp-formats
难度 2/5 半天 新手友好度 64/100
ClickHouse/ClickHouse#131694 ·
维护者通常 1 天内回复
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundaries未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
C-Bug S-Needs-Triage
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy#26558 ·
维护者通常 2 天内回复