Nick Wellnhofer
7008740a96
parser: Consolidate scanning of XML Names
...
Use new productions by default.
Fixes #194 .
Fixes #364 .
See #707 .
2025-05-19 19:58:33 +02:00
Nick Wellnhofer
c5b45fbc07
doc: Misc fixes
2025-05-16 19:04:20 +02:00
Nick Wellnhofer
adfbeb7e08
doc: Stop using *Ptr typedefs in documentation
2025-05-16 18:03:12 +02:00
Nick Wellnhofer
a40f36e7f2
include: Stop using *Ptr typedefs in public headers
2025-05-16 18:03:12 +02:00
Nick Wellnhofer
777e2adf77
io: Consolidate escaping code
...
Use generated table approach of xmlSerializeText for xmlEscapeText.
Move most code to xmlIO.c.
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
dad1163078
entities: Always replace invalid chars when escaping
...
The previous refactor painstakingly recreated the different behavior of
separate functions that were merged. It makes
Optimize IS_CHAR check for non-ASCII chars.
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
971038e59f
html: Call lower-level escaping functions
...
Removes the need to pass a document around.
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
63535d3922
tree: Make xmlNodeListGetStringInternal work with escape flags
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
442c1903af
doc: Fix some damage from automated conversions
...
Add some newlines, fix returns.
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
98a61c9dff
doc: Fix briefs in tree docs
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
9aaa52fe48
tree: Make xmlNodeAddContent work with attributes
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
9bbffec568
doc: Move brief to top, params to bottom of doc comments
2025-05-06 19:51:38 +02:00
Nick Wellnhofer
e6cfd04994
doc: Misc fixes to tree docs
2025-05-06 19:51:38 +02:00
Nick Wellnhofer
cb1635a642
doc: Use @since command
2025-05-02 19:05:25 +02:00
Nick Wellnhofer
e78e05c990
doc: Fix autolinks to functions
...
Unfortunately, autolinks in .c files aren't converted by Doxygen for
some reason.
2025-05-02 17:45:31 +02:00
Nick Wellnhofer
f7c412874b
doc: Remove more comment block headers
2025-05-02 17:41:26 +02:00
Nick Wellnhofer
e525564f65
doc: Remove empty lines at start of block
...
These lines were left over after automatic conversion.
2025-05-02 11:42:05 +02:00
Nick Wellnhofer
e549622bc5
doc: Convert documentation to Doxygen
...
Automated conversion based on a few regexes.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
69879da88f
doc: Remove email addresses from documentation
...
Also remove authorship information from generated files, hash.c and
globals.c which were rewritten.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
61890e399d
doc: Prepare for conversion to Doxygen
...
Fix many params in internal functions (not really necessary but Doxygen
warns about that in XML mode).
Fix formatting in a few corner cases that automatic conversion can't
handle.
Rearrange some DOC_DISABLE blocks.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
dd4c0f62fa
tree: Fix xmlTextMerge with NULL args
...
Restore pre-2.13 behavior. Fixes #875 .
2025-03-18 11:11:20 +01:00
Nick Wellnhofer
6ab430ca2e
Remove unnecessary #includes
2025-02-22 21:55:58 +01:00
Nick Wellnhofer
9c16a153d8
Revert "include: Make most IS_* macros private"
...
This reverts commit 84a6c82ff8 .
2025-02-13 20:20:17 +01:00
Grzegorz Szymaszek
9d7bbf1952
tree: Fix variable name in xmlAddChild documentation
2025-01-23 17:49:54 +00:00
Nick Wellnhofer
ca81916023
include: Use intptr_t to cast between pointers and ints
2025-01-03 20:59:10 +01:00
Nick Wellnhofer
84a6c82ff8
include: Make most IS_* macros private
...
Macros like IS_DIGIT or IS_LETTER severely pollute the C namespace.
2024-12-21 20:01:30 +01:00
Nick Wellnhofer
2042090b45
tree: Check reallocations for overflow
2024-12-21 19:37:38 +01:00
Nick Wellnhofer
0c56eb8215
tree: Restore return value of xmlNodeListGetString with NULL list
...
When passing a NULL list to xmlNodeListGetString or
xmlNodeListGetRawString, return NULL instead of "" to match the old
behavior.
Fixes #783 .
2024-08-12 21:38:50 +02:00
Nick Wellnhofer
5d36664fc9
memory: Deprecate xmlGcMemSetup
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
888f70c77e
buf: Move xmlBuffer code to buf.c
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
a221cd7849
buf: Rework xmlBuf code
...
Always use what the old implementation called the "IO" allocation
scheme, allowing to move the content pointer past the initial
allocation. This is inexpensive and allows efficient shrinking.
Optimize xmlBufGrow, reusing shrunken memory as much as possible.
Simplify xmlBufAdd.
Make xmlBufBackToBuffer return an error on overflow.
Make "size" exclude the terminating NULL byte.
Always provide an initial size.
Reintroduce static buffers.
Remove xmlBufResize and several other functions.
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
8d1606265d
entities: Rework text escaping
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
de3221b179
fuzz: Adjust for xmlNodeParseContent changes
...
xmlStringGetNodeList returns NULL again for empty strings.
2024-07-06 15:33:06 +02:00
Nick Wellnhofer
944cc23c84
tree: Fix handling of empty strings in xmlNodeParseContent
...
We shouldn't create an empty text node to match the old behavior.
Fixes #759 .
2024-07-03 16:07:10 +02:00
Nick Wellnhofer
842a044831
valid: Restore ID lookup
...
Revert a change from d025cfbb and don't overwrite ID table entries, so
that the first attribute will be returned if there are duplicate IDs.
This requires two other changes:
- Attributes in entity content are never added to the ID table. This
seems reasonable.
- Remove the optimization to skip ID lookup when copying and the target
document has an empty ID table. This also seems more correct since the
document could have ID declarations nevertheless or we could be
copying xml:ids into the document for the first time.
Fixes #757 .
2024-07-03 11:46:06 +02:00
Nick Wellnhofer
f505dcaea0
tree: Remove underscores from xmlRegisterCallbacks
2024-06-27 14:45:35 +02:00
Nick Wellnhofer
b0fc67aa22
build: Remove --with-tree configuration option
...
This option would allow for a smaller, but mostly useless minimal build.
But it complicates the symbol availability logic in an insane way and
requires specialized tools like our custom C parser in doc/apibuild.py.
See #717 .
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
2f12809612
tree: Fix freeing entities via xmlFreeNode
...
Call xmlFreeEntity to free all entity members.
Fixes #731 .
2024-06-14 16:44:09 +02:00
Nick Wellnhofer
5198de4b1d
fuzz: Make allocation in xmlBuildQName more likely
...
Limit size of static buffer in fuzzing mode.
2024-05-31 13:42:08 +02:00
Nick Wellnhofer
e75e878e02
doc: Update and fix documentation
2024-05-20 14:23:39 +02:00
Nick Wellnhofer
b8597f46df
tree: Handle predefined entities in xmlBufGetEntityRefContent
...
It's possible to create references to predefined entities using the tree
API. This edge case was exposed by making predefined entities const in
commit 63ce5f9a .
2024-04-30 16:05:42 +02:00
Nick Wellnhofer
619e2808b5
tree: Don't call xmlNewCharRef in xmlNodeParseContent
...
xmlNewCharRef also tries to handle strings like '&name;' but in
xmlNodeParseContentInternal, we really want to use the possibly invalid
name without modification. Otherwise, content like '&"' could
create a reference to a predefined entity.
2024-04-30 15:53:08 +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
Niels Dossche
6053f1ff54
Remove redundant size check
...
The condition size > UINT_MAX - 10 is already checked earlier, so the
check is always false.
2024-04-19 15:33:40 +02:00
Nick Wellnhofer
fbea03f3d0
tree: Remove another redundant check in xmlDOMWrapCloneNode
...
The node type was already checked earlier.
2024-04-19 15:22:30 +02:00
Niels Dossche
1a865567d4
Remove redundant NULL check on cur
...
This variable is already NULL checked in the previous if condition.
2024-04-19 15:14:15 +02:00
Niels Dossche
6fadd7980a
Remove always-false check old == cur
...
This case is already checked at the start of the function.
There it returns NULL, which seems more correct.
2024-04-19 15:14:15 +02:00
Niels Dossche
2766520062
Remove redundant NULL check on cur
...
cur = node, and node cannot be NULL as it is checked at the start of the
function.
2024-04-19 15:12:56 +02:00
Nick Wellnhofer
a0341ac8e9
tree: Don't return empty localname in xmlSplitQName{2,3}
...
Match the behavior of xmlSplitQName and xmlSplitQName4.
2024-04-18 12:11:13 +02:00