-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BytesStart unescaped method returns the attributes in the same result #118
Labels
Comments
This is still broken: #[test]
fn test() {
let xml = "<name attribute=\"value\">";
let mut reader = quick_xml::Reader::from_str(xml);
reader.trim_text(true);
let mut buf = Vec::new();
let start_event = match reader.read_event(&mut buf).unwrap() {
Event::Start(e) => e,
_ => unreachable!(),
};
let raw_name_bytes = start_event.name();
let raw_name = std::str::from_utf8(raw_name_bytes).unwrap();
// ok
assert_eq!(raw_name, "name");
let name_bytes = start_event.unescaped().unwrap();
let name = std::str::from_utf8(name_bytes.as_ref()).unwrap();
// fails
assert_eq!(name, "name");
}
|
This was referenced Jun 19, 2022
Mingun
added a commit
to Mingun/quick-xml
that referenced
this issue
Jul 8, 2022
Mingun
added a commit
to Mingun/quick-xml
that referenced
this issue
Jul 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you had for example the following xml snippet
<namespace:hello> greeting='wave'>
and the corresponding BytesStart for that, (let's called theelement
),element.unescaped()
would returnnamespace:hello> greeting='wave'
, while.name()
andlocal_name()
only include the actual tag part (namespace:hello>
andhello>
respectively), and not the attributes.This goes against the documentation which says it should just return the unescaped tag name.
The text was updated successfully, but these errors were encountered: