1
0
mirror of https://git.freebsd.org/ports.git synced 2026-06-02 11:08:52 +00:00

textproc/libxml2: really update to 2.15.1

Changelog: https://gitlab.gnome.org/GNOME/libxml2/-/blob/2.15/NEWS

Notably, all documentation generation requires a circular dependency
on textproc/libxslt. While the API documentation, in HTML, lives
on the upstream site [0], the man pages are now pre-rendered manually.

Also includes an upstream commit addressing unsafe pointer usage
in XPath, leading to security bugs in consumers like libxslt
(CVE-2025-10911). [1]

Mark the -python child port DEPRECATED without expiration date since
upstream has not provided a firm one yet, particularly the release
schedule for the next major version 2.16.

[0] https://gnome.pages.gitlab.gnome.org/libxml2/html/index.html
[1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/0e50b31902cdb1eb242eb361c123e9e033b2af87

Event: Snowstorm Special January 2026
With hat: desktop
PR: 291316
This commit is contained in:
Charlie Li
2026-01-26 21:13:49 -05:00
parent 5137742117
commit fc6c145ef0
7 changed files with 1083 additions and 85 deletions
+11 -2
View File
@@ -6,9 +6,12 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
COMMENT= Python interface for XML parser library for GNOME
MASTERDIR= ${.CURDIR}/../libxml2
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}
DEPRECATED= Planned for removal in 2.16: https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.15.0
USES+= gettext-runtime gnome python shebangfix
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
doxygen:devel/doxygen
USES+= gnome python shebangfix
USE_GNOME= libxml2
USE_PYTHON= autoplist distutils # generator.py not found in PEP-517 environment
SHEBANG_GLOB= *.py*
@@ -22,6 +25,7 @@ DESCR= ${.CURDIR}/pkg-descr
BUILD_WRKSRC= ${WRKSRC}/python
INSTALL_WRKSRC= ${BUILD_WRKSRC}
TEST_WRKSRC= ${BUILD_WRKSRC}
# Don't append pkg-plist from master port
PLIST=
@@ -29,4 +33,9 @@ PLIST=
DOCSDIR= ${PREFIX}/share/doc/libxml2-python
EXAMPLESDIR= ${PREFIX}/share/examples/libxml2-python
pre-build:
# ( cd ${WRKSRC} && ${DO_MAKE_BUILD} libxml2.la && \
# cd ${WRKSRC}/doc && ${DO_MAKE_BUILD} )
cd ${WRKSRC}/doc && ${DO_MAKE_BUILD} DOXYGEN=doxygen
.include "${MASTERDIR}/Makefile"
+20 -20
View File
@@ -1,10 +1,13 @@
PORTNAME?= libxml2
DISTVERSION= 2.14.6
DISTVERSION= 2.15.1
CATEGORIES?= textproc gnome
MASTER_SITES= GNOME
DISTNAME= libxml2-${DISTVERSION}
DIST_SUBDIR= gnome
PATCH_SITES= https://gitlab.gnome.org/GNOME/libxml2/-/commit/
PATCHFILES= 0e50b31902cdb1eb242eb361c123e9e033b2af87.patch:-p1
MAINTAINER= desktop@FreeBSD.org
COMMENT?= XML parser library for GNOME
WWW= http://xmlsoft.org/
@@ -18,16 +21,15 @@ USE_LDCONFIG= yes
GNU_CONFIGURE= yes
# Don't build with Python support unless requested
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/share/ \
--with-lzma=/usr \
--${LIBXML2_SLAVE:Dwith:Uwithout}-python${LIBXML2_SLAVE:D=${PYTHON_CMD}:U}
INSTALL_TARGET= install-strip
TEST_TARGET= check
OPTIONS_DEFINE= DOCS ICU READLINE STATIC THREAD_ALLOC
OPTIONS_DEFINE= ICU MANPAGES READLINE STATIC THREAD_ALLOC
OPTIONS_GROUP= LEGACY
OPTIONS_GROUP_LEGACY= HTTP LZMA ZLIB
OPTIONS_DEFAULT= HTTP LZMA READLINE STATIC ZLIB
OPTIONS_GROUP_LEGACY= HTTP ZLIB
OPTIONS_DEFAULT= HTTP READLINE STATIC ZLIB
OPTIONS_SUB= yes
HTTP_DESC= HTTP support
@@ -38,7 +40,6 @@ THREAD_ALLOC_DESC= Per-thread memory (DEVELOPERS ONLY!)
HTTP_CONFIGURE_WITH= http
ICU_LIB_DEPENDS= libicuuc.so:devel/icu
ICU_CONFIGURE_WITH= icu
LZMA_CONFIGURE_WITH= lzma
READLINE_LIB_DEPENDS= libreadline.so:devel/readline
READLINE_CONFIGURE_WITH= history \
readline
@@ -46,22 +47,21 @@ STATIC_CONFIGURE_ENABLE= static
THREAD_ALLOC_CONFIGURE_WITH= thread-alloc
ZLIB_CONFIGURE_WITH= zlib
post-patch:
@${REINPLACE_CMD} -e \
's|/etc/xml/catalog|${LOCALBASE}/share/xml/catalog|g; \
s|/etc/sgml/catalog|${LOCALBASE}/share/sgml/catalog|g' \
${WRKSRC}/doc/xmllint.1
.include <bsd.port.options.mk>
post-install:
.if !defined(LIBXML2_SLAVE)
# Documentation should be in DOCSDIR
@${MV} ${STAGEDIR}${PREFIX}/share/gtk-doc/html/libxml2 \
${STAGEDIR}${DOCSDIR}/devhelp
@${RM} -r ${STAGEDIR}${PREFIX}/share/gtk-doc
# Install remaining documentation that's not connected to autotools
${INSTALL_MAN} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}
.else
${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/site-packages/libxml2mod${PYTHON_SOABI}.so
.if defined(LIBXML2_SLAVE) && ${LIBXML2_SLAVE} == "python"
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/site-packages/libxml2mod${PYTHON_SOABI}.so
.endif
# To (manually) generate man pages, during every update:
# - install textproc/libxslt and textproc/docbook-xsl
# - xml2-config.1 is already present
# - in ${WRKSRC}/doc, run `xsltproc --nonet --novalid --param man.output.quietly 1 -o xmlcatalog.1 ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl xmlcatalog.xml`
# - repeat for xmllint.1
# - copy results into ${FILESDIR}
# - ${INSTALL_MAN} into ${STAGEDIR} as below
post-install-MANPAGES-on:
${INSTALL_MAN} ${FILESDIR}/*.1 ${STAGEDIR}${MANDIRS}/man1
.include <bsd.port.mk>
+5 -3
View File
@@ -1,3 +1,5 @@
TIMESTAMP = 1759693474
SHA256 (gnome/libxml2-2.14.6.tar.xz) = 7ce458a0affeb83f0b55f1f4f9e0e55735dbfc1a9de124ee86fb4a66b597203a
SIZE (gnome/libxml2-2.14.6.tar.xz) = 2327580
TIMESTAMP = 1768450034
SHA256 (gnome/libxml2-2.15.1.tar.xz) = c008bac08fd5c7b4a87f7b8a71f283fa581d80d80ff8d2efd3b26224c39bc54c
SIZE (gnome/libxml2-2.15.1.tar.xz) = 2004588
SHA256 (gnome/0e50b31902cdb1eb242eb361c123e9e033b2af87.patch) = e4f2d2cd26218bfe437d837c3003c3e58f3ea93baff62cc34c79341e83cf40bd
SIZE (gnome/0e50b31902cdb1eb242eb361c123e9e033b2af87.patch) = 3864
+32
View File
@@ -0,0 +1,32 @@
.TH xml2-config 1 "3 April 2022" Version 1.2.0
.SH NAME
xml2-config - script to get information about the installed version of libxml2
.SH SYNOPSIS
.B xml2-config
[\-\-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help]
.SH DESCRIPTION
\fIxml2-config\fP is a tool that is used to determine the compile and
linker flags that should be used to compile and link programs that use
\fIlibxml2\fP.
.SH OPTIONS
\fIxml2-config\fP accepts the following options:
.TP 8
.B \-\-version
Print the currently installed version of \fIlibxml2\fP on the standard output.
.TP 8
.B \-\-libs
Print the linker flags that are necessary to link a \fIlibxml2\fP program.
Add \-\-dynamic after \-\-libs to print only shared library linking
information.
.TP 8
.B \-\-cflags
Print the compiler flags that are necessary to compile a \fIlibxml2\fP program.
.TP 8
.B \-\-prefix=PREFIX
If specified, use PREFIX instead of the installation prefix that
\fIlibxml2\fP was built with when computing the output for the
\-\-cflags and \-\-libs options. This option must be specified before
any \-\-libs or \-\-cflags options.
.SH AUTHOR
This manual page was written by Fredrik Hallenberg <hallon@lysator.liu.se>,
for the Debian GNU/linux system (but may be used by others).
+355
View File
@@ -0,0 +1,355 @@
'\" t
.\" Title: xmlcatalog
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/27/2026
.\" Manual: xmlcatalog Manual
.\" Source: libxml2
.\" Language: English
.\"
.TH "XMLCATALOG" "1" "01/27/2026" "libxml2" "xmlcatalog Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
xmlcatalog \- Command line tool to parse and manipulate XML or SGML catalog files\&.
.SH "SYNOPSIS"
.HP \w'\fBxmlcatalog\fR\ 'u
\fBxmlcatalog\fR [\fB\-\-sgml\fR | \fB\-\-shell\fR | \fB\-\-convert\fR | \fB\-\-create\fR | \fB\-\-del\ \fR\fB\fIVALUE(S)\fR\fR | [\ \fB\-\-add\ \fR\fB\fITYPE\fR\fR\fB\ \fR\fB\fIORIG\fR\fR\fB\ \fR\fB\fIREPLACE\fR\fR\fB\ \fR\ |\ \fB\-\-add\ \fR\fB\fIFILENAME\fR\fR] | \fB\-\-noout\fR | \fB\-\-no\-super\-update\fR | [\fB\-v\fR\ |\ \fB\-\-verbose\fR]] {\fICATALOGFILE\fR} {\fIENTITIES\fR...}
.SH "DESCRIPTION"
.PP
\fBxmlcatalog\fR
is a command line application allowing users to monitor and manipulate
XML
and
SGML
catalogs\&. It is included in
\fBlibxml\fR(3)\&.
.PP
Its functions can be invoked from a single command from the command line, or it can perform multiple functions in interactive mode\&. It can operate on both
XML
and
SGML
files\&.
.SH "OPTIONS"
.PP
\fBxmlcatalog\fR
accepts the following options (in alphabetical order):
.PP
\fB\-\-add \fR\fB\fITYPE\fR\fR\fB \fR\fB\fIORIG\fR\fR\fB \fR\fB\fIREPLACE\fR\fR\fB \fR
.RS 4
Add an entry to
CATALOGFILE\&.
\fITYPE\fR
indicates the type of entry\&. Possible types are:
\fIpublic\fR, \fIsystem\fR, \fIuri\fR, \fIrewriteSystem\fR, \fIrewriteURI\fR, \fIdelegatePublic\fR, \fIdelegateSystem\fR, \fIdelegateURI\fR, \fInextCatalog\fR\&.
\fIORIG\fR
is the original reference to be replaced, and
\fIREPLACE\fR
is the
URI
of the replacement entity to be used\&. The
\fB\-\-add\fR
option will not overwrite
CATALOGFILE, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&. The
\fB\-\-add\fR
will always take three parameters even if some of the
XML
catalog constructs will have only a single argument\&.
.RE
.PP
\fB\-\-add \fR\fB\fIFILENAME\fR\fR
.RS 4
If the
\fB\-\-add\fR
option is used following the
\fB\-\-sgml\fR
option, only a single argument, a
\fIFILENAME\fR, is used\&. This is used to add the name of a catalog file to an
SGML
supercatalog, a file that contains references to other included
SGML
catalog files\&.
.RE
.PP
\fB\-\-convert\fR
.RS 4
Convert SGML catalog to XML\&.
.RE
.PP
\fB\-\-create\fR
.RS 4
Create a new
XML
catalog\&. Outputs to
stdout, ignoring
\fIfilename\fR
unless
\fB\-\-noout\fR
is used, in which case it creates a new catalog file
\fIfilename\fR\&.
.RE
.PP
\fB\-\-del \fR\fB\fIVALUE(S)\fR\fR
.RS 4
Remove entries from
\fICATALOGFILE\fR
matching
\fIVALUE(S)\fR\&. The
\fB\-\-del\fR
option will not overwrite
\fICATALOGFILE\fR, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&.
.RE
.PP
\fB\-\-noout\fR
.RS 4
Save output to the named file rather than outputting to
stdout\&.
.RE
.PP
\fB\-\-no\-super\-update\fR
.RS 4
Do not update the
SGML
super catalog\&.
.RE
.PP
\fB\-\-shell\fR
.RS 4
Run a shell allowing interactive queries on catalog file
\fICATALOGFILE\fR\&. For the set of available commands see
the section called \(lqSHELL COMMANDS\(rq\&.
.RE
.PP
\fB\-\-sgml\fR
.RS 4
Uses
SGML
super catalogs for
\fB\-\-add\fR
and
\fB\-\-del\fR
options\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Output debugging information\&.
.RE
.PP
Invoking
\fBxmlcatalog\fR
non\-interactively without a designated action (imposed with options like
\fB\-\-add\fR) will result in a lookup of the catalog entry for
\fIENTITIES\fR
in the catalog denoted with
\fICATALOGFILE\fR\&. The corresponding entries will be output to the command line\&. This mode of operation, together with
\fB\-\-shell\fR
mode and non\-modifying (i\&.e\&. without
\fB\-\-noout\fR) direct actions, allows for a special shortcut of the void
\fICATALOGFILE\fR
specification (possibly expressed as "" in the shell environment) appointing the default system catalog\&. That simplifies the handling when its exact location is irrelevant but the respective built\-in still needs to be consulted\&.
.SH "SHELL COMMANDS"
.PP
Invoking
\fBxmlcatalog\fR
with the
\fB\-\-shell \fR\fB\fICATALOGFILE\fR\fR
option opens a command line shell allowing interactive access to the catalog file identified by
\fICATALOGFILE\fR\&. Invoking the shell provides a command line prompt after which the following commands (described in alphabetical order) can be entered\&.
.PP
\fBadd \fR\fB\fITYPE\fR\fR\fB \fR\fB\fIORIG\fR\fR\fB \fR\fB\fIREPLACE\fR\fR\fB \fR
.RS 4
Add an entry to the catalog file\&.
\fITYPE\fR
indicates the type of entry\&. Possible types are:
\fIpublic\fR, \fIsystem\fR, \fIuri\fR, \fIrewriteSystem\fR, \fIrewriteURI\fR, \fIdelegatePublic\fR, \fIdelegateSystem\fR, \fIdelegateURI\fR, \fInextCatalog\fR\&.
\fIORIG\fR
is the original reference to be replaced, and
\fIREPLACE\fR
is the
URI
of the replacement entity to be used\&. The
\fB\-\-add\fR
option will not overwrite
CATALOGFILE, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&. The
\fB\-\-add\fR
will always take three parameters even if some of the
XML
catalog constructs will have only a single argument\&.
.RE
.PP
\fBdebug\fR
.RS 4
Print debugging statements showing the steps
\fBxmlcatalog\fR
is executing\&.
.RE
.PP
\fBdel \fR\fB\fIVALUE(S)\fR\fR
.RS 4
Remove the catalog entry corresponding to
\fIVALUE(S)\fR\&.
.RE
.PP
\fBdump\fR
.RS 4
Print the current catalog\&.
.RE
.PP
\fBexit\fR
.RS 4
Quit the shell\&.
.RE
.PP
\fBpublic \fR\fB\fIPUBLIC\-ID\fR\fR
.RS 4
Execute a Formal Public Identifier lookup of the catalog entry for
\fIPUBLIC\-ID\fR\&. The corresponding entry will be output to the command line\&.
.RE
.PP
\fBquiet\fR
.RS 4
Stop printing debugging statements\&.
.RE
.PP
\fBsystem \fR\fB\fISYSTEM\-ID\fR\fR
.RS 4
Execute a Formal Public Identifier lookup of the catalog entry for
\fISYSTEM\-ID\fR\&. The corresponding entry will be output to the command line\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBXML_CATALOG_FILES\fR
.RS 4
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default catalog from
/etc/xml/catalog
or, more specifically,
${sysconfdir}/xml/catalog\&.
.RE
.SH "DIAGNOSTICS"
.PP
\fBxmlcatalog\fR
return codes provide information that can be used when calling it from scripts\&.
.PP
\fB0\fR
.RS 4
No error
.RE
.PP
\fB1\fR
.RS 4
Failed to remove an entry from the catalog
.RE
.PP
\fB2\fR
.RS 4
Failed to save to the catalog, check file permissions
.RE
.PP
\fB3\fR
.RS 4
Failed to add an entry to the catalog
.RE
.PP
\fB4\fR
.RS 4
Failed to look up an entry in the catalog
.RE
.SH "SEE ALSO"
.PP
\fBlibxml\fR(3)
.PP
More information can be found at
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBlibxml\fR(3)
web page
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBlibxml\fR(3)
catalog support web page at
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
James Clark\*(Aqs
SGML
catalog page
\m[blue]\fB\%http://www.jclark.com/sp/catalog.htm\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
OASIS
XML
catalog specification
\m[blue]\fB\%http://www.oasis-open.org/committees/entity/spec.html\fR\m[]
.RE
.sp
.SH "AUTHOR"
.PP
\fBJohn Fleck\fR <\&jfleck@inkstain\&.net\&>
.RS 4
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2004
.br
+656
View File
@@ -0,0 +1,656 @@
'\" t
.\" Title: xmllint
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/27/2026
.\" Manual: xmllint Manual
.\" Source: xmllint
.\" Language: English
.\"
.TH "XMLLINT" "1" "01/27/2026" "xmllint" "xmllint Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
xmllint \- command line XML tool
.SH "SYNOPSIS"
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-quiet\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-huge\fR | \fB\-\-nocompact\fR | \fB\-\-nodefdtd\fR | \fB\-\-nodict\fR | \fB\-\-noenc\fR | \fB\-\-noent\fR | \fB\-\-nofixup\-base\-uris\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-strict\-namespace\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-max\-ampl\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-pretty\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schematron\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR | \fB\-\-c14n11\fR | \fB\-\-exc\-c14n\fR | \fB\-\-pedantic\fR | \fB\-\-sax\fR | \fB\-\-sax1\fR | \fB\-\-oldxml10\fR] {\fIXML\-FILE(S)\fR... | \-}
.SH "DESCRIPTION"
.PP
The
\fBxmllint\fR
program parses one or more
XML
files, specified on the command line as
\fIXML\-FILE\fR
(or the standard input if the filename provided is
\fB\-\fR
)\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in
XML
code and in the
XML
parser itself\&.
.PP
\fBxmllint\fR
is part of the libxml2 library\&.
.SH "VALIDATION OPTIONS"
.PP
Options enabling validation\&.
.PP
\fB\-\-dtdvalid \fR\fB\fIURL\fR\fR
.RS 4
Use the
DTD
specified by an
\fIURL\fR
for validation\&.
.RE
.PP
\fB\-\-dtdvalidfpi \fR\fB\fIFPI\fR\fR
.RS 4
Use the
DTD
specified by a Formal Public Identifier
\fIFPI\fR
for validation, note that this will require a catalog exporting that Formal Public Identifier to work\&.
.RE
.PP
\fB\-\-relaxng \fR\fB\fISCHEMA\fR\fR
.RS 4
Use RelaxNG file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-schema \fR\fB\fISCHEMA\fR\fR
.RS 4
Use a W3C
XML
Schema file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-schematron \fR\fB\fISCHEMA\fR\fR
.RS 4
Use a Schematron file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-valid\fR
.RS 4
Determine if the document is a valid instance of the included Document Type Definition (DTD)\&. A
DTD
to be validated against also can be specified at the command line using the
\fB\-\-dtdvalid\fR
option\&. By default,
\fBxmllint\fR
also checks to determine if the document is well\-formed\&.
.RE
.PP
\fB\-\-strict\-namespace\fR
.RS 4
Return an error if the document is well\-formed, but has namespace errors\&. This enforces namespace\-well\-formedness\&.
.RE
.SH "PARSER OPTIONS"
.PP
The following options set the respective parser options\&.
.PP
\fB\-\-dtdattr\fR
.RS 4
Fetch external
DTD
and populate the tree with inherited attributes\&. Implies
\fB\-\-loaddtd\fR\&.
.RE
.PP
\fB\-\-huge\fR
.RS 4
Ignore some hardcoded parser limits\&.
.RE
.PP
\fB\-\-loaddtd\fR
.RS 4
Fetch an external
DTD
and external parameter entities\&.
.RE
.PP
\fB\-\-max\-ampl \fR\fB\fIINTEGER\fR\fR
.RS 4
Set the maximum amplification factor which protects against exponential entity expansion ("billion laughs")\&. The default value is 5\&. Documents making heavy use of entity expansion may require a higher value\&.
.RE
.PP
\fB\-\-noblanks\fR
.RS 4
Drop "ignorable" blank spaces\&. This option is unreliable and shouldn\*(Aqt be used\&.
.RE
.PP
\fB\-\-nocatalogs\fR
.RS 4
Do not use any catalogs\&.
.RE
.PP
\fB\-\-nocdata\fR
.RS 4
Substitute CDATA section by equivalent text nodes\&.
.RE
.PP
\fB\-\-nodefdtd\fR
.RS 4
Do not set default HTML doctype (parser option HTML_PARSE_NODEFDTD)\&.
.RE
.PP
\fB\-\-noenc\fR
.RS 4
Ignore encoding declaration (parser option XML_PARSE_IGNORE_ENC)\&.
.RE
.PP
\fB\-\-noent\fR
.RS 4
Substitute entity values for entity references\&. By default,
\fBxmllint\fR
leaves entity references in place\&. This enables loading of external DTDs and entities\&.
.RE
.PP
\fB\-\-nofixup\-base\-uris\fR
.RS 4
Don\*(Aqt fix xml:base URIs when processing XIncludes (parser option XML_PARSE_NOBASEFIX)\&.
.RE
.PP
\fB\-\-nonet\fR
.RS 4
Do not use the Internet to fetch
DTDs or entities\&. Has no effect with libxml2 2\&.15 or later\&.
.RE
.PP
\fB\-\-nowarning\fR
.RS 4
Do not emit warnings from the parser and/or validator\&.
.RE
.PP
\fB\-\-nsclean\fR
.RS 4
Remove redundant namespace declarations\&.
.RE
.PP
\fB\-\-oldxml10\fR
.RS 4
Use deprecated parsing rules before XML 1\&.0, 5th edition\&.
.RE
.PP
\fB\-\-pedantic\fR
.RS 4
Enable additional warnings\&.
.RE
.PP
\fB\-\-recover\fR
.RS 4
Output any parsable portions of an invalid document\&. Exact behavior is unspecified\&. Use of this option is discouraged\&.
.RE
.PP
\fB\-\-xinclude\fR
.RS 4
Do XInclude processing\&.
.RE
.SH "MISCELLANEOUS OPTIONS"
.PP
Options that don\*(Aqt fall in another category\&.
.PP
\fB\-\-catalogs\fR
.RS 4
Use the
SGML
catalog(s) from
\fBSGML_CATALOG_FILES\fR\&.
XML
catalogs are loaded by default\&.
.RE
.PP
\fB\-\-dropdtd\fR
.RS 4
Remove
DTD
after parsing\&.
.RE
.PP
\fB\-\-html\fR
.RS 4
Use the
HTML
parser\&.
.RE
.PP
\fB\-\-path "\fR\fB\fIPATH(S)\fR\fR\fB"\fR
.RS 4
Use the (space\- or colon\-separated) list of filesystem paths specified by
\fIPATHS\fR
to load
DTDs or entities\&. Enclose space\-separated lists by quotation marks\&.
.RE
.PP
\fB\-\-quiet\fR
.RS 4
Don\*(Aqt print informational messages to stderr\&.
.RE
.PP
\fB\-\-sax\fR
.RS 4
Print SAX callbacks for debugging\&. Can be used for streaming DTD and Schema validation when used with
\fB\-\-noout\fR\&.
.RE
.PP
\fB\-\-shell\fR
.RS 4
Run a navigating shell\&. Details on available commands in shell mode are below (see
the section called \(lqSHELL COMMANDS\(rq)\&.
.RE
.PP
\fB\-\-stream\fR
.RS 4
Use streaming
API
\- useful when used in combination with
\fB\-\-relaxng\fR
or
\fB\-\-valid\fR
options for validation of files that are too large to be held in memory\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Display the version of libxml2 used\&.
.RE
.SH "OUTPUT OPTIONS"
.PP
Options controlling output\&. Except for
\fB\-\-noout\fR
these have no effect in SAX or stream mode\&.
.PP
\fB\-\-compress\fR
.RS 4
Turn on
\fBgzip\fR(1)
compression of output\&.
.RE
.PP
\fB\-\-c14n\fR, \fB\-\-c14n11\fR, \fB\-\-exc\-c14n\fR
.RS 4
Use the W3C
XML
Canonicalisation (C14N) to serialize the result of parsing to
stdout\&. It keeps comments in the result\&.
.RE
.PP
\fB\-\-encode \fR\fB\fIENCODING\fR\fR
.RS 4
Output in the given encoding\&. Note that this works for full document not fragments or result from XPath queries\&.
.RE
.PP
\fB\-\-format\fR
.RS 4
Reformat and reindent the output\&. The
\fBXMLLINT_INDENT\fR
environment variable controls the indentation\&. The default value is two spaces " ")\&.
.sp
Especially in the absence of a DTD, this feature has never worked reliably and is fundamentally broken\&.
.RE
.PP
\fB\-\-noout\fR
.RS 4
Suppress output\&. By default,
\fBxmllint\fR
outputs the result tree\&.
.RE
.PP
\fB\-\-output \fR\fB\fIFILE\fR\fR
.RS 4
Define a file path where
\fBxmllint\fR
will save the result of parsing\&. Usually the programs build a tree and save it on
stdout, with this option the result
XML
instance will be saved onto a file\&.
.RE
.PP
\fB\-\-pretty \fR\fB\fIINTEGER\fR\fR
.RS 4
Value 0 means no formatting, 1 means XML_SAVE_FORMAT (same as \-\-format), 2 means XML_SAVE_WSNONSIG\&.
.RE
.PP
\fB\-\-xmlout\fR
.RS 4
Used in conjunction with
\fB\-\-html\fR\&. Usually when
HTML
is parsed the document is saved with the
HTML
serializer\&. But with this option the resulting document is saved with the
XML
serializer\&. This is primarily used to generate
XHTML
from
HTML
input\&.
.RE
.SH "DEBUG OPTIONS"
.PP
The following options can be used to debug the libxml2 library\&. Behavior of these options may change without notice\&.
.PP
\fB\-\-auto\fR
.RS 4
Generate a small document for testing purposes\&.
.RE
.PP
\fB\-\-copy\fR
.RS 4
Test the internal copy implementation\&.
.RE
.PP
\fB\-\-debug\fR
.RS 4
Parse a file and output an annotated tree of the in\-memory version of the document\&.
.RE
.PP
\fB\-\-insert\fR
.RS 4
Test for valid insertions\&. DEPRECATED: This feature will be removed\&.
.RE
.PP
\fB\-\-load\-trace\fR
.RS 4
Display all the documents loaded during the processing to
stderr\&.
.RE
.PP
\fB\-\-maxmem \fR\fB\fINNBYTES\fR\fR
.RS 4
Test the parser memory support\&.
\fINNBYTES\fR
is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of
XML
files will not exhaust the virtual memory of the server running them\&.
.RE
.PP
\fB\-\-memory\fR
.RS 4
Parse from memory\&.
.RE
.PP
\fB\-\-nocompact\fR
.RS 4
Do not generate compact text nodes (parser option XML_PARSE_COMPACT)\&. Only for debugging\&.
.RE
.PP
\fB\-\-nodict\fR
.RS 4
Don\*(Aqt use dictionaries (parser option XML_PARSE_NODICT)\&. Only for debugging\&.
.RE
.PP
\fB\-\-noxincludenode\fR
.RS 4
Do XInclude processing but do not generate XInclude start and end nodes\&.
.RE
.PP
\fB\-\-pattern \fR\fB\fIPATTERNVALUE\fR\fR
.RS 4
Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
.RE
.PP
\fB\-\-postvalid\fR
.RS 4
Validate after parsing has completed\&.
.RE
.PP
\fB\-\-push\fR
.RS 4
Use the push mode of the parser\&.
.RE
.PP
\fB\-\-repeat\fR
.RS 4
Repeat 100 times, for timing or profiling\&.
.RE
.PP
\fB\-\-sax1\fR
.RS 4
Use deprecated SAX1 interface (only for debugging)\&.
.RE
.PP
\fB\-\-timing\fR
.RS 4
Output information about the time it takes
\fBxmllint\fR
to perform the various steps\&.
.RE
.PP
\fB\-\-walker\fR
.RS 4
Test the walker module, which is a reader interface but for a document tree, instead of using the reader
API
on an unparsed document it works on an existing in\-memory tree\&. Used for debugging\&.
.RE
.PP
\fB\-\-xpath "\fR\fB\fIXPath_expression\fR\fR\fB"\fR
.RS 4
Run an XPath expression given as argument and print the result\&. In case of a nodeset result, each node in the node set is serialized in full in the output\&. In case of an empty node set the "XPath set is empty" result will be shown and exit code 11 will be returned\&.\&.
.RE
.SH "SHELL COMMANDS"
.PP
\fBxmllint\fR
offers an interactive shell mode invoked with the
\fB\-\-shell\fR
command\&. Available commands in shell mode include (in alphabetical order):
.PP
\fBbase\fR
.RS 4
Display
XML
base of the node\&.
.RE
.PP
\fBbye\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBcat \fR\fB\fINODE\fR\fR
.RS 4
Display the given node or the current one\&.
.RE
.PP
\fBcd \fR\fB\fIPATH\fR\fR
.RS 4
Change the current node to the given path (if unique) or root if no argument is given\&.
.RE
.PP
\fBdir \fR\fB\fIPATH\fR\fR
.RS 4
Dumps information about the node (namespace, attributes, content)\&.
.RE
.PP
\fBdu \fR\fB\fIPATH\fR\fR
.RS 4
Show the structure of the subtree under the given path or the current node\&.
.RE
.PP
\fBexit\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBhelp\fR
.RS 4
Show this help\&.
.RE
.PP
\fBload \fR\fB\fIFILENAME\fR\fR
.RS 4
Load a new document with the given filename\&.
.RE
.PP
\fBls \fR\fB\fIPATH\fR\fR
.RS 4
List contents of the given path or the current directory\&.
.RE
.PP
\fBpwd\fR
.RS 4
Display the path to the current node\&.
.RE
.PP
\fBquit\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBsave \fR\fB\fIFILENAME\fR\fR
.RS 4
Save the current document to the given filename or to the original name\&.
.RE
.PP
\fBvalidate\fR
.RS 4
Check the document for errors\&.
.RE
.PP
\fBwrite \fR\fB\fIFILENAME\fR\fR
.RS 4
Write the current node to the given filename\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBSGML_CATALOG_FILES\fR
.RS 4
SGML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBSGML_CATALOG_FILES\fR
environment variable to a list of catalogs\&. An empty one should deactivate loading the default catalog\&.
.RE
.PP
\fBXML_CATALOG_FILES\fR
.RS 4
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default catalog\&.
.RE
.PP
\fBXML_DEBUG_CATALOG\fR
.RS 4
Setting the environment variable
\fBXML_DEBUG_CATALOG\fR
to
\fInon\-zero\fR
using the
\fBexport\fR
command outputs debugging information related to catalog operations\&.
.RE
.PP
\fBXMLLINT_INDENT\fR
.RS 4
Setting the environment variable
\fBXMLLINT_INDENT\fR
controls the indentation\&. The default value is two spaces " "\&.
.RE
.SH "DIAGNOSTICS"
.PP
\fBxmllint\fR
return codes provide information that can be used when calling it from scripts\&.
.PP
\fB0\fR
.RS 4
No error
.RE
.PP
\fB1\fR
.RS 4
Unclassified
.RE
.PP
\fB2\fR
.RS 4
Error in
DTD
.RE
.PP
\fB3\fR
.RS 4
Validation error
.RE
.PP
\fB4\fR
.RS 4
Document isn\*(Aqt well\-formed or couldn\*(Aqt be read
.RE
.PP
\fB5\fR
.RS 4
Error in schema compilation
.RE
.PP
\fB6\fR
.RS 4
Error writing output
.RE
.PP
\fB7\fR
.RS 4
Error in pattern (generated when
\fB\-\-pattern\fR
option is used)
.RE
.PP
\fB9\fR
.RS 4
Out of memory error
.RE
.PP
\fB10\fR
.RS 4
XPath evaluation error
.RE
.PP
\fB11\fR
.RS 4
XPath result is empty
.RE
.SH "SEE ALSO"
.PP
More information can be found in the libxml2 repo at
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2\fR\m[]
.SH "AUTHORS"
.PP
\fBJohn Fleck\fR <\&jfleck@inkstain\&.net\&>
.RS 4
.RE
.PP
\fBZiying Sherwin\fR <\&sherwin@nlm\&.nih\&.gov\&>
.RS 4
.RE
.PP
\fBHeiko Rupp\fR <\&hwr@pilhuhn\&.de\&>
.RS 4
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2004
.br
+4 -60
View File
@@ -51,64 +51,8 @@ lib/cmake/libxml2/libxml2-config.cmake
%%STATIC%%lib/libxml2.a
lib/libxml2.so
lib/libxml2.so.16
lib/libxml2.so.16.0.6
lib/libxml2.so.16.1.1
libdata/pkgconfig/libxml-2.0.pc
%%PORTDOCS%%%%DOCSDIR%%/devhelp/general.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/home.png
%%PORTDOCS%%%%DOCSDIR%%/devhelp/index.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/left.png
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-HTMLparser.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-HTMLtree.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-SAX.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-SAX2.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-c14n.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-catalog.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-chvalid.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-debugXML.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-dict.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-encoding.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-entities.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-globals.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-hash.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-list.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-nanoftp.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-nanohttp.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-parser.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-parserInternals.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-pattern.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-relaxng.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-schemasInternals.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-schematron.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-threads.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-tree.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-uri.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-valid.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xinclude.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xlink.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlIO.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlautomata.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlerror.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlexports.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlmemory.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlmodule.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlreader.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlregexp.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlsave.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlschemas.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlschemastypes.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlstring.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlunicode.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlversion.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xmlwriter.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xpath.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xpathInternals.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-xpointer.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2.devhelp2
%%PORTDOCS%%%%DOCSDIR%%/devhelp/right.png
%%PORTDOCS%%%%DOCSDIR%%/devhelp/style.css
%%PORTDOCS%%%%DOCSDIR%%/devhelp/up.png
%%PORTDOCS%%%%DOCSDIR%%/xmlcatalog.html
%%PORTDOCS%%%%DOCSDIR%%/xmllint.html
share/man/man1/xml2-config.1.gz
share/man/man1/xmlcatalog.1.gz
share/man/man1/xmllint.1.gz
%%MANPAGES%%share/man/man1/xml2-config.1.gz
%%MANPAGES%%share/man/man1/xmlcatalog.1.gz
%%MANPAGES%%share/man/man1/xmllint.1.gz