diff --git a/include/libxml/parser.h b/include/libxml/parser.h index ca3dc910..cf798d28 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -489,8 +489,7 @@ struct _xmlParserCtxt { * process default attributes. * - XML_SKIP_IDS: Load external subset and ignore IDs. */ - /* TODO: See issue #873 */ - int loadsubset; + int loadsubset XML_DEPRECATED_MEMBER; /* unused */ int linenumbers XML_DEPRECATED_MEMBER; /** @@ -1861,7 +1860,13 @@ typedef enum { * * @since 2.14.0 */ - XML_PARSE_CATALOG_PI = 1<<26 + XML_PARSE_CATALOG_PI = 1<<26, + /** + * Force the parser to ignore IDs. + * + * @since 2.15.0 + */ + XML_PARSE_SKIP_IDS = 1<<27 } xmlParserOption; XMLPUBFUN void diff --git a/parser.c b/parser.c index f47f6b80..94c27645 100644 --- a/parser.c +++ b/parser.c @@ -12065,6 +12065,7 @@ xmlCtxtParseContent(xmlParserCtxt *ctxt, xmlParserInput *input, * Disable IDs */ ctxt->loadsubset |= XML_SKIP_IDS; + ctxt->options |= XML_PARSE_SKIP_IDS; ctxt->myDoc = doc; @@ -13142,6 +13143,7 @@ xmlCtxtSetOptionsInternal(xmlParserCtxtPtr ctxt, int options, int keepMask) ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0; ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0; ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0; + ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0; ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0; ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0; ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;