Home | History | Annotate | Download | only in test

Lines Matching refs:parser

15         self.parser = expat.ParserCreate(namespace_separator='!')
25 self.parser.returns_unicode = x
26 self.assertEqual(self.parser.returns_unicode, y)
30 self.parser.ordered_attributes = x
31 self.assertEqual(self.parser.ordered_attributes, y)
35 self.parser.specified_attributes = x
36 self.assertEqual(self.parser.specified_attributes, y)
136 parser = expat.ParserCreate(namespace_separator='!')
138 setattr(parser, name, getattr(out, name))
139 parser.returns_unicode = 0
140 parser.Parse(data, 1)
165 parser = expat.ParserCreate(namespace_separator='!')
166 parser.returns_unicode = 1
168 setattr(parser, name, getattr(out, name))
170 parser.Parse(data, 1)
194 parser = expat.ParserCreate(namespace_separator='!')
195 parser.returns_unicode = 1
197 setattr(parser, name, getattr(out, name))
200 parser.ParseFile(file)
225 parser = expat.ParserCreate()
227 parser.ParseFile(fp)
287 self.parser = expat.ParserCreate()
288 self.parser.buffer_text = 1
289 self.parser.CharacterDataHandler = self.CharacterDataHandler
303 self.parser.buffer_text = 1
305 self.parser.buffer_text = 0
315 setattr(self.parser, name, getattr(self, name))
318 parser = expat.ParserCreate()
319 self.assertFalse(parser.buffer_text)
323 self.assertTrue(self.parser.buffer_text)
324 self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
332 self.parser.Parse("<a>1<b buffer-text='no'/>2\n3<c buffer-text='yes'/>4\n5</a>", 1)
338 self.parser.Parse("<a>1<b/>&lt;2&gt;<c/>&#32;\n&#x20;3</a>", 1)
344 self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
350 self.parser.CharacterDataHandler = None
351 self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
357 self.parser.Parse("<a>1<b></b>2<c/>3</a>", 1)
364 self.parser.Parse("<a>1<b/>2<c></c>345</a> ", 1)
372 self.parser.Parse("<a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> ", 1)
385 parser = expat.ParserCreate()
386 parser.StartElementHandler = self.StartElementHandler
388 parser.Parse("<a><b><c/></b></a>", 1)
406 self.parser.CurrentByteIndex,
407 self.parser.CurrentLineNumber,
408 parser.CurrentColumnNumber)
410 'too many parser events')
417 self.parser = expat.ParserCreate()
418 self.parser.StartElementHandler = self.StartElementHandler
419 self.parser.EndElementHandler = self.EndElementHandler
425 self.parser.Parse(xml, 1)
442 parser = expat.ParserCreate()
443 parser.CharacterDataHandler = handler
445 self.assertRaises(Exception, parser.Parse, xml)
459 parser = expat.ParserCreate()
460 parser.buffer_text = 1
462 parser.buffer_size = size
471 parser = expat.ParserCreate()
472 parser.CharacterDataHandler = self.counting_handler
473 parser.buffer_size = 512
474 parser.buffer_text = 1
479 parser.Parse(xml1)
483 parser.buffer_size = parser.buffer_size
487 parser.Parse(xml2)
495 parser = expat.ParserCreate()
496 parser.CharacterDataHandler = self.counting_handler
497 parser.buffer_text = 1
498 parser.buffer_size = 1024
499 self.assertEqual(parser.buffer_size, 1024)
503 parser.Parse(xml1, 0)
504 self.assertEqual(parser.buffer_size, 1024)
508 parser.buffer_text = 0
509 self.assertFalse(parser.buffer_text)
510 self.assertEqual(parser.buffer_size, 1024)
512 parser.Parse(xml2, 0)
515 parser.buffer_text = 1
516 self.assertTrue(parser.buffer_text)
517 self.assertEqual(parser.buffer_size, 1024)
518 parser.Parse(xml3, 1)
531 parser = expat.ParserCreate()
532 parser.CharacterDataHandler = self.counting_handler
533 parser.buffer_size = 1024
534 parser.buffer_text = 1
537 parser.Parse(xml)
543 parser = expat.ParserCreate()
544 parser.CharacterDataHandler = self.counting_handler
545 parser.buffer_text = 1
546 parser.buffer_size = 1024
547 self.assertEqual(parser.buffer_size, 1024)
550 parser.Parse(xml1, 0)
551 parser.buffer_size *= 2
552 self.assertEqual(parser.buffer_size, 2048)
553 parser.Parse(xml2, 1)
559 parser = expat.ParserCreate()
560 parser.CharacterDataHandler = self.counting_handler
561 parser.buffer_text = 1
562 parser.buffer_size = 2048
563 self.assertEqual(parser.buffer_size, 2048)
566 parser.Parse(xml1, 0)
567 parser.buffer_size //= 2
568 self.assertEqual(parser.buffer_size, 1024)
569 parser.Parse(xml2, 1)
575 parser = expat.ParserCreate()
577 parser.Parse(xml, True)
584 parser = expat.ParserCreate()
586 parser.Parse(xml, True)
593 Tests for the UseForeignDTD method of expat parser objects.
606 parser = expat.ParserCreate()
607 parser.UseForeignDTD(True)
608 parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
609 parser.ExternalEntityRefHandler = resolve_entity
610 parser.Parse("<?xml version='1.0'?><element/>")
616 parser = expat.ParserCreate()
617 parser.UseForeignDTD()
618 parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
619 parser.ExternalEntityRefHandler = resolve_entity
620 parser.Parse("<?xml version='1.0'?><element/>")
634 parser = expat.ParserCreate()
635 parser.UseForeignDTD(True)
636 parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
637 parser.ExternalEntityRefHandler = resolve_entity
638 parser.Parse(