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
I have XML input that contains XML within processing instructions. See the test code below.
As far as I can tell, these are well-formed according to the spec at https://www.w3.org/TR/xml11/#sec-pi and such XMLs can be successfully parsed with xml-rs and rapidxml in C++.
I looked into it but I am not yet proficient with macros, and I couldn't figure out if one should use &[u8] instead of u8 for XmlSource::read_bytes_until or have another method like XmlSource::read_bytes_until_slice. I found that the memchr crate seems to have explicit support for two bytes and also for slices in general.
#[cfg(test)]mod test {usesuper::*;#[test]fntest_procinst_xml(){let xml = r#"<?xml version="1.0" encoding="utf-8"?><?procinst-with-xml <parameters> <parameter id="version" value="0.1"/> <parameter id="timeStamp" value="2024-01-16T10:44:00Z"/> </parameters>?><Document/>"#;letmut reader = Reader::from_str(xml);loop{match reader.read_event(){Err(e) => panic!("Error at position {}: {:?}", reader.buffer_position(), e),Ok(Event::Eof) => break,
_ => (),}}}}
The text was updated successfully, but these errors were encountered:
I have XML input that contains XML within processing instructions. See the test code below.
As far as I can tell, these are well-formed according to the spec at https://www.w3.org/TR/xml11/#sec-pi and such XMLs can be successfully parsed with
xml-rs
andrapidxml
in C++.I looked into it but I am not yet proficient with macros, and I couldn't figure out if one should use
&[u8]
instead ofu8
forXmlSource::read_bytes_until
or have another method likeXmlSource::read_bytes_until_slice
. I found that thememchr
crate seems to have explicit support for two bytes and also for slices in general.The text was updated successfully, but these errors were encountered: