You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sequence -- must not occur within a comment, but xml-rs fails to return an error when emitted with EventWriter in an XmlEvent::Comment. xml-rs correctly gives an error when attempting to parse the erroneous document.
Sample program to reproduce the problem:
externcrate xml;use xml::reader::EventReader;use xml::writer::EventWriter;use xml::writer::events::XmlEvent;fnmain(){letmut v = Vec::new();{letmut ew = EventWriter::new(&mut v);
ew.write(XmlEvent::start_element("root")).unwrap();
ew.write(XmlEvent::comment("invalid -- invalid")).unwrap();
ew.write(XmlEvent::end_element()).unwrap();}let er = EventReader::new(&v[..]);for ev in er {println!("{:?}", ev);}}
What is the correct behavior here? Unlike with PCDATA, there is no way to escape - in a comment. Is it best to return an error here? Or to use some ad-hoc escaping strategy?
The sequence
--
must not occur within a comment, but xml-rs fails to return an error when emitted withEventWriter
in anXmlEvent::Comment
. xml-rs correctly gives an error when attempting to parse the erroneous document.Sample program to reproduce the problem:
Output:
The text was updated successfully, but these errors were encountered: