1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00
Commit Graph

5428 Commits

Author SHA1 Message Date
Nick Wellnhofer
88637d428d Improve cross-references in API docs
Also cross-reference keywords followed by a period. This is still a hack
but catches quite a few more keywords.
2022-08-24 15:09:46 +02:00
Nick Wellnhofer
6cdaa192cd Rebuild documentation 2022-08-24 14:34:04 +02:00
Nick Wellnhofer
b33be8a04f Switch back to HTML output for API documentation 2022-08-24 14:29:50 +02:00
Nick Wellnhofer
0e49f8826a Mark most SAX1 functions as deprecated
No compiler warnings generated yet.
2022-08-24 14:07:57 +02:00
Nick Wellnhofer
ce93ee9051 xmllint: Stop calling xmlSAXDefaultVersion
This should already be handled by setting XML_PARSE_SAX1.
2022-08-24 14:07:57 +02:00
Nick Wellnhofer
9a82b94a94 Introduce xmlNewSAXParserCtxt and htmlNewSAXParserCtxt
Add API functions to create a parser context with a custom SAX handler
without having to mess with ctxt->sax manually.
2022-08-24 14:07:55 +02:00
Nick Wellnhofer
0a04db19fc Don't mess with parser options in htmlParseDocument
Don't set ctxt->html. This member should already be initialized.

Set ctxt->linenumbers in htmlCtxtUseOptions like the XML parser does.
2022-08-24 14:06:00 +02:00
Nick Wellnhofer
d45263a262 Remove useless call to htmlDefaultSAXHandlerInit
This function is already called from xmlInitParser.
2022-08-24 14:04:35 +02:00
Nick Wellnhofer
3513d76aa2 Improve documentation of globals
Document more global variables as deprecated. Some of the variables
don't generate deprecation warnings yet, but they shouldn't be used in
new code.
2022-08-24 02:27:50 +02:00
Nick Wellnhofer
f703ed694b Fix documentation parser
Reset comment right after adding to the index.
2022-08-24 01:29:49 +02:00
Nick Wellnhofer
bd6a427232 Rebuild API documentation 2022-08-24 01:02:22 +02:00
Nick Wellnhofer
4f3eb8a3b4 Support comments for global variables in documentation
This was never implemented.
2022-08-24 01:02:22 +02:00
Nick Wellnhofer
288c951eff Fix update call in apibuild.py
There are still a few places where try/except is used for branching.
This is a bad idea since it can hide errors like this one.
2022-08-24 00:51:52 +02:00
Nick Wellnhofer
92bb889be3 Don't index anything in DOC_DISABLE sections
Somewhat misleadingly, the DOC_DISABLE directive only disabled warnings.
Now we really stop the documentation generator from indexing.

This results in additional warnings for xmlThrDef* functions. This should
be fixed by documenting or deprecating them.
2022-08-24 00:51:52 +02:00
Nick Wellnhofer
75b5bc2b0a Deprecate some global variables
Most of these should be completely unused.
2022-08-24 00:31:10 +02:00
Nick Wellnhofer
484efeb607 cmake: Disable version script on macOS
Fixes #400
2022-08-23 20:07:39 +02:00
Nick Wellnhofer
e519c6e1c6 Fix testapi when building --without-sax1
Broken in commit c61e1273.
2022-08-22 15:30:22 +02:00
Nick Wellnhofer
4b184240be Remove htmlDefaultSAXHandler from non-SAX1 build
This matches long-standing behavior of the XML counterpart.
2022-08-22 14:24:25 +02:00
Nick Wellnhofer
80bd34c3c6 Don't initialize SAX handler in htmlReadMemory
The SAX handler is already initialized when creating the parser
context.
2022-08-22 14:06:37 +02:00
Nick Wellnhofer
37cedc0b15 Fix htmlReadMemory mixing up XML and HTML functions
Also see fe6890e2.
2022-08-22 14:04:07 +02:00
Nick Wellnhofer
920753c4aa Don't use default SAX handler to report unrelated errors 2022-08-22 13:48:59 +02:00
Nick Wellnhofer
38f04779f7 Fix HTML parser with threads and --without-legacy
If the legacy functions are disabled, the default "V1" HTML SAX handler
isn't initialized in threads other than the main thread.
htmlInitParserCtxt would later use the empty V1 SAX handler, resulting
in NULL documents.

Change htmlInitParserCtxt to initialize the HTML SAX handler by calling
xmlSAX2InitHtmlDefaultSAXHandler. This removes the ability to change the
default handler but is more in line with the XML parser which
initializes the SAX handler by calling xmlSAXVersion, ignoring the V1
default handler.

Fixes #399.
2022-08-22 13:48:59 +02:00
Nick Wellnhofer
c21e9cd5d9 Use xmlStrlen in xmlNewStringInputStream
xmlStrlen handles buffers larger than INT_MAX more gracefully.
2022-08-20 17:03:10 +02:00
Nick Wellnhofer
5b2d07a726 Use xmlStrlen in *CtxtReadDoc
xmlStrlen handles buffers larger than INT_MAX more gracefully.
2022-08-20 17:00:50 +02:00
Nick Wellnhofer
b1b654171e Create stream with buffer in xmlNewStringInputStream
Create an input stream with a buffer in xmlNewStringInputStream.
Otherwise, switching encodings won't work.

