Skip to content

Commit baf6bd8

Browse files
committed
Merge commit '48dba1e21f8f1a7d8a817eaf65831396e74b78d2'
2 parents 1b3b805 + 48dba1e commit baf6bd8

37 files changed

+221
-119
lines changed

HTMLparser.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,12 +4753,9 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
47534753
if ((ctxt == NULL) || (ctxt->input == NULL))
47544754
return(-1);
47554755

4756-
/*
4757-
* Document locator is unused. Only for backward compatibility.
4758-
*/
47594756
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
4760-
xmlSAXLocator copy = xmlDefaultSAXLocator;
4761-
ctxt->sax->setDocumentLocator(ctxt->userData, &copy);
4757+
ctxt->sax->setDocumentLocator(ctxt->userData,
4758+
(xmlSAXLocator *) &xmlDefaultSAXLocator);
47624759
}
47634760

47644761
xmlDetectEncoding(ctxt);
@@ -5297,8 +5294,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
52975294
avail = in->end - in->cur;
52985295
}
52995296
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
5300-
xmlSAXLocator copy = xmlDefaultSAXLocator;
5301-
ctxt->sax->setDocumentLocator(ctxt->userData, &copy);
5297+
ctxt->sax->setDocumentLocator(ctxt->userData,
5298+
(xmlSAXLocator *) &xmlDefaultSAXLocator);
53025299
}
53035300
if ((ctxt->sax) && (ctxt->sax->startDocument) &&
53045301
(!ctxt->disableSAX))

NEWS

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
NEWS file for libxml2
22

3+
v2.13.1: Jun 19 2024
4+
5+
### Regressions
6+
7+
- parser: Selectively reenable reading from "-"
8+
- reader: Fix xmlTextReaderReadString
9+
- xinclude: Set XPath context doc
10+
- xinclude: Load included documents with XML_PARSE_DTDLOAD
11+
- include: Don't redefine ATTRIBUTE_UNUSED
12+
- include: Readd circular dependency between tree.h and parser.h
13+
- xinclude: Add missing include (Jan Alexander Steffens (heftig))
14+
- win32, msvc: fix missing linking against Bcrypt.lib (Miklos Vajna)
15+
- xinclude: Don't raise error on empty nodeset
16+
- parser: Make failure to load main document a warning
17+
- tree: Fix freeing entities via xmlFreeNode
18+
- parser: Pass global object to sax->setDocumentLocator
19+
20+
### Improvements
21+
22+
- io: Fix resetting xmlParserInputBufferCreateFilename hook
23+
24+
### Documentation
25+
26+
- Fix typo in NEWS (--with-html -> --with-http) (Ryan Carsten Schmidt)
27+
- doc: Don't mention xmlNewInputURL
28+
29+
330
v2.13.0: Jun 12 2024
431

532
### Major changes
@@ -26,7 +53,7 @@ XML_PARSE_NOENT.
2653
Support for HTTP POST was removed.
2754

2855
Support for zlib, liblzma and HTTP is now disabled by default and has
29-
to be enabled by passing --with-zlib, --with-lzma or --with-html to
56+
to be enabled by passing --with-zlib, --with-lzma or --with-http to
3057
configure. In legacy mode (--with-legacy) these options are enabled
3158
by default as before.
3259

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
33

44
m4_define([MAJOR_VERSION], 2)
55
m4_define([MINOR_VERSION], 13)
6-
m4_define([MICRO_VERSION], 0)
6+
m4_define([MICRO_VERSION], 1)
77

88
AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
99
AC_CONFIG_SRCDIR([entities.c])

