relaxng.c


Log

Author Commit Date CI Message
Nick Wellnhofer 9553695d 2025-06-30T16:15:15 relaxng: Make xmlRelaxNGDump depend on debug option
Omar Siam 9760a14f 2025-06-30T13:47:33 relaxng: In the simplification step also unlink notAllowed refs from choice This fixes false reports of non allowed content compared to notAllowed as tag within the choice tag.
Daniel P. Berrangé ac5fcb0e 2025-06-25T15:24:24 relaxng: ensure thread safe global initialization Relying on a plain integer flag, with no synchronization primitives does not give thread-safe initialization. All reads & writes of the xmlSchemaTypesInitialized flag need to be protected by a mutex to ensure suitable memory barriers & thus correct ordering wrt any speculative execution. A separate internal initializer tied to xmlParserInit is used to create the mutex used for synchronization, similarly to how catalog.c works. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Omar Siam 852b070f 2025-06-10T18:47:59 Change comment style
Omar Siam bb7169b5 2025-06-10T18:34:44 Fix relaxng is parsed to an infinite attrs->next loop Test data for the bug.
Nick Wellnhofer 7bd8d1d9 2025-05-28T15:53:38 doc: Prefix autolinks with '#' Use `#func` instead of `func()` to ignore parameters and make all autolinks work.
Nick Wellnhofer adfbeb7e 2025-05-14T04:58:21 doc: Stop using *Ptr typedefs in documentation
Nick Wellnhofer a40f36e7 2025-05-14T04:04:28 include: Stop using *Ptr typedefs in public headers
Nick Wellnhofer 9bbffec5 2025-05-06T17:42:46 doc: Move brief to top, params to bottom of doc comments
Nick Wellnhofer e78e05c9 2025-05-02T17:32:51 doc: Fix autolinks to functions Unfortunately, autolinks in .c files aren't converted by Doxygen for some reason.
Nick Wellnhofer f7c41287 2025-05-02T15:57:17 doc: Remove more comment block headers
Nick Wellnhofer e525564f 2025-05-01T19:20:06 doc: Remove empty lines at start of block These lines were left over after automatic conversion.
Nick Wellnhofer e549622b 2025-04-28T15:11:24 doc: Convert documentation to Doxygen Automated conversion based on a few regexes.
Nick Wellnhofer 69879da8 2025-04-28T14:04:30 doc: Remove email addresses from documentation Also remove authorship information from generated files, hash.c and globals.c which were rewritten.
Nick Wellnhofer 61890e39 2025-04-27T21:50:15 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.
Nick Wellnhofer e50d314a 2025-02-25T23:07:19 build: Add separate configuration option for RELAX NG Support for RELAX NG used to be enabled together with XML Schema support (--with-schemas). Now there's a separate option and a new feature macro LIBXML_RELAXNG_ENABLED.
Nick Wellnhofer 9c16a153 2025-02-13T18:41:33 Revert "include: Make most IS_* macros private" This reverts commit 84a6c82ff83d04963d6e1c5cd18ded68ea02d99f.
Nick Wellnhofer ca819160 2025-01-03T20:50:08 include: Use intptr_t to cast between pointers and ints
Nick Wellnhofer 84a6c82f 2024-12-19T20:59:10 include: Make most IS_* macros private Macros like IS_DIGIT or IS_LETTER severely pollute the C namespace.
Nick Wellnhofer 5d36664f 2024-07-16T00:35:53 memory: Deprecate xmlGcMemSetup
Nick Wellnhofer 4b1832c1 2024-07-15T14:46:00 relaxng: Use error handler for internal errors Don't print to stderr.
Nick Wellnhofer 598ee0d2 2024-06-26T01:18:55 error: Remove underscores from xmlRaiseError
Rosen Penev 217e9b7a 2024-06-08T12:27:45 clang-tidy: don't return in void functions Found with readability-redundant-control-flow Signed-off-by: Rosen Penev <rosenp@gmail.com>
Nick Wellnhofer 40b76eda 2024-06-11T12:54:12 relaxng: Add callbacks for resource loader
Seiya Nakata 5bb84b47 2024-04-04T11:55:28 relaxng: Fix tree corruption in xmlRelaxNGParseNameClass Don't create cycles in tree structure. This will lead to an infinite loop or call stack overflow later. Closes: https://gitlab.gnome.org/GNOME/libxml2/-/issues/711
Maks Mishin cd94985f 2024-02-29T01:14:06 relaxng: Remove useless if statement
Nick Wellnhofer c8f1f4a2 2023-12-21T17:30:38 doc: Improve documentation of error handlers
Nick Wellnhofer 531d06ad 2023-12-18T22:48:24 error: Stop printing some errors by default Unfortunately, it's long-standing behavior for libxml2 to print all reported errors to stderr by default. This default behavior is now partially disabled. If no error handler is set, only parser and validation errors are passed to a generic error handler or printed to stderr. Other errors are still available via xmlGetLastError and can be captured with a structured error handler.
Nick Wellnhofer 83c6aeef 2023-12-18T21:12:29 relaxng: Improve error handling Pass RelaxNG structured error handler to XML parser. Handle malloc failure from xmlRaiseError. Remove argument from memory error handler. Use xmlRaiseMemoryError. Don't use xmlGenericError. Remove TODO macro.
Nick Wellnhofer 4e1c13eb 2023-09-18T14:45:10 debug: Remove debugging code This is barely useful these days and only clutters the code base.
Nick Wellnhofer 1eb2ca9f 2023-02-21T15:39:44 relaxng: Remove useless if statement ctxt and define are non-NULL at this point. Fixes #482.
Nick Wellnhofer 2cac6269 2022-09-01T03:14:13 Don't use sizeof(xmlChar) or sizeof(char)
Nick Wellnhofer 0f568c0b 2022-08-26T01:22:33 Consolidate private header files Private functions were previously declared - in header files in the root directory - in public headers guarded with IN_LIBXML - in libxml.h - redundantly in source files that used them. Consolidate all private header files in include/private.
Nick Wellnhofer 3e7b4f37 2022-05-20T23:28:25 Avoid calling xmlSetTreeDoc Create text nodes with xmlNewDocText or set the document directly to avoid xmlSetTreeDoc being called when the node is inserted.
Nick Wellnhofer 2070ade6 2022-03-06T23:19:04 Undeprecate schema init functions These functions aren't called from xmlInitParser, so it's better to keep them public for now.
Nick Wellnhofer 40483d0c 2022-03-06T13:55:48 Deprecate module init and cleanup functions These functions shouldn't be part of the public API. Most init functions are only thread-safe when called from xmlInitParser. Global variables should only be cleaned up by calling xmlCleanupParser.
Nick Wellnhofer 346c3a93 2022-02-20T18:46:42 Remove elfgcchack.h The same optimization can be enabled with -fno-semantic-interposition since GCC 5. clang has always used this option by default.
David King 477f6de3 2021-07-14T15:35:31 Fix memory leak in xmlRelaxNGNewDocParserCtxt Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938806
David King 483de2c2 2021-07-14T15:31:55 Fix memory leak in xmlRelaxNGParseData Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938806
Nick Wellnhofer 20c60886 2020-03-08T17:19:42 Fix typos Resolves #133.
Jared Yanovich 2a350ee9 2019-09-30T17:04:54 Large batch of typo fixes Closes #109.
Nick Wellnhofer 09b6f818 2019-08-25T13:58:41 Fix potential null deref in xmlRelaxNGParsePatterns Thanks to Zhongyuan Zhou for the initial patch.
Jan Pokorný ea695ac0 2019-08-09T15:09:22 Fix unability to RelaxNG-validate grammar with choice-based name class Previously, test/relaxng/ambig_name-class2.xml would fail to validate against test/relaxng/ambig_name-class2.rng: > test/relaxng/ambig_name-class2.rng:4: > element attribute: Relax-NG parser error : > Found anyName attribute without oneOrMore ancestor > Relax-NG schema test/relaxng/ambig_name-class2.rng failed to compile Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Jan Pokorný 8074b881 2019-08-08T23:33:48 Fix unability to validate ambiguously constructed interleave for RelaxNG Previously, test/relaxng/ambig_name-class.xml would fail to validate for a simple reason -- interleave within "open-name-class" context is supposed to be fine with whatever else is pending the consumption, since effectively, it's unrelated from a higher parsing perspective. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Nick Wellnhofer 63484962 2019-07-08T12:28:39 Remove redundant code in xmlRelaxNGValidateState Closes #70.
Nikolai Weibull 7c4949af 2019-01-01T19:58:07 Fix "Problem with data in interleave in RelaxNG validation" Fixes commit c8e5f958. https://mail.gnome.org/archives/xml/2018-November/msg00029.html
Nikolai Weibull c64d4efb 2018-10-13T00:12:12 Remove redefined starts and defines inside include elements When including a grammar from another grammar, we need to make sure that any redefines of starts and includes that that grammar does inside any of its include elements are also removed.
Nikolai Weibull 46da8fc5 2018-10-12T23:46:24 Allow choice within choice in nameClass in RELAX NG The pattern nameClass allows for nested choice elements, for example <name> <choice> <choice> <name>a</name> <name>b</name> </choice> <name>c</name> </choice> </name> which is semantically equivalent to <name> <choice> <name>a</name> <name>b</name> <name>c</name> </choice> </name> The old code didn’t handle this correctly, as it never expected a choice inside another choice. This patch fixes this by flattening any nested choices. This pattern of nested choice elements comes up in RELAX NG simplification, where all choice elements are rewritten in this nested manner, see section 4.12 of the RELAX NG specification.
Nikolai Weibull 4338c310 2018-10-12T22:30:26 Look inside divs for starts and defines inside include RELAX NG allows for div elements inside of include elements. We need to look inside those div elements for start and define elements that may be redefining start and define elements in the included grammar.
Nikolai Weibull c8e5f958 2018-11-22T18:09:51 Problem with data in interleave in RelaxNG validation Reported in https://mail.gnome.org/archives/xml/2018-October/msg00003.html The issue seems to be that we build groups of what can be matched by the interleave, but that these groups don’t include data, list, and value elements, only element and text elements. This patch extends xmlRelaxNGGetElements so that it can return these elements for us in xmlRelaxNGComputeInterleaves. Then we make sure to updatexmlRelaxNGNodeMatchesList as well so that it accepts the correct types.
Nick Wellnhofer e03f0a19 2017-11-09T16:42:47 Fix hash callback signatures Make sure that all parameters and return values of hash callback functions exactly match the callback function type. This is required to pass clang's Control Flow Integrity checks and to allow compilation to asm.js with Emscripten. Fixes bug 784861.
J. Peter Mugaas d2c329a9 2017-10-21T13:49:31 Fix -Wimplicit-fallthrough warnings Add "falls through" comments to quench implicit-fallthrough warnings which are enabled by -Wextra under GCC 7.
Nick Wellnhofer d422b954 2017-10-09T13:37:42 Fix pointer/int cast warnings on 64-bit Windows On 64-bit Windows, `long` is 32 bits wide and can't hold a pointer. Switch to ptrdiff_t instead which should be the same size as a pointer on every somewhat sane platform without requiring C99 types like intptr_t. Fixes bug 788312. Thanks to J. Peter Mugaas for the report and initial patch.
Chun-wei Fan d77e5fc4 2016-05-31T21:04:50 relaxng.c, xmlschemas.c: Fix build on pre-C99 compilers Make sure that the variables are declared at the top of the block. https://bugzilla.gnome.org/show_bug.cgi?id=767063
David Kilzer 502f6a6d 2016-05-23T14:58:41 More format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 adds a new xmlEscapeFormatString() function to escape composed format strings
David Kilzer 4472c3a5 2016-05-13T15:13:17 Fix some format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 Decorate every method in libxml2 with the appropriate LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups following the reports.
Daniel Veillard 2fab235d 2015-03-16T08:38:36 Fix support for except in nameclasses For https://bugzilla.gnome.org/show_bug.cgi?id=565219 The code was imply missing even if simple, added a few regression tests.
Philip Withnall 57941042 2014-10-26T18:08:04 Remove various unused value assignments As detected by Coverity (CIDs 60467–60472). https://bugzilla.gnome.org/show_bug.cgi?id=739220
Daniel Veillard 42870f46 2014-07-26T21:04:54 Add couple of missing Null checks For https://bugzilla.gnome.org/show_bug.cgi?id=733710 Reported by Gaurav but with slightly different fixes
Gaurav Gupta 54c4b1aa 2014-07-14T16:14:44 Add a couple of misisng check in xmlRelaxNGCleanupTree For https://bugzilla.gnome.org/show_bug.cgi?id=733041 check cur->parent before dereferencing the pointer even if a null parent there should not happen Also fix a typo
Gaurav Gupta 7d2e8c95 2014-07-14T16:08:28 Add a missing argument check For https://bugzilla.gnome.org/show_bug.cgi?id=733042 the states argument of xmlRelaxNGAddStates() ought to be checked too
Gaurav Gupta 6d753994 2014-07-14T16:01:10 Adding a check in case of allocation error For https://bugzilla.gnome.org/show_bug.cgi?id=733043 There is missing Null condition in xmlRelaxNGValidateInterleave of relaxng.c Dereferencing it may cause a crash.
Jan Pokorný acace88c 2014-06-09T23:45:24 Fix typos in relaxng.c Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Shaun McCance 6473a41a 2013-10-23T14:51:33 Implement choice for name classes on attributes https://bugzilla.gnome.org/show_bug.cgi?id=710744
Gaurav 7d4e259f 2013-09-30T11:27:41 Avoid some dead code and cleanup in relaxng.c https://bugzilla.gnome.org/show_bug.cgi?id=705388 Code needed a bit of cleanup
Michael Wood fb27e2cd 2012-09-28T08:59:33 Fix spelling of "length".
Daniel Veillard f8e3db04 2012-09-11T13:26:36 Big space and tab cleanup Remove all space before tabs and space and tabs at end of lines.
Daniel Veillard 264cee69 2012-08-13T12:40:53 Add a missing element check
Noam 9313ae85 2012-05-15T11:03:46 Fix weird streaming RelaxNG errors For https://bugzilla.gnome.org/show_bug.cgi?id=512454 The bug was to use compiled determinitic automata when the content model was found to be non-deterministic, leading to random parsing errors.
Daniel Veillard 7dd0d916 2011-11-10T18:08:33 Fix an unimplemented part in RNG value validation Forgot to implement <optional> this was raised again in https://bugzilla.redhat.com/show_bug.cgi?id=752393 as this make libxml2 fail to validate against ODF RNGs Daniel
Shaun McCance d7eb9b5d 2011-08-04T10:28:59 Fix RELAX NG include bug #655288 When overriding during include, children of the root node are scanned. But the root node was gotten with doc->children, instead of xmlDocGetRootElement.
Ben Walton a7a6a4b2 2010-03-15T10:06:36 relaxng.c: cast to allow compilation with sun studio 11 Sun Studio 11 was failing to compile relaxng.c due to a type mismatch in a ternary operator used to provide an argument to xmlRngPErr. It seems that sos11 cc is more pedantic about this part of the C99 standard. GCC issues a warning but doesn't fail by default. After casting the string literal "nothing" to (const xmlChar *) sos11 cc is happy. GCC no longer issues a warning either. Another warning was cleaned up with an identical cast.
Daniel Veillard aa422d92 2009-09-24T11:31:48 595792 fixing a RelaxNG bug introduced in 2.7.4 * relaxng.c: refs definitions added from inported schemas should not be processed as refs from the main schemas * test/relaxng/595792* result/relaxng/595792*: add the test to the regression suite
Rob Richards 848e5cf3 2009-09-09T12:13:58 Fix Windows build * relaxng.c: fix windows build
Daniel Veillard 594e5dfb 2009-09-07T14:58:47 Chasing dead assignments reported by clang-scan * SAX2.c dict.c error.c hash.c nanohttp.c parser.c python/libxml.c relaxng.c runtest.c tree.c valid.c xinclude.c xmlregexp.c xmlsave.c xmlschemas.c xpath.c xpointer.c: mostly removing unneded affectations, but this led to a few real bugs and some part not yet understood (relaxng/interleave)
Daniel Veillard d44b9364 2009-09-07T12:15:08 A few more safety cleanup raised by scan * SAX2.c encoding.c parser.c xmlschemas.c: a few more safety checks * relaxng.c: remove an unused intitialization
Daniel Veillard 76d36458 2009-09-07T11:19:33 Fixing assorted potential problems raised by scan * encoding.c parser.c relaxng.c runsuite.c tree.c xmlreader.c xmlschemas.c: nothing really serious but better safe than sorry
Daniel Veillard 1ba2aca3 2009-08-31T16:47:39 492317 Fix Relax-NG validation problems * relaxng.c xmlregexp.c: a subtle problem when checking for compileable content model, if using the same elements in cases of choices. Handled by adding a special flag to the regexp compilation to detect transitions with different atoms using same strings. * test/relaxng/492317* result/relaxng/492317*: add the test to the regression suite
Daniel Veillard ec18c960 2009-08-26T18:37:43 558452 fight with reg test and error report * relaxng.c: tiny fix and provide more context on some errors * result/relaxng/558452_0* test/relaxng/558452*: add some regression tests for the bugs * Makefile.am runtest.c: fight with the fact streaming error messages can differ due to missing node context
Daniel Veillard fd780772 2009-08-26T18:35:29 558452 RNG compilation of optional multiple child * relaxng.c: don't assume there is a single define under a optional
Daniel Veillard a4f27cb6 2009-08-21T17:34:17 Fix the problem of revalidating a doc with RNG * relaxng.c: simply clear up the ->psvi of elements on the tree upon return, should not be needed for streaming APIs as tree are discarded
Daniel Veillard 81c51e17 2009-08-14T18:52:10 512131 refs from externalRef part need to be added * relaxng.c: refs from externalRef subschemas need to be added to the main schemas. Also fix a couple of problems with dangling references
Daniel Veillard 9fcd462f 2009-08-14T16:16:31 512131 crash in xmlRelaxNGValidateFullElement * relaxng.c: in some case we were not freeing the right data, also cleanup a few other things
Daniel Veillard 23a47d60 2008-06-25T04:11:24 Switch off debugging, oops, Daniel svn path=/trunk/; revision=3749
Daniel Veillard 25a1ce91 2008-06-02T16:04:12 patch from Hans de Goede to switch the file to UTF-8 switch to generate * ChangeLog: patch from Hans de Goede to switch the file to UTF-8 * doc/news.xsl: switch to generate the NEWS file in UTF-8 instead of ISO-8859-1 Daniel svn path=/trunk/; revision=3745
Daniel Veillard d8ed1051 2007-06-12T09:24:46 fixed bug #407436 a crash in a specific case of Relax-NG validation Daniel * relaxng.c: fixed bug #407436 a crash in a specific case of Relax-NG validation Daniel svn path=/trunk/; revision=3629
Daniel Veillard fa0d094a 2006-10-13T16:30:56 fix a Relax-NG bug related to element content processing, fixes bug * relaxng.c: fix a Relax-NG bug related to element content processing, fixes bug #302836 Daniel
William M. Brack 700f987f 2006-05-06T03:16:22 Fixed compilation error (bug 340765) reported by dmacks with patch * relaxng.c: Fixed compilation error (bug 340765) reported by dmacks with patch supplied by Graham Bennett.
Daniel Veillard b2f8f1de 2006-04-28T16:30:48 preparing 2.6.24 release, fixed Python paths at the last moment fix some * NEWS configure.in doc//*: preparing 2.6.24 release, fixed Python paths at the last moment * relaxng.c testapi.c tree.c: fix some comments Daniel
Daniel Veillard 3f845a99 2006-04-13T07:33:44 fixing a deallocation problem in xmlRelaxNGParse() in case of errors, * relaxng.c: fixing a deallocation problem in xmlRelaxNGParse() in case of errors, should fix bug #338306 Daniel
Daniel Veillard 14b56439 2006-03-09T18:41:40 more cleanups based on coverity reports. Daniel * relaxng.c xmlschemas.c xmlschemastypes.c: more cleanups based on coverity reports. Daniel
Daniel Veillard 87254c84 2006-02-19T15:27:17 trying to fix #331062, this is again a problem around interleave, there is * relaxng.c: trying to fix #331062, this is again a problem around interleave, there is no good fix unless reimplementing but this works around some cases and allow to validate in that case. Daniel
Kasimier T. Buchcik a930fbec 2006-01-09T16:28:20 Added xmlRelaxNGSetParserStructuredErrors() to the API. * relaxng.c include/libxml/relaxng.h: Added xmlRelaxNGSetParserStructuredErrors() to the API.
Daniel Veillard 567a45b5 2005-10-18T19:11:55 removed the error message removed 2 instability warnings from function * runtest.c: removed the error message * relaxng.c xmlschemas.c: removed 2 instability warnings from function documentation * include/libxml/schemasInternals.h: changed warning about API stability * xmlregexp.c: trying to improve runtime execution of non-deterministic regexps and automata. Not fully finished but should be way better. Daniel
Daniel Veillard b30ca313 2005-09-04T13:50:03 real fix for #314881 and #314759 is was a bit more complex than initially * relaxng.c: real fix for #314881 and #314759 is was a bit more complex than initially expected as ctxt->error == NULL had behaviour side effects at the compilation level itself. Daniel
Daniel Veillard f03a8cda 2005-09-04T12:01:57 fixing yet another pattern induced XPath bug #314282 reverted back last * pattern.c xpath.c include/libxml/pattern.h: fixing yet another pattern induced XPath bug #314282 * relaxng.c: reverted back last change it was seriously broken Daniel
Daniel Veillard e40afecb 2005-09-03T14:28:02 structured error reporting problem with Relax-NG should fix #314881 and * relaxng.c: structured error reporting problem with Relax-NG should fix #314881 and #314759 Daniel
Daniel Veillard 60faf528 2005-08-10T16:23:57 fixed bug #307377 about validation of choices in list values. added * relaxng.c: fixed bug #307377 about validation of choices in list values. * test/relaxng/307377* result/relaxng/307377* Makefile.am runtest.c: added examples to the regression tests, problem is that streaming version gives slightly more informations. Daniel
Daniel Veillard 24505b0f 2005-07-28T23:49:35 a lot of small cleanups based on Linus' sparse check output. Daniel * HTMLparser.c SAX2.c encoding.c globals.c parser.c relaxng.c runsuite.c runtest.c schematron.c testHTML.c testReader.c testRegexp.c testSAX.c testThreads.c valid.c xinclude.c xmlIO.c xmllint.c xmlmodule.c xmlschemas.c xpath.c xpointer.c: a lot of small cleanups based on Linus' sparse check output. Daniel
Daniel Veillard da0aa4cf 2005-07-13T23:07:49 applied patch from Marcus Boerger to route relaxng and schemas error * error.c relaxng.c xmlreader.c xmlschemas.c include/libxml/relaxng.h include/libxml/xmlschemas.h: applied patch from Marcus Boerger to route relaxng and schemas error messages when using the reader through the structured interface if activated. * elfgcchack.h doc/* testapi.c: rebuilt since this add new APIs to test. Daniel