summaryrefslogtreecommitdiff
path: root/examples/libxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libxml.c')
-rw-r--r--examples/libxml.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/libxml.c b/examples/libxml.c
index 1e787e2..e970e4c 100644
--- a/examples/libxml.c
+++ b/examples/libxml.c
@@ -213,19 +213,20 @@ int main(int argc, char **argv)
* change_encoding() will have put the new charset into
* c->encoding.
*/
- hubbub_parser *temp;
+ context *c2;
- if (hubbub_parser_create(c->encoding, true, myrealloc, NULL,
- &temp) != HUBBUB_OK) {
- destroy_context(c);
+ error = create_context(c->encoding, &c2);
+ if (error != OK) {
+ destroy_context(c2);
free(buf);
fclose(input);
- fprintf(stderr, "Failed recreating parser\n");
+ fprintf(stderr, "Failed recreating context\n");
return 1;
}
- hubbub_parser_destroy(c->parser);
- c->parser = temp;
+ destroy_context(c);
+
+ c = c2;
/* Retry the parse */
error = parse_chunk(c, buf, len);