doc/devhelp/libxml2-parser.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ <h3>
15571557
<a name="xmlCtxtReadFile"></a>xmlCtxtReadFile ()</h3>
15581558
<pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> xmlCtxtReadFile (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const char * filename, <br> const char * encoding, <br> int options)<br>
15591559
</pre>
1560-
<p>Parse an XML file from the filesystem, the network or a user-defined resource loader. See xmlNewInputURL and <a href="libxml2-parser.html#xmlCtxtUseOptions">xmlCtxtUseOptions</a> for details.</p>
1560+
<p>Parse an XML file from the filesystem, the network or a user-defined resource loader.</p>
15611561
<div class="variablelist"><table border="0">
15621562
<col align="left">
15631563
<tbody>
@@ -2056,7 +2056,7 @@ <h3>
20562056
<a name="xmlLoadExternalEntity"></a>xmlLoadExternalEntity ()</h3>
20572057
<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> xmlLoadExternalEntity (const char * URL, <br> const char * ID, <br> <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
20582058
</pre>
2059-
<p></p>
2059+
<p>@URL is a filename or URL. If if contains the substring "://", it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path. @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups. The following resource loaders will be called if they were registered (in order of precedence): - the global external entity loader set with <a href="libxml2-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a> - the per-thread <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> set with <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a> - the default loader which will return - the result from a matching global input callback set with <a href="libxml2-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</p>
20602060
<div class="variablelist"><table border="0">
20612061
<col align="left">
20622062
<tbody>

doc/devhelp/libxml2-parserInternals.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ <h3>
798798
<a name="xmlCreateEntityParserCtxt"></a>xmlCreateEntityParserCtxt ()</h3>
799799
<pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlCreateEntityParserCtxt (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URL, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ID, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * base)<br>
800800
</pre>
801-
<p>DEPRECATED: Use xmlNewInputURL. Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
801+
<p>DEPRECATED: Don't use. Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
802802
<div class="variablelist"><table border="0">
803803
<col align="left">
804804
<tbody>
@@ -2199,7 +2199,7 @@ <h3>
21992199
<a name="xmlPushInput"></a>xmlPushInput ()</h3>
22002200
<pre class="programlisting">int xmlPushInput (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br>
22012201
</pre>
2202-
<p>Push an input stream onto the stack. This makes the parser use an input returned from advanced functions like xmlNewInputURL or xmlNewInputMemory.</p>
2202+
<p>Push an input stream onto the stack.</p>
22032203
<div class="variablelist"><table border="0">
22042204
<col align="left">
22052205
<tbody>

doc/libxml2-api.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9053,7 +9053,7 @@ Could we use @subtypes for this?'/>
90539053
<return type='xmlEntitiesTablePtr' info='the xmlEntitiesTablePtr just created or NULL in case of error.'/>
90549054
</function>
90559055
<function name='xmlCreateEntityParserCtxt' file='parserInternals' module='parser'>
9056-
<info>DEPRECATED: Use xmlNewInputURL. Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</info>
9056+
<info>DEPRECATED: Don&apos;t use. Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</info>
90579057
<return type='xmlParserCtxtPtr' info='the new parser context or NULL'/>
90589058
<arg name='URL' type='const xmlChar *' info='the entity URL'/>
90599059
<arg name='ID' type='const xmlChar *' info='the entity PUBLIC ID'/>
@@ -9148,7 +9148,7 @@ Could we use @subtypes for this?'/>
91489148
<arg name='options' type='int' info='a combination of xmlParserOption'/>
91499149
</function>
91509150
<function name='xmlCtxtReadFile' file='parser' module='parser'>
9151-
<info>Parse an XML file from the filesystem, the network or a user-defined resource loader. See xmlNewInputURL and xmlCtxtUseOptions for details.</info>
9151+
<info>Parse an XML file from the filesystem, the network or a user-defined resource loader.</info>
91529152
<return type='xmlDocPtr' info='the resulting document tree'/>
91539153
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
91549154
<arg name='filename' type='const char *' info='a file or URL'/>
@@ -10897,7 +10897,7 @@ Could we use @subtypes for this?'/>
1089710897
<arg name='pathss' type='const char *' info='a list of directories separated by a colon or a space.'/>
1089810898
</function>
1089910899
<function name='xmlLoadExternalEntity' file='parser' module='parserInternals'>
10900-
<info></info>
10900+
<info>@URL is a filename or URL. If if contains the substring &quot;://&quot;, it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path. @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups. The following resource loaders will be called if they were registered (in order of precedence): - the global external entity loader set with xmlSetExternalEntityLoader - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</info>
1090110901
<return type='xmlParserInputPtr' info='the xmlParserInputPtr or NULL'/>
1090210902
<arg name='URL' type='const char *' info='the URL for the entity to load'/>
1090310903
<arg name='ID' type='const char *' info='the Public ID for the entity to load'/>
@@ -12626,7 +12626,7 @@ Could we use @subtypes for this?'/>
1262612626
<arg name='uri' type='xmlURIPtr' info='pointer to an xmlURI'/>
1262712627
</function>
1262812628
<function name='xmlPushInput' file='parserInternals' module='parser'>
12629-
<info>Push an input stream onto the stack. This makes the parser use an input returned from advanced functions like xmlNewInputURL or xmlNewInputMemory.</info>
12629+
<info>Push an input stream onto the stack.</info>
1263012630
<return type='int' info='-1 in case of error or the index in the input stack'/>
1263112631
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
1263212632
<arg name='input' type='xmlParserInputPtr' info='an XML parser input fragment (entity, XML fragment ...).'/>

include/libxml/entities.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
#ifndef __XML_ENTITIES_H__
1212
#define __XML_ENTITIES_H__
1313

14+
/** DOC_DISABLE */
1415
#include <libxml/xmlversion.h>
16+
#define XML_TREE_INTERNALS
1517
#include <libxml/tree.h>
18+
#undef XML_TREE_INTERNALS
19+
/** DOC_ENABLE */
1620

1721
#ifdef __cplusplus
1822
extern "C" {

include/libxml/parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
#ifndef __XML_PARSER_H__
1111
#define __XML_PARSER_H__
1212

13+
/** DOC_DISABLE */
1314
#include <libxml/xmlversion.h>
15+
#define XML_TREE_INTERNALS
1416
#include <libxml/tree.h>
17+
#undef XML_TREE_INTERNALS
1518
#include <libxml/dict.h>
1619
#include <libxml/hash.h>
1720
#include <libxml/valid.h>
@@ -24,6 +27,7 @@
2427
/* for compatibility */
2528
#include <libxml/SAX2.h>
2629
#include <libxml/threads.h>
30+
/** DOC_ENABLE */
2731

2832
#ifdef __cplusplus
2933
extern "C" {

include/libxml/tree.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
* Author: Daniel Veillard
1010
*/
1111

12+
#ifndef XML_TREE_INTERNALS
13+
14+
/*
15+
* Emulate circular dependency for backward compatibility
16+
*/
17+
#include <libxml/parser.h>
18+
19+
#else /* XML_TREE_INTERNALS */
20+
1221
#ifndef __XML_TREE_H__
1322
#define __XML_TREE_H__
1423

@@ -1369,3 +1378,5 @@ XML_DEPRECATED XMLPUBFUN int
13691378

13701379
#endif /* __XML_TREE_H__ */
13711380

1381+
#endif /* XML_TREE_INTERNALS */
1382+

include/libxml/valid.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
#ifndef __XML_VALID_H__
1212
#define __XML_VALID_H__
1313

14+
/** DOC_DISABLE */
1415
#include <libxml/xmlversion.h>
1516
#include <libxml/xmlerror.h>
17+
#define XML_TREE_INTERNALS
1618
#include <libxml/tree.h>
19+
#undef XML_TREE_INTERNALS
1720
#include <libxml/list.h>
1821
#include <libxml/xmlautomata.h>
1922
#include <libxml/xmlregexp.h>
23+
/** DOC_ENABLE */
2024

2125
#ifdef __cplusplus
2226
extern "C" {

0 commit comments

Comments
 (0)