Nick Wellnhofer
24628f2590
valid: Don't store attribute defaults in dictionary
...
In general, we should only use dicts for names and not values.
2025-06-23 22:59:31 +02:00
Nick Wellnhofer
600742f0f1
valid: Unconst local variable in xmlValidateElement
2025-06-23 22:59:31 +02:00
Nick Wellnhofer
7c91385040
parser: Remove unnecessary dict checks when freeing strings
...
The following strings are never allocated from a dict:
- xmlParserCtxt.version
- xmlParserCtxt.encoding
- xmlParserCtxt.extSubURI
- xmlParserCtxt.extSubSystem
- xmlDoc.version
- xmlDoc.encoding
- xmlDoc.URL
- xmlDTD.ExternalID
- xmlDTD.SystemID
- xmlID.value
Also make the struct members point to non-const chars to avoid casts
when freeing.
2025-06-23 22:59:31 +02:00
Nick Wellnhofer
607708b35f
valid: Don't store ID values in document's dictionary
...
ID values are unique. There's some potential for them to be reused as
references, but storing them in the dictionary can make the dictionary
grow in proportion to the document.
Users like lxml replace the `ids` hash table to avoid this. It seems
like a good idea to stop using the dictionary for ID values.
2025-06-23 22:59:19 +02:00
Nick Wellnhofer
ea91a507dd
doc: Generate documentation with Doxygen 1.14
...
The 1.14.0 release fixes a serious bug with autolinks.
Note that the downstream tests now run on Ubuntu with libxml2 and
libxslt built on Arch. This seems to work but could break at a later
point.
Fixes #929 .
2025-06-22 17:21:26 +02:00
Nick Wellnhofer
3652fc28ec
doc: Fix installation with newer Doxygen
...
Newer versions don't generate PNG files anymore. Simply use *.* as
wildcard.
2025-06-22 17:14:41 +02:00
Nick Wellnhofer
404aedbd97
doc: Improve xmllint documentation
2025-06-22 15:53:01 +02:00
Michael Mann
dd2b4091fb
xmllint: Add --strict-namespace option
...
Use xmlCtxtGetStatus() after parsing. If status indicates a namespace error while the --strict-namespace option is enabled, xmllint will exit with XMLLINT_ERR_RDFILE error
Fixes #698
2025-06-22 13:40:22 +00:00
Michael Mann
bf26cf9d08
xmllint: Replace boolean application options with single flag member
...
Take all of the boolean application options and create a bitmask for each of them. Then use just a single unsigned member to keep track off all of them (regardless of precompile directives)
2025-06-22 13:40:22 +00:00
Michael Mann
be812e1e5a
xmllint: Rename options -> parseOptions
...
Make it more obvious the options are related to XML parsing
2025-06-22 13:40:22 +00:00
Nick Wellnhofer
e7802738c6
parser: Don't load external content if only XML_SKIP_IDS is set
...
At some point, the `loadsubset` member was augmented to also control
handling of ID attributes in addition to loading of external DTDs. These
two features are unrelated and shouldn't have been mixed. This mistake
was probably inspired by the misnamed XML_DETECT_IDS flag. As a side
effect, setting XML_SKIP_IDS always enabled loading of external DTDs and
parameter entities.
This change makes it possible to ignore IDs without loading external
content. This is a deliberate API change that improves security and is
unlikely to affect users.
This also makes sure that the new XML_PARSE_SKIP_IDS option doesn't
enable unsafe behavior.
2025-06-22 15:18:43 +02:00
Nick Wellnhofer
b424bae705
html: Fix pull-parsing of initial comments and doctype decls
...
- Parse more bogus comments and multiple doctype declarations before
switching to content.
- Grow buffer after parsing comment.
2025-06-22 14:31:38 +02:00
Nick Wellnhofer
1c96d5ef51
parser: Add comment in xmlStopParser
2025-06-22 14:31:26 +02:00
Nick Wellnhofer
7e3818424a
include: s/char const/const char/
2025-06-22 14:31:26 +02:00
Nick Wellnhofer
19139061fb
include: Define XMLPUBVAR directly
...
Using an intermediate macro confuses newer Doxygen versions for some
reason.
2025-06-22 14:31:26 +02:00
Nick Wellnhofer
a4d25b3d93
doc: Small fixes
2025-06-22 14:31:26 +02:00
Michael Mann
cf4f967266
Add XML_PARSE_SKIP_IDS to replace XML_SKIP_IDS
...
Mark loadset member as deprecated
Fixes #873
2025-06-22 08:03:34 -04:00
Nick Wellnhofer
1dcd3df20b
parser: Fix xmlCtxtIsStopped
...
Make xmlCtxtIsStopped check for fatal errors as well. This makes it
easier to migrate away from disableSAX.
2025-06-20 23:46:46 +02:00
Nick Wellnhofer
9c6eebac17
xmllint: Fix --xinclude --path
...
Use resource loader for XInclude. Regressed with f96dca9c .
2025-06-20 22:29:57 +02:00
Nick Wellnhofer
2963a0f13a
tree: Undeprecate some members used by libxslt
2025-06-20 21:41:24 +02:00
Markus Rickert
477f9c6b20
Fix CMake iconv handling after change to private dependency
2025-06-18 13:48:55 +02:00
Nick Wellnhofer
a3992815b3
parser: Fix buffer overflow when parsing PublicIds
...
Regressed with 8231c0366 and 30665ae4 .
2025-06-12 13:51:37 +02:00
Nick Wellnhofer
30665ae4d1
parser: Fix parsing of PublicIds and VersionNums
...
Regressed in 8231c0366 .
Fixes #940 .
2025-06-11 18:36:50 +02:00
Omar Siam
852b070fcd
Change comment style
2025-06-10 18:47:59 +02:00
Omar Siam
bb7169b5ad
Fix relaxng is parsed to an infinite attrs->next loop
...
Test data for the bug.
2025-06-10 18:34:44 +02:00
Nick Wellnhofer
f428bdd1d9
xmllint: Make output options depend on LIBXML_OUTPUT_ENABLED
2025-06-08 17:01:11 +02:00
Nick Wellnhofer
3e47ceeb72
xmllint: Warn about options with no effect
2025-06-08 17:01:02 +02:00
Nick Wellnhofer
2ffb8c96a3
doc: Improve xmllint documentation
...
Group more options. Clarify effect of some parser options. Mention
streaming validation with `--sax`. Remove references to libxml(3).
2025-06-08 17:01:02 +02:00
Nick Wellnhofer
6b50d8c888
html: Add missing call to grow parser in htmlParseComment
...
Otherwise, long chains of short comments could exhaust the input buffer
when pull parsing.
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
70335c41fc
html: Don't stop on unsupported encoding
...
Continue to parse unlike in the XML case.
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
416da89d0b
html: Make htmlCtxtReset call xmlCtxtReset
...
The two implementations shouldn't diverge.
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
fa81e849be
xmllint: Fix --memory --repeat
...
Always reset parser context.
Should fix #937 .
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
220c813e35
globals: Fix documentation of xmlThrDef* functions
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
7e08d93c94
doc: Improve documentation of tree data types
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
86cf217d34
build: Disable Schematron support by default
2025-06-08 14:22:32 +02:00
Nick Wellnhofer
8da19f2320
doc: Add more warnings to xmlCleanupParser
2025-06-08 14:22:32 +02:00
Alex Richardson
7e4247b278
parser: use XML_INT_TO_PTR when storing integers as pointers
...
This fixes warnings when using a CHERI-aware toolchain.
2025-06-06 12:11:54 -07:00
Nick Wellnhofer
c6206c9387
html: Ignore ASCII-incompatible encoding in meta tag
...
After successfully parsing an ASCII-encoded meta tag, switching to an
encoding that isn't ASCII-compatible cannot work.
2025-06-05 22:24:50 +02:00
Nick Wellnhofer
2b6b3945f2
Revert "SAX1: Align handling of default attributes with SAX2"
...
This reverts commit db65b2fc51 .
This didn't check for duplicate default attributes.
2025-06-03 16:21:56 +02:00
Nick Wellnhofer
30375877d9
parser: Fix custom SAX parsers without cdataBlock handler
...
Use characters handler if cdataBlock handler is NULL.
Regressed with 57e4bbd8 . Should fix #934 .
2025-06-03 16:21:48 +02:00
Nick Wellnhofer
5e7c72cd5c
doc: Misc fixes
2025-06-03 01:27:12 +02:00
Nick Wellnhofer
5f8e537d0a
doc: Misc fixes to xpointer
2025-06-03 00:59:00 +02:00
Nick Wellnhofer
1fc66d265a
xmllint: Don't check for removed features
2025-06-03 00:33:27 +02:00
Nick Wellnhofer
479f26f92f
regexp: Remove unfinished reimplementation
...
This was never enabled.
2025-06-03 00:28:16 +02:00
Nick Wellnhofer
3d71ab4fa6
doc: Small fixes
2025-06-03 00:17:03 +02:00
Nick Wellnhofer
0ab5d7c557
entities: Deprecate internal DTD-related functions
2025-06-03 00:13:26 +02:00
Nick Wellnhofer
347c2b2ec7
valid: Deprecate a few functions and xmllint --insert
2025-06-02 23:54:28 +02:00
Nick Wellnhofer
f6eec6f4c1
globals: Remove lineNumbersDefaultValue from globals struct
2025-06-02 22:45:19 +02:00
Nick Wellnhofer
ac6ae39192
valid: Readd more argument checks in xmlAddElementDecl
...
Fix crashes with API fuzzer.
2025-06-02 14:33:15 +02:00
Nick Wellnhofer
0f8543e11d
parser: Fix error reporting in xmlSkipBlankCharsPEBalanced
...
Short-lived regression.
2025-06-02 14:19:01 +02:00