MCPcopy Create free account
hub / github.com/Florob/RustyXML / in_processing_instructions

Method in_processing_instructions

src/parser.rs:302–318  ·  view source on GitHub ↗

Inside a processing instruction '?' '>' => OutsideTag, producing PI

(&mut self, c: char)

Source from the content-addressed store, hash-verified

300 // Inside a processing instruction
301 // '?' '>' => OutsideTag, producing PI
302 fn in_processing_instructions(&mut self, c: char) -> Result<Option<Event>, ParserError> {
303 match c {
304 '?' => {
305 self.level = 1;
306 self.buf.push(c);
307 }
308 '>' if self.level == 1 => {
309 self.level = 0;
310 self.st = State::OutsideTag;
311 let _ = self.buf.pop();
312 let buf = self.take_buf();
313 return Ok(Some(Event::PI(buf)));
314 }
315 _ => self.buf.push(c),
316 }
317 Ok(None)
318 }
319
320 // Inside a tag name (opening tag)
321 // '/' => ExpectClose, producing Event::ElementStart

Callers 1

parse_characterMethod · 0.80

Calls 1

take_bufMethod · 0.80

Tested by

no test coverage detected