Nick Wellnhofer
5238404325
parser: Pass resource type to resource loader
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
ab5e6debd1
parser: Introduce XML_INPUT_NETWORK input flag
...
This allows to disable network access when creating parser inputs with
xmlInputCreateUrl.
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
ef8dc4f673
schemas: Add callbacks for resource loader
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
fd7d9e5eca
reader: Add callbacks for resource loader
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
fa2592b384
xinclude: Add callbacks for resource loader
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
40b76edac4
relaxng: Add callbacks for resource loader
2024-06-12 16:36:12 +02:00
Nick Wellnhofer
64ad272525
parser: Introduce per-context resource loader
2024-06-12 16:22:52 +02:00
Nick Wellnhofer
b9d2f3c911
parser: Introduce new input API
...
- xmlInputCreateUrl
- xmlInputCreateMemory
- xmlInputCreateString
- xmlInputCreateFd
- xmlInputCreateIO
- xmlInputSetEncoding
These functions don't take a parser context and work on xmlParserInputs,
replacing functions working on xmlParserInputBuffers.
xmlInputCreateUrl and xmlInputSetEncoding offer fine-grained error
handling.
Several XML_INPUT_* flags offer additional control.
2024-06-12 16:22:52 +02:00
Nick Wellnhofer
ff3b091910
parser: Implement XML_PARSE_NO_UNZIP option
2024-06-12 16:14:15 +02:00
Rosen Penev
f227086380
meson: convert boolean options to feature option
...
Simpler. Seems like they're only disabled by minimum.
Signed-off-by: Rosen Penev <rosenp@gmail.com >
2024-06-06 17:13:41 -07:00
Sadaf Ebrahimi
897c73fe24
Add missing _cplusplus processing clause
2024-06-06 09:40:18 +00:00
Nick Wellnhofer
5b1d7ff0b2
parser: Remove redefinitions for legacy globals
2024-05-20 23:59:55 +02:00
Nick Wellnhofer
e75e878e02
doc: Update and fix documentation
2024-05-20 14:23:39 +02:00
Nick Wellnhofer
b47a95fe31
parser: Don't make xmlCtxtErrIO public
2024-05-20 14:22:56 +02:00
Nick Wellnhofer
592546267f
threads: Deprecate remaining ThrDef functions
2024-05-14 15:44:50 +02:00
Nick Wellnhofer
422ae4623a
xmllint: Make some strings const
2024-05-05 17:26:11 +02:00
Nick Wellnhofer
ae23a4ce56
unicode: Deprecate most xmlUCSIs* functions
...
These don't seem to be used by downstream code.
2024-04-30 17:42:59 +02:00
Nick Wellnhofer
1cdfece12b
memory: Remove memory debugging
...
This is useless compared to sanitizers or valgrind and has a
considerable performance impact if enabled accidentally.
2024-04-28 20:42:55 +02:00
Nick Wellnhofer
5e80f4381b
tree: Deprecate xmlRegisterNodeDefault
...
This rarely used feature should be phased out.
2024-04-28 19:30:40 +02:00
Nick Wellnhofer
88169bfda6
tree: Deprecate xmlSetCompressMode
2024-04-28 19:30:39 +02:00
Nick Wellnhofer
05654cfe00
html: Deprecate htmlHandleOmittedElem
2024-04-28 18:58:27 +02:00
Vincent Torri
5732ce56f3
meson: Initial commit
2024-04-04 12:23:39 +02:00
Nick Wellnhofer
3f05508a53
tree: Report malloc failures in attribute setters
2024-03-18 15:14:43 +01:00
Nick Wellnhofer
dc2a03d482
valid: Deprecate internal validation functions
2024-03-16 15:20:08 +01:00
Nick Wellnhofer
e3342f731c
tree: Work on documentation
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
bc7ab5a2e6
tree: Rewrite xmlSetTreeDoc
...
Report malloc failures.
Fix when called directly on attribute node.
Clear 'content' and 'last' and look up new entity for entity reference
nodes.
2024-03-15 19:47:07 +01:00
Nick Wellnhofer
d0d6174e81
valid: Rework xmlAddID
2024-03-15 19:47:07 +01:00
Nick Wellnhofer
67e475b78e
http: Improve error message for HTTPS redirects
2024-02-19 11:09:39 +01:00
Nick Wellnhofer
cf8751942b
valid: Deprecate old DTD serialization API
2024-02-04 14:33:19 +01:00
Nick Wellnhofer
8961056f9b
parser: Make experimental input API private
...
This needs to be reworked.
2024-01-23 00:47:44 +01:00
Nick Wellnhofer
d2b55a7a02
writer: Implement xmlTextWriterClose
...
This function can be used to make sure that closing the output stream
succeeded.
Fixes #513 .
2024-01-05 20:50:00 +01:00
Nick Wellnhofer
02cc5c3609
parser: Add XML_PARSE_NO_XXE parser option
2024-01-05 20:39:40 +01:00
Nick Wellnhofer
12f0bb9478
parser: Synchronize more options
2024-01-05 20:39:40 +01:00
Nick Wellnhofer
3efbe916a1
parser: Mark 'token' member as unused in xmlParserCtxt
2024-01-05 20:39:40 +01:00
Nick Wellnhofer
b82fd81d06
parser: Rework xmlCtxtParseDocument
...
Make xmlCtxtParseDocument take a parser input which can be popped after
parsing.
2024-01-05 20:39:40 +01:00
Nick Wellnhofer
d7d300ba04
parser: Remove remnants of runtime debugging feature
...
Apparently, this feature was remove long ago.
Fixes #651 .
2024-01-04 17:50:11 +01:00
Nick Wellnhofer
07c05546fa
error: Make xmlFormatError public
...
This is a useful function to get a verbose error report.
Allows to remove duplicated code from runtest.c. Also reactivate check
for schema parser failures.
2024-01-04 15:41:43 +01:00
Nick Wellnhofer
0821efc8ee
encoding: Check whether encoding handlers support input/output
...
The "HTML" encoding handler doesn't support input which could lead to a
wrong error report.
2024-01-02 19:48:23 +01:00
Nick Wellnhofer
e8fb3d639f
parser: Convert some "internal errors" to meaningful codes
2024-01-02 19:48:23 +01:00
Nick Wellnhofer
a2cc7f5f04
parser: Set depth limit to 2048 with XML_PARSE_HUGE
...
Deeply nested documents can cause performance problems, so the nesting
depth should always be limited to a reasonable value.
Also remove the global xmlParserMaxDepth setting which isn't thread-safe
and seems unused.
2024-01-02 19:42:06 +01:00
Nick Wellnhofer
875bb08489
parser: Implement xmlCtxtSetOptions
...
Surprisingly, some options can only be enabled with xmlCtxtUseOptions
and it's impossible to unset them. Add a new API function
xmlCtxtSetOptions which sets or clears all options.
Finally document all parser options.
Make sure to synchronize option bits and struct members.
2024-01-02 19:42:06 +01:00
Nick Wellnhofer
2b79f106ff
parser: Simplify entity size accounting
2024-01-02 14:17:27 +01:00
Nick Wellnhofer
7e0bbbc143
parser: New input API
...
Provide a new set of functions to create xmlParserInputs. These can be
used for the document entity or from external entity loaders.
- Don't require xmlParserInputBuffer.
- All functions take a base URI.
- All functions take an encoding as string.
- xmlNewInputURL also takes a public ID.
- xmlNewInputMemory takes a size_t.
- Optimization hints for memory buffers.
Improve documentation.
Only call xmlInitParser before allocating a new parser context.
Call xmlCtxtUseOptions as early as possible.
2023-12-29 01:22:13 +01:00
Nick Wellnhofer
d025cfbb4b
parser: Always copy content from entity to target.
...
Make sure that references from IDs are updated.
Note that if there are IDs with the same value in a document, the last
one will now be returned. IDs should be unique, but maybe this should be
addressed.
2023-12-29 01:22:11 +01:00
Nick Wellnhofer
a5dcf0f422
parser: Mark more parser context members as unused
2023-12-29 01:20:08 +01:00
Nick Wellnhofer
6a9a88a17f
parser: Move progressive flag into input struct
2023-12-29 01:20:08 +01:00
Nick Wellnhofer
d944a41515
parser: Fix in-parameter-entity and in-external-dtd checks
...
Use in ctxt->input->entity instead of ctxt->inputNr to determine whether
we are inside a parameter entity.
Stop using ctxt->external to check whether we're in an external DTD.
This is signaled by ctxt->inSubset == 2.
2023-12-29 01:19:56 +01:00
Nick Wellnhofer
c1bddd4c26
parser: Mark 'length' member of xmlParserInput as unused
2023-12-25 23:38:40 +01:00
Nick Wellnhofer
955c177f69
parser: Stop using 'directory' struct member
...
This was only used as a pointless fallback for URI resolution.
2023-12-25 23:38:40 +01:00
Nick Wellnhofer
c73de050f5
include: Move non-generated parts from xmlversion.h.in
...
xmlexports.h originally only included symbol visibility macros but it's
a good place for other macros as well.
2023-12-25 23:38:40 +01:00