{{Short description|Free software library}} {{Lowercase}} {{redirect-distinguish|libXML|XML Library}} {{Use dmy dates|date=September 2025}} {{Infobox software | name = libxml2 | author = The GNOME Project | released = {{Start date and age|1999|09|23}} | latest release version = {{wikidata|property|edit|reference|P348}} | latest release date = {{Start date and age|{{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}}|df=yes}} | programming language = C | operating system = cross-platform<ref>{{cite web |date=28 November 2017 |title=Introduction |url=http://xmlsoft.org/intro.html |url-status=deviated |archive-url=https://web.archive.org/web/20180406093245/http://www.xmlsoft.org/intro.html |archive-date=6 April 2018 |access-date=25 March 2018}}</ref><ref name="libxml2wiki">{{cite web |title=GNOME / libxml2 / Wiki / Home |url=https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home |access-date=18 September 2025 |website=gitlab.gnome.org}}</ref>{{rp||quote= Libxml2 is known to be very portable, the library should build and work without serious troubles on a variety of systems (Linux, Unix, Windows, CygWin, MacOS, RISC Os, OS/2, VMS, QNX, MVS, ...) }} | genre = XML parser, XML validator | license = MIT License }} '''libxml2''' is a software library for parsing XML documents. It is also the basis for the libxslt library which processes XSLT-1.0 stylesheets.

== Description == Written in the C programming language, libxml2 provides bindings to C++, Ch,<ref>{{cite web |title=ch libxml2 open source binding |url=https://chlibxml2.sourceforge.net/ |access-date=18 September 2025 |website=chlibxml2.sourceforge.net}}</ref> XSH, C#, Python, Swift, Kylix/Delphi and other Pascals, Ruby, Perl, Common Lisp,<ref>{{cite web |title=cl-libxml2 High-level wrapper around libxml2 and libxslt libraries |url=https://code.google.com/archive/p/cl-libxml2/ |url-status=live |archive-url=https://web.archive.org/web/20140418234643/http://code.google.com/p/cl-libxml2/ |archive-date=18 April 2014 |access-date=18 April 2014 |website=code.google.com}}</ref> and PHP.<ref>{{Cite web |title=libxml |url=http://php.net/manual/en/book.libxml.php |url-status=live |archive-url=https://web.archive.org/web/20160510034323/http://php.net/manual/en/book.libxml.php |archive-date=10 May 2016 |access-date=16 May 2016 |website=php.net}}</ref> It was originally developed for the GNOME project, but can be used outside it. libxml2's code is highly portable<ref>{{Cite web |title=Python bindings |url=https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Python-bindings |access-date=18 September 2025 |website=gitlab.gnome.org}}</ref> since it only depends on standard ANSI C libraries<ref>{{Cite web |title=The XML C parser and toolkit of Gnome |url=http://www.xmlsoft.org/xml.html |url-status=deviated |archive-url=https://web.archive.org/web/20160610180046/http://www.xmlsoft.org/xml.html |archive-date=10 June 2016 |access-date=16 May 2016 |website=xmlsoft.org}}</ref> and it is available under the MIT license<ref name="libxml2wiki" /> since 2002, when it was previously made available under the GNU Lesser General Public License.<ref>Commit c575b997, written by Daniel Veillard on February 8, 2022, as archived on [https://gitlab.gnome.org/GNOME/libxml2/-/commit/c575b997d85d4791d852ad43e175d47a64cf8b3c gitlab.gnome.org].</ref> It has become the de facto standard XML and HTML parsing library in the open-source world, being shipped in most of the Linux distributions.<ref>{{Cite web |last=Borisov |first=Bobby |date=2025-12-09 |title=Libxml2 Becomes Officially Unmaintained After Maintainer Steps Down |url=https://linuxiac.com/libxml2-becomes-officially-unmaintained/ |access-date=2026-04-03 |language=en-US}}</ref><ref>{{Cite web |title=libxml2 Maintainer Stepping Down - "More Or Less Unmaintained For Now" |url=https://www.phoronix.com/news/Libxml2-No-Maintainer |access-date=2026-04-03 |website=www.phoronix.com |language=en}}</ref>

It includes the command-line utility '''xmllint''' and an HTML parser.<ref>{{cite web |last1=Veillard |first1=Daniel |title=HTMLparser: interface for an HTML 4.0 non-verifying parser |url=https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-HTMLparser.html |url-status=deviated |archive-url=https://web.archive.org/web/20230506080926/https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-HTMLparser.html |archive-date=6 May 2023 |access-date=6 May 2023 |website=libxml2 Reference Manual |publisher=GNOME}}</ref>

As of June 2025, libxml2 was being maintained by a single person, Nick Wellnhofer. <ref name="NWellnhofer"> {{Cite web |title=NWellnhofer |url=https://discourse.gnome.org/u/nwellnhof/summary |url-status=live |access-date=15 November 2025 |website=gnome.org}}</ref>

While the maintainer is an unpaid volunteer, the library is used in commercial software. In June 2025, Wellnhofer declared that he will treat security problem reports as normal bugs, fixed when there is time. In taking this stance, Wellnhofer hoped to encourage commercial users of the library to contribute work or money for maintenance.<ref name="Brockmeier">{{cite news |last1=Brockmeier |first1=Joe |date=25 June 2025 |title=Libxml2's 'no security embargoes' policy |url=https://lwn.net/Articles/1025971/ |url-status=live |archive-url=https://web.archive.org/web/20250710020924/https://lwn.net/Articles/1025971/ |archive-date=10 July 2025 |access-date=16 July 2025 |work=LWN.net |language=en}}</ref>

On 15 September 2025, Wellnhofer announced that he was stepping down as maintainer.<ref name="Wellnhofer-stepping-down-libxml2">{{cite web |title=Stepping down as libxml2 maintainer |url=https://discourse.gnome.org/t/stepping-down-as-libxml2-maintainer/31398 |url-status=live |archive-url=https://web.archive.org/web/20250915230021/https://discourse.gnome.org/t/stepping-down-as-libxml2-maintainer/31398 |archive-date=15 September 2025 |access-date=16 September 2025 |website=discourse.gnome.org}}</ref><ref>{{cite web |last=jzb |date=17 September 2025 |title=Libxml2 2.15.0 released |url=https://lwn.net/Articles/1038478/ |access-date=18 September 2025 |website=lwn.net}}</ref> He has since started a libxml fork re-licensed under the GNU Affero General Public License.<ref>{{Cite web |last=nwellnhof |title=libxml2-ee |url=https://codeberg.org/nwellnhof/libxml2-ee |access-date=2026-04-03 |website=Codeberg.org |language=en-US}}</ref>

== See also == {{Portal|Free and open-source software}} * libxslt (the LibXML2's XSLT module) * XML validation * Comparison of HTML parsers * Expat (library) * Saxon XSLT * Xerces * GNOME Project

== References == {{Reflist}}

== External links == * {{Official website}} * {{cite web |title=XML::LibXML |url=https://metacpan.org/dist/XML-LibXML/view/LibXML.pod |access-date=18 September 2025 |website=metacpan.org}} (Perl module)

{{GNOME}}

Category:C (programming language) libraries Category:Free software programmed in C Category:GNOME libraries Category:Software using the MIT license Category:XML parsers

{{Compu-library-stub}} {{GNOME-stub}} {{Markup-languages-stub}}