XMLCATALOG(1)
π XMLCATALOG(1) π
okay bestie, pull up a chair, we're reading the xmlcatalog manual page together and honestly? it's giving main character energy for your XML/SGML catalogs. it lives in the xmlcatalog Manual, and it is SO ready to be your new fave little command line tool. π
β¨ NAME β¨
xmlcatalog β a command line tool that parses and manipulates XML or SGML catalog files. no cap, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
xmlcatalog [--sgml | --shell | --convert | --create | --del VALUE(S) |
[ --add TYPE ORIG REPLACE | --add FILENAME] | --noout |
--no-super-update | [-v | --verbose]] {CATALOGFILE}
{ENTITIES...}
π DESCRIPTION π
xmlcatalog is a command line application that lets you monitor and manipulate XML and SGML catalogs. it's literally included in libxml(3), so you already know it's the real deal. β¨
its functions can be invoked as a single command from the command line, OR it can do a whole bunch of functions in interactive mode. and the best part? it can operate on both XML and SGML files. versatile icon behavior, honestly. π
π OPTIONS π
xmlcatalog accepts the following options, and yes, they're in alphabetical order because we're organized in this house:
--add TYPE ORIG REPLACEβ add an entry to CATALOGFILE.TYPEtells you what kind of entry it is. the possible types are:public,system,uri,rewriteSystem,rewriteURI,delegatePublic,delegateSystem,delegateURI,nextCatalog.ORIGis the original reference that's getting replaced, andREPLACEis the URI of the replacement entity you're swapping in. heads up bestie: the--addoption will not overwrite CATALOGFILE, it outputs to stdout, unless--nooutis used. and--addwill always take three parameters, even when some of the XML catalog constructs only have a single argument. three is the number, periodt. π--add FILENAMEβ if you use--addright after the--sgmloption, you only need a single argument: a FILENAME. this is how you add the name of a catalog file to an SGML supercatalog, which is a file that contains references to other included SGML catalog files. nesting dolls but make it catalogs. πͺ--convertβ convert SGML catalog to XML. glow up complete. β¨--createβ create a new XML catalog. it outputs to stdout and ignores the filename, unless--nooutis used, in which case it creates a new catalog file with that filename. choose your fighter. π--del VALUE(S)β remove entries from CATALOGFILE that matchVALUE(S). and just like--add, the--deloption will not overwrite CATALOGFILE β it outputs to stdout, unless--nooutis used. ok noted. π--nooutβ save output to the named file instead of outputting to stdout.--no-super-updateβ do not update the SGML super catalog. leave it alone, it's fine. π--shellβ run a shell that allows interactive queries on the catalog file CATALOGFILE. for the set of available commands, peek at the section called "SHELL COMMANDS" down below. π--sgmlβ uses SGML super catalogs for the--addand--deloptions.-v,--verboseβ output debugging information. spill the tea, tool. π΅
so here's the situation: invoking xmlcatalog non-interactively without a designated action (like one imposed with options such as --add) will result in a lookup of the catalog entry for ENTITIES in the catalog denoted with CATALOGFILE. the corresponding entries get output to the command line. and this mode of operation β together with --shell mode and non-modifying (i.e. without --noout) direct actions β allows for a special shortcut of the void CATALOGFILE specification (possibly expressed as "" in the shell environment), appointing the default system catalog. that simplifies handling when its exact location is irrelevant but the respective built-in still needs to be consulted. big brain shortcut moment, fr fr. π§ β¨
π SHELL COMMANDS π
invoking xmlcatalog with the --shell CATALOGFILE option opens a command line shell giving you interactive access to the catalog file identified by CATALOGFILE. invoking the shell gives you a command line prompt, and after that you can enter the following commands (described in alphabetical order, we stay consistent here):
add TYPE ORIG REPLACEβ add an entry to the catalog file.TYPEindicates the type of entry. possible types are:public,system,uri,rewriteSystem,rewriteURI,delegatePublic,delegateSystem,delegateURI,nextCatalog.ORIGis the original reference to be replaced, andREPLACEis the URI of the replacement entity to be used. the--addoption will not overwrite CATALOGFILE, outputting to stdout, unless--nooutis used. and--addwill always take three parameters, even if some of the XML catalog constructs only have a single argument. yes we said that twice, because it matters twice. πdebugβ print debugging statements showing the stepsxmlcatalogis executing. we love transparency.del VALUE(S)β remove the catalog entry corresponding toVALUE(S).dumpβ print the current catalog. show us everything, no secrets. πexitβ quit the shell. bye bestie π«Άpublic PUBLIC-IDβ execute a Formal Public Identifier lookup of the catalog entry for PUBLIC-ID. the corresponding entry will be output to the command line.quietβ stop printing debugging statements. shhh. π€«system SYSTEM-IDβ execute a Formal Public Identifier lookup of the catalog entry for SYSTEM-ID. the corresponding entry will be output to the command line.
π ENVIRONMENT π
XML_CATALOG_FILESβ XML catalog behavior can be changed by redirecting queries to the user's own set of catalogs. you do this by setting theXML_CATALOG_FILESenvironment variable to a space-separated list of catalogs. use percent-encoding to escape spaces or other characters. and listen: an empty variable should deactivate loading the default catalog from/etc/xml/catalogor, more specifically,${sysconfdir}/xml/catalog. so like, empty means off, got it? β¨
π DIAGNOSTICS π
the xmlcatalog return codes give you information you can use when calling it from scripts. very handy, very slay:
0β No error. we love a clean run. π1β Failed to remove an entry from the catalog.2β Failed to save to the catalog, check file permissions.3β Failed to add an entry to the catalog.4β Failed to look up an entry in the catalog.
π SEE ALSO π
more information can be found at:
libxml(3)web page β https://gitlab.gnome.org/GNOME/libxml2libxml(3)catalog support web page at https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support- James Clark's SGML catalog page β http://www.jclark.com/sp/catalog.htm
- OASIS XML catalog specification β http://www.oasis-open.org/committees/entity/spec.html
βοΈ AUTHOR βοΈ
John Fleck <jfleck@inkstain.net> β thank you for your service, king. π«‘
Β©οΈ COPYRIGHT Β©οΈ
Copyright Β© 2001, 2004
and that's the whole page, bestie!! go forth and catalog your little heart out. you're gonna eat this up, i just know it. π β¨
this has been XMLCATALOG(1) from the xmlcatalog Manual, brought to you by libxml2, dated 09/04/2026. mwah πππ¦
π¦ where this page comes from
- arch rolling: libxml2 2.15.4-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms