Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 4] Set parser options with xmlCtxtUseOptions

Laurence Rowe
March 21, 2012 05:40PM
# HG changeset patch
# User Laurence Rowe <laurence@lrowe.co.uk>
# Date 1331326885 0
# Node ID 28a1437a8b4492530a24d51b85aca7923627c330
# Parent aed89f1bb357e289086f9a768e2e9958c4076b7c
Set parser options with xmlCtxtUseOptions

In the current version of libxml2, loadsubset is a bit field. The
previous value of 1 does not match any of the loadsubset bit field
options (XML_DETECT_IDS=2, XML_COMPLETE_ATTRS=4, XML_SKIP_IDS=8) but
from reading the source, XML_DETECT_IDS is not tested for directly in
any relevant files, with SAX2.c using the test (ctxt->loadsubset !=
0). The loadsubset value is set to XML_DETECT_IDS by the
xmlCtxtUseOptions call with XML_PARSE_DTDLOAD.

diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c
--- a/src/http/modules/ngx_http_xslt_filter_module.c
+++ b/src/http/modules/ngx_http_xslt_filter_module.c
@@ -362,15 +362,14 @@
"xmlCreatePushParserCtxt() failed");
return NGX_ERROR;
}
+ xmlCtxtUseOptions(ctxt, XML_PARSE_NOENT|XML_PARSE_DTDLOAD
+ |XML_PARSE_NOWARNING);

ctxt->sax->externalSubset = ngx_http_xslt_sax_external_subset;
ctxt->sax->setDocumentLocator = NULL;
- ctxt->sax->warning = NULL;
ctxt->sax->error = ngx_http_xslt_sax_error;
ctxt->sax->fatalError = ngx_http_xslt_sax_error;
ctxt->sax->_private = ctx;
- ctxt->replaceEntities = 1;
- ctxt->loadsubset = 1;

ctx->ctxt = ctxt;
ctx->request = r;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 4] XSLT HTML parsing

Laurence Rowe 1296 March 21, 2012 05:30PM

[PATCH 3 of 4] xslt_html_parser directive

Laurence Rowe 575 March 21, 2012 05:30PM

[PATCH 2 of 4] Set done flag on module context to stop further chunk parsing

Laurence Rowe 505 March 21, 2012 05:40PM

Re: [PATCH 2 of 4] Set done flag on module context to stop further chunk parsing

Maxim Dounin 582 March 27, 2012 10:04PM

[PATCH 4 of 4] Handle empty response body

Laurence Rowe 493 March 21, 2012 05:40PM

Re: [PATCH 4 of 4] Handle empty response body

Maxim Dounin 514 March 27, 2012 10:04PM

[PATCH 1 of 4] Set parser options with xmlCtxtUseOptions

Laurence Rowe 556 March 21, 2012 05:40PM

Re: [PATCH 1 of 4] Set parser options with xmlCtxtUseOptions

Maxim Dounin 554 March 27, 2012 09:58PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready