Created
February 3, 2022 05:16
-
-
Save dwarring/a3daec03cfb34b4dfcd61cd350a89de3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use LibXML::Raw; | |
use LibXML::Parser::Context; | |
my $raw = xmlMemoryParserCtxt.new: :string<foo>; | |
my LibXML::Parser::Context $*XML-CONTEXT .= new: :$raw; | |
sub structured-error-cb($ctx, xmlError:D $err) { | |
$*XML-CONTEXT.structured-error($err); | |
} | |
$*XML-CONTEXT.raw.SetStructuredErrorFunc: &structured-error-cb; | |
for 1..250 { | |
$raw.ParseDocument; | |
try { $*XML-CONTEXT.flush-errors; } | |
} | |
warn "done"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment