xmlwriter.c

Branch


Log

Author Commit Date CI Message
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 38ea8fa9 2025-05-06T18:31:45 doc: Fix varargs
Nick Wellnhofer 9bbffec5 2025-05-06T17:42:46 doc: Move brief to top, params to bottom of doc comments
Nick Wellnhofer cb1635a6 2025-05-02T19:05:25 doc: Use @since command
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 4d1e82ce 2025-05-02T17:26:08 doc: Fix xmlTextWriter struct name
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 b7c0f9d2 2024-10-19T14:26:39 string: Fix va_copy fallback Fix va_copy fallback reworked in 5cffba83. Should fix #812.
Nick Wellnhofer a221cd78 2024-07-07T03:01:51 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.
Nick Wellnhofer 6be79014 2024-07-15T14:18:26 Remove unused code
Nick Wellnhofer 598ee0d2 2024-06-26T01:18:55 error: Remove underscores from xmlRaiseError
Rosen Penev 2def7b4b 2024-06-18T13:55:34 clang-tidy: move assignments out of if Found with bugprone-assignment-in-if-condition Signed-off-by: Rosen Penev <rosenp@gmail.com>
Nick Wellnhofer faae3a91 2024-06-16T23:21:55 SAX2: Split out legacy SAX1 handling Split xmlSAX2StartElement into two functions handling legacy SAX1 and HTML.
Nick Wellnhofer e314109a 2024-02-16T15:42:38 save: Don't write directly to internal buffer Make sure that OOM errors are reported.
Nick Wellnhofer d2b55a7a 2024-01-05T20:31:10 writer: Implement xmlTextWriterClose This function can be used to make sure that closing the output stream succeeded. Fixes #513.
Nick Wellnhofer 54c70ed5 2023-12-18T19:31:29 parser: Improve error handling Introduce xmlCtxtSetErrorHandler allowing to set a structured error for a parser context. There already was the "serror" SAX handler but this always receives the parser context as argument. Start to use xmlRaiseMemoryError. Remove useless arguments from memory error functions. Rename xmlErrMemory to xmlCtxtErrMemory. Remove a few calls to xmlGenericError. Remove support for runtime entity debugging.
Nick Wellnhofer 9684e7a0 2023-12-10T18:29:44 writer: Don't call SAX error handler directly
Nick Wellnhofer 5cffba83 2023-11-28T15:34:28 Rework va_copy fallback va_copy is a macro, so it can be detected without a feature test. Fallback to __va_copy or memcpy.
Nick Wellnhofer a77f9ab8 2023-09-20T16:57:22 globals: Don't include SAX2.h from globals.h
Nick Wellnhofer 550eaac6 2023-04-30T19:40:43 writer: Add error check in xmlTextWriterEndDocument
Nick Wellnhofer dd3569ea 2022-12-08T02:43:17 Remove XMLDECL macro from .c files
Nick Wellnhofer ad338ca7 2022-09-01T01:18:30 Remove explicit integer casts Remove explicit integer casts as final operation - in assignments - when passing arguments - when returning values Remove casts - to the same type - from certain range-bound values The main motivation is that these explicit casts don't change the result of operations and only render UBSan's implicit-conversion checks useless. Removing these casts allows UBSan to detect cases where truncation or sign-changes occur unexpectedly. Document some explicit casts as truncating and add a few missing ones.
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.
David Kilzer 21561e83 2016-05-20T15:21:43 Mark more static data as `const` Similar to 8f5710379, mark more static data structures with `const` keyword. Also fix placement of `const` in encoding.c. Original patch by Sarah Wilkin.
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.
Nick Wellnhofer d8999b1d 2019-10-14T17:04:04 Fix error code in xmlTextWriterStartDocument Return XML_ERR_UNSUPPORTED_ENCODING if no encoding handler could be found. Fixes bug #521808: https://bugzilla.gnome.org/show_bug.cgi?id=521808 Resolves !53.
Jared Yanovich 2a350ee9 2019-09-30T17:04:54 Large batch of typo fixes Closes #109.
Nick Wellnhofer 86615e43 2017-11-09T17:47:47 Fix IO callback signatures
Nick Wellnhofer 4dd6d7a5 2017-11-09T17:28:00 Fix list callback signatures Make sure that all parameters and return values of list 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. Also change the `user` parameter type from `const void *` to `void *`.
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.
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 c9ecf45d 2014-02-08T02:22:35 Fix xmlTextWriterWriteElement when a null content is given
Patrick Monnerat 0f7a26d8 2013-12-12T15:04:43 Improve va_list portability Support for va_list declared as an array (cannot be referenced explicitly)
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.
Csaba Raduly 429d3a0a 2012-09-11T11:50:25 Allow to set the quoting character of an xmlWriter It's otherwise impossible to set the quoting character of attribute values of an xmlWriter.
Daniel Veillard dbf5411b 2012-07-16T14:54:45 Convert the writer to new output buffer and save APIs Only a handful of places had to be converted for xmlBuf and the new saving entry point.
Rob Richards 798743a4 2009-06-19T13:54:25 * parser.c: use options from current parser context when creating a parser context within xmlParseCtxtExternalEntity * xmlwriter.c: fix error message when unable to create output file
Daniel Veillard bccae2d2 2009-06-04T11:22:45 * c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string patch by Christian Persch, fixes #581612
Daniel Veillard cb0ae191 2009-02-20T08:40:55 cleanups and error reports when xmlTextWriterVSprintf fails, by Jinmei * xmlwriter.c: cleanups and error reports when xmlTextWriterVSprintf fails, by Jinmei Tatuya daniel svn path=/trunk/; revision=3817
Daniel Veillard eb0a0b2e 2009-02-20T08:19:53 remove a couple of leaks on errors reported by Jinmei Tatuya daniel * xmlwriter.c: remove a couple of leaks on errors reported by Jinmei Tatuya daniel svn path=/trunk/; revision=3816
Rob Richards 5a7d8bdf 2008-12-27T13:17:43 xmlwriter.c: fix indenting in xmlTextWriterFullEndElement for bug# 554353. svn path=/trunk/; revision=3805
Daniel Veillard ccc476f1 2008-03-04T13:19:49 patch from Alex Khesin fixing CDATA output after a text node. fixed the * xmlwriter.c: patch from Alex Khesin fixing CDATA output after a text node. * parser.c: fixed the comment for xmlParserCleanup * globals.c: fixed indentation Daniel svn path=/trunk/; revision=3699
Daniel Veillard 3ff24115 2008-02-13T10:17:41 applied patch from Alfred Mickautsch to flush the output at the end of * xmlwriter.c: applied patch from Alfred Mickautsch to flush the output at the end of document. Daniel svn path=/trunk/; revision=3691
Daniel Veillard 7e26fb4b 2008-01-09T02:19:50 fix indentation in xmlTextWriterFullEndElement, as raised by Felipe Pena, * xmlwriter.c: fix indentation in xmlTextWriterFullEndElement, as raised by Felipe Pena, should fix #508156 Daniel svn path=/trunk/; revision=3668
Daniel Veillard caa1951d 2007-07-04T15:42:46 patch from Dodji Seketeli to avoid a leak on repeated uses of * xmlwriter.c: patch from Dodji Seketeli to avoid a leak on repeated uses of xmlTextWriterStartDocument() Daniel svn path=/trunk/; revision=3642
Rob Richards b8769d6f 2007-06-08T08:50:47 fixed problem with namespace declaration being written more than once per * xmlwriter.c: fixed problem with namespace declaration being written more than once per element start tag svn path=/trunk/; revision=3623
William M. Brack c1099be5 2007-01-31T18:38:56 repositioned #include for libxml.h to avoid compilation error on some * testAutomata.c, testRegexp.c, testThreads.c, testThreadsWin32.c, xmlwriter.c: repositioned #include for libxml.h to avoid compilation error on some architectures (bug #398277) svn path=/trunk/; revision=3578
Rob Richards 9db68f0c 2006-08-16T22:48:51 Add a document to the xmlwriter structure and pass document when writing * xmlwriter.c: Add a document to the xmlwriter structure and pass document when writing attribute content for encoding support.
Daniel Veillard 02c1f232 2006-04-27T08:10:25 patch from Jason Viers for line breaks after EndPI Daniel * xmlwriter.c: patch from Jason Viers for line breaks after EndPI Daniel
Rob Richards ffe47feb 2005-12-09T17:52:21 Insert space between pubid and sysid when both passed to * xmlwriter.c: Insert space between pubid and sysid when both passed to xmlTextWriterStartDTD and indenting not being used. Remove no longer used Mem callbacks.
Rob Richards a44f234d 2005-11-09T18:03:45 function consolidation when writing to xmlBuffer. Return error condition * xmlIO.c xmlwriter.c: function consolidation when writing to xmlBuffer. Return error condition not len if xmlwriter fails writing to buffer.
William M. Brack f4caa5e6 2005-10-20T09:04:05 fixed problem in xmlTextWriterVSprintf caused by misuse of vsnprintf added * xmlwriter.c: fixed problem in xmlTextWriterVSprintf caused by misuse of vsnprintf * configure.in, config.h.in: added a configuration check for va_copy and added a define for VA_COPY for xmlwriter.c fix * parser.c: fixed problem with CRLF split between chunks (bug #319279) (fix provided by Brion Vibber)
Daniel Veillard 75e389d4 2005-07-29T22:02:24 more cleanups based on sparse reports, added "make sparse" Daniel * Makefile.am globals.c parserInternals.c xmlreader.c xmlunicode.c xmlwriter.c: more cleanups based on sparse reports, added "make sparse" Daniel
Daniel Veillard ffa3c749 2005-07-21T13:24:09 applied a patch from Marcus Boerger to fix problems with calling * error.c globals.c parser.c runtest.c testHTML.c testSAX.c threads.c valid.c xmllint.c xmlreader.c xmlschemas.c xmlstring.c xmlwriter.c include/libxml/parser.h include/libxml/relaxng.h include/libxml/valid.h include/libxml/xmlIO.h include/libxml/xmlerror.h include/libxml/xmlexports.h include/libxml/xmlschemas.h: applied a patch from Marcus Boerger to fix problems with calling conventions on Windows this should fix #309757 Daniel
Daniel Veillard 5d4644ef 2005-04-01T13:11:58 revamped the elfgcchack.h format to cope with gcc4 change of aliasing * doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h format to cope with gcc4 change of aliasing allowed scopes, had to add extra informations to doc/libxml2-api.xml to separate the header from the c module source. * *.c: updated all c library files to add a #define bottom_xxx and reimport elfgcchack.h thereafter, and a bit of cleanups. * doc//* testapi.c: regenerated when rebuilding the API Daniel
Daniel Veillard 614fdc13 2005-02-23T14:05:37 applied a patch from Rob Richards fixing a couple of bugs in the writer * xmlwriter.c: applied a patch from Rob Richards fixing a couple of bugs in the writer Daniel
Daniel Veillard bd8fb0ad 2005-02-21T13:49:46 applied patch from Rob Richards to fix a problem with * xmlwriter.c: applied patch from Rob Richards to fix a problem with xmlTextWriterStartAttributeNS Daniel
Daniel Veillard d0cf7f6e 2004-11-09T16:17:02 integrated in "make tests" added -q option, and more conditional features * Makefile.am gentest.py testapi.c: integrated in "make tests" added -q option, and more conditional features fixes * catalog.c debugXML.c parser.c testThreads.c xmllint.c xmlschemastypes.c xmlwriter.cinclude/libxml/catalog.h include/libxml/debugXML.h: various compilation and conditional cleanups. * doc/*: regenerated Daniel
Daniel Veillard a521d287 2004-11-09T14:59:59 better handling of conditional features more testing on parser contexts * gentest.py testapi.c: better handling of conditional features * HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing on parser contexts closed leaks, error messages Daniel
Daniel Veillard d5cc0f7f 2004-11-06T19:24:28 augmented types supported a number of new bug fixes and documentation * gentest.py testapi.c: augmented types supported * HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new bug fixes and documentation updates. Daniel
Daniel Veillard dd6d3008 2004-11-03T14:20:29 more fixes and extending the tests coverage adding a type init interface * gentest.py testapi.c: more fixes and extending the tests coverage * relaxng.c include/libxml/relaxng.h: adding a type init interface * include/libxml/xmlerror.h parser.c xmlreader.c xmlwriter.c: more cleanups and bug fixes raised by the regression tests Daniel
Daniel Veillard e43cc574 2004-11-03T11:50:29 more fixes and extending the tests coverage more hardeing of APIs skip * gentest.py testapi.c: more fixes and extending the tests coverage * xmlwriter.c list.c: more hardeing of APIs * doc/apibuild.py: skip testapi.c when scanning the C files. Daniel
Daniel Veillard 03a53c34 2004-10-26T16:06:51 added checking for names values and dictionnaries generates a tons of * debugXML.c include/libxml/xmlerror.h: added checking for names values and dictionnaries generates a tons of errors * SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c include/libxml/tree.h: fixing the errors in the regression tests Daniel
William M. Brack 47a31884 2004-09-11T16:09:09 changed char array initialisation to avoid a complaint from some * xmlwriter.c: changed char array initialisation to avoid a complaint from some compiler(s) (bug 152308)
Daniel Veillard 62040be3 2004-05-17T03:17:26 avoid returning default namespace when searching from an attribute reverse * tree.c: avoid returning default namespace when searching from an attribute * entities.c xmlwriter.c: reverse xmlEncodeSpecialChars() behaviour back to escaping " since the normal serialization routines do not use it anymore, should close bug #134477 . Tried to make the writer avoid it too but it didn't work. Daniel
William M. Brack 87640d5f 2004-04-17T14:58:15 minor warning cleanup (no change to logic) fixed return value for internal * xmlschemas.c, xmlwriter.c, doc/examples/parse4.c, doc/examples/io2.c: minor warning cleanup (no change to logic) * xinclude: fixed return value for internal function xmlXIncludeLoadFallback (now always 0 or -1)
Daniel Veillard 500a1de5 2004-03-22T15:22:58 applied patch from Alfred Mickautsch for better DTD support. fixed bug * xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from Alfred Mickautsch for better DTD support. * SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c xmlschemas.c: fixed bug #137867 i.e. fixed properly the way reference counting is handled in the XML parser which had the side effect of removing a lot of hazardous cruft added to try to fix the problems associated as they popped up. * xmlIO.c: FILE * close fixup for stderr/stdout Daniel
Daniel Veillard ab69f366 2004-02-17T11:40:32 applied update from Alfred Mickautsch and the added patch from Lucas * xmlwriter.c include/libxml/xmlwriter.h: applied update from Alfred Mickautsch and the added patch from Lucas Brasilino Daniel
William M. Brack 1ce3c802 2004-02-06T13:03:38 fixed problem with return value of xmlTextWriterWriteIndent() (bug 133297) * xmlwriter.c: fixed problem with return value of xmlTextWriterWriteIndent() (bug 133297)
William M. Brack b9079053 2004-02-03T04:20:18 enhanced output indenting (bug 133264) * xmlwriter.c: enhanced output indenting (bug 133264)
William M. Brack a9c612c3 2004-02-01T10:04:05 moved serialization of attribute text data (xmlSerializeContent) into a * tree.c, include/libxml/tree.h: moved serialization of attribute text data (xmlSerializeContent) into a separate routine (xmlSerializeTxtContent) so it can be used by xmlwriter.c * xmlwriter.c: changed handling of attribute string to use the routine above (fixed bug 131548)
Daniel Veillard 4773df2a 2004-01-23T13:15:13 added io1.c an example ox xmlIO usage and io1.res test result, fixed a * doc/examples/*: added io1.c an example ox xmlIO usage and io1.res test result, fixed a awful lot of memory leaks showing up in testWriter.c, changed the examples and the Makefiles to test memory leaks. * xmlwriter.c: fixed a memory leak * Makefile.am: run the doc/examples regression tests as part of make tests * xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to compile an XPath expression within a context, currently the goal is to be able to reuse the XSLT stylesheet dictionnary, but this opens the door to others possible optimizations. * dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows to build a new dictionnary based on another read-only dictionnary. This is needed for XSLT to keep the stylesheet dictionnary read-only while being able to reuse the strings for the transformation dictionnary. * xinclude.c: fixed a dictionnar reference counting problem occuring when document parsing failed. * testSAX.c: adding option --repeat for timing 100times the parsing * doc/* : rebuilt all the docs Daniel
Daniel Veillard 20c5e787 2004-01-21T09:57:31 applied patch from Alfred Mickautsch fixing a memory leak reported on the * xmlwriter.c: applied patch from Alfred Mickautsch fixing a memory leak reported on the list. Daniel
William M. Brack 5d4cba41 2004-01-06T15:19:12 fixed Bug130593 fixed compilation warning * configure.in: fixed Bug130593 * xmlwriter.c: fixed compilation warning
Daniel Veillard 751c9ec6 2004-01-05T13:05:58 applied patch from Lucas Brasilino fixing an indent problem. Daniel * xmlwriter.c: applied patch from Lucas Brasilino fixing an indent problem. Daniel
Daniel Veillard 2cca446b 2004-01-02T20:04:23 applied the patch from Lucas Brasilino to add indentation support to * include/libxml/xmlwriter.h xmlwriter.c: applied the patch from Lucas Brasilino to add indentation support to xmlWriter Daniel
Daniel Veillard 10c08c7d 2003-12-09T15:14:26 applied the patch to xmlTextWriterStartPI() suggested by Daniel Schulman * xmlwriter.c: applied the patch to xmlTextWriterStartPI() suggested by Daniel Schulman in #128313 Daniel
Daniel Veillard 1e90661b 2003-12-05T14:57:46 cleanup the make rebuild in doc, this include new directive to stop * globals.c xmlwriter.c doc/apibuild.py include/libxml/globals.h include/libxml/pattern.h include/libxml/schemasInternals.h include/libxml/xmlexports.h include/libxml/xmlwriter.h: cleanup the make rebuild in doc, this include new directive to stop documentation warnings * doc/* doc/html/*: rebuilt the docs * pattern.c xmlreader.c include/libxml/pattern.h include/libxml/xmlreader.h: adding xmlTextReaderPreservePattern() to save nodes while scanning the tree with the reader, cleanup the way element were freed, and xmlTextReaderPreserve() implementation, the API might change for namespace binding support when compiling patterns. * doc/examples/*: added reader3.c exposing the xmlTextReaderPreserve() Daniel
Igor Zlatkovic b23de5ad 2003-11-27T18:36:46 added IN_LIBXML macro
Daniel Veillard 1d913863 2003-11-21T00:28:39 applied patch from Robert Stepanek to start import os schemas support, * xmlschemas.c: applied patch from Robert Stepanek to start import os schemas support, cleaned up stuff and the patch. * test/schemas/import0_0.* result/schemas/import0_0_0*: added test to regression, fixed a few regressions too. Daniel
Daniel Veillard 5841f0e0 2003-11-20T11:59:09 applied patch from Alfred Mickautsch, bugfixes and comments added his test * xmlwriter.c include/libxml/xmlwriter.h: applied patch from Alfred Mickautsch, bugfixes and comments * doc/examples/*: added his test as the xmlWriter example * doc/html/ doc/*.html: this resulted in some improvements * include/libxml/hash.h: fixed an inclusion problem when <libxml/hash.h> wasn't preceeded by <xml/parser.h> Daniel
William M. Brack b1d53165 2003-11-18T06:54:40 minor enhancement to prevent comment with unreferenced variable. edited * genChRanges.py, chvalid.c, include/libxml/chvalid.h: minor enhancement to prevent comment with unreferenced variable. * threads.c xmlreader.c xmlwriter.c: edited some comments to improve auto-generation of documentation * apibuild.py: minor change to an error message
Daniel Veillard 929714b7 2003-10-22T12:34:36 applied patch from Alfred Mickautsch fixing #125180 Daniel * xmlwriter.c: applied patch from Alfred Mickautsch fixing #125180 Daniel
Daniel Veillard 1d211e22 2003-10-20T22:32:39 added the xmlWriter module contributed by Alfred Mickautsch added room for * configure.in xmlwriter.c Makefile.am include/libxml/xmlwriter.h include/libxml/Makefile.am include/libxml/xmlversion.h.in: added the xmlWriter module contributed by Alfred Mickautsch * include/libxml/tree.h: added room for line and extra information * xmlreader.c python/tests/reader6.py: bugfixing some problem some of them introduced in September * win32/libxml2.def.src doc/libxml2-api.xml: regenerated the API Daniel