See #34.
2022-08-20 16:34:08 +02:00
Nick Wellnhofer
4ad71c2d72 Fix xmlCtxtReadDoc with encoding
xmlCtxtReadDoc used to create an input stream involving
xmlNewStringInputStream. This would create a stream without an input
buffer, causing problems with encodings (see #34).

After commit aab584dc3, an error was returned even with UTF-8 encodings
which happened to work before.

Make xmlCtxtReadDoc call xmlCtxtReadMemory which doesn't suffer from
these issues. Also fix htmlCtxtReadDoc.

Fixes #397.
2022-08-20 16:34:08 +02:00
Nick Wellnhofer
d54f829ff7 Rebuild documentation 2022-08-19 11:28:49 +02:00
Nick Wellnhofer
b071d74b1a Port build_glob.py to Python 3 2022-08-18 22:46:42 +02:00
Nick Wellnhofer
b22b6deba9 Port genChRanges.py to Python 3 2022-08-18 22:46:42 +02:00
Nick Wellnhofer
18d79460ab Port doc/examples/index.py to Python 3
- Make sure that examples.xml is generated deterministically
- Sort includes by line number
2022-08-18 22:09:28 +02:00
Nick Wellnhofer
5264fa1100 Fix warnings from apibuild.py 2022-08-18 21:31:36 +02:00
Nick Wellnhofer
a7af2c99e3 Fix order of exports in libxml2-api.xml
The values passed to the `uniq` function are dictionary keys and should
already be unique. On older Python versions, this would reshuffle the
list after it had just been sorted.
2022-08-18 21:31:36 +02:00
Nick Wellnhofer
f82b56c6c9 Remove libxml2-refs.xml
The cross-reference was only used by the old website.
2022-08-18 21:31:36 +02:00
Nick Wellnhofer
b60cdf1f9a Remove Makefile rule to build testapi.c
This file is under version control and should only be rebuilt on
demand.
2022-08-18 19:17:37 +02:00
Nick Wellnhofer
35297983ba Start with documentation for maintainers 2022-08-17 14:52:31 +02:00
Nick Wellnhofer
ae383bdb74 Release v2.10.0 2022-08-17 13:22:20 +02:00
Nick Wellnhofer
d20df9d864 Cleanup files generated by test suite
Fixes make distcheck.
2022-08-17 13:22:20 +02:00
Nick Wellnhofer
4e494b9ccb Add uninstall target for examples
Fixes make distcheck.
2022-08-17 13:22:20 +02:00
Nick Wellnhofer
229fe8f165 Rebuild documentation 2022-08-17 11:41:23 +02:00
Nick Wellnhofer
24323d31c4 Don't autogenerate doc/examples/Makefile.am 2022-08-17 11:39:55 +02:00
Nick Wellnhofer
0fbfb4b587 Make gentest.py work with Python 2 2022-08-17 11:22:38 +02:00
Nick Wellnhofer
a09c89545d Fix memory leak with invalid XSD
xmlSchemaClearElemInfo can add new items to the "matcher" cache, so the
cache must be cleared after calling this function, not before. This
only seems to affect invalid XSDs.

Fixes #390.
2022-08-15 12:19:25 +02:00
Nick Wellnhofer
3c4e4bb726 Fix build with older pkg-config versions
The PKG_CHECK_VAR macro was introduced in pkg-config 0.28. Guard the
invocation with m4_ifdef.

Fixes #374.
2022-08-05 16:24:51 +02:00
Nick Wellnhofer
e986d09cf5 Skip incorrectly opened HTML comments
Commit 4fd69f3e fixed handling of '<' characters not followed by an
ASCII letter. But a '<!' sequence followed by invalid characters should
be treated as bogus comment and skipped.

Fixes #380.
2022-08-02 14:38:09 +02:00
Nick Wellnhofer
6722d22c88 Reduce indentation in HTMLparser.c
No functional change.
2022-08-02 14:38:09 +02:00
Nick Wellnhofer
39745c927a Improve documentation of tree manipulation API
- Discourage use of node constructors without document.
- Mention that xmlReconciliateNs is crucial when moving nodes from one
  document to another.
2022-08-02 14:38:09 +02:00
Nick Wellnhofer
677a42645e Make XPath depth check work with recursive invocations
EXSLT functions like dyn:map or dyn:evaluate invoke xmlXPathRunEval
recursively. Don't set depth to zero but keep and restore the original
value to avoid stack overflows when abusing these functions.
2022-07-28 21:36:10 +02:00
Nick Wellnhofer
a82ea25fc8 Also reset nsNr in htmlCtxtReset 2022-07-28 21:36:10 +02:00
Nick Wellnhofer
5930fe0196 Reset nsNr in xmlCtxtReset 2022-07-18 20:59:45 +02:00
Daniel E
eab0ce8ff7 cmake: Install libxml.m4 on UNIX-like platforms
Install libxml.m4 to follow GNU Autotools more closely
2022-07-14 22:15:28 +00:00