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. TYPE tells you what kind of entry it is. the possible types are: public, system, uri, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, delegateURI, nextCatalog. ORIG is the original reference that's getting replaced, and REPLACE is the URI of the replacement entity you're swapping in. heads up bestie: the --add option will not overwrite CATALOGFILE, it outputs to stdout, unless --noout is used. and --add will 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 --add right after the --sgml option, 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 --noout is used, in which case it creates a new catalog file with that filename. choose your fighter. 🌈
  • --del VALUE(S) β€” remove entries from CATALOGFILE that match VALUE(S). and just like --add, the --del option will not overwrite CATALOGFILE β€” it outputs to stdout, unless --noout is 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 --add and --del options.
  • -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. TYPE indicates the type of entry. possible types are: public, system, uri, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, delegateURI, nextCatalog. ORIG is the original reference to be replaced, and REPLACE is the URI of the replacement entity to be used. the --add option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. and --add will 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 steps xmlcatalog is executing. we love transparency.
  • del VALUE(S) β€” remove the catalog entry corresponding to VALUE(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 the XML_CATALOG_FILES environment 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/catalog or, 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:

  1. 0 β€” No error. we love a clean run. πŸ’–
  2. 1 β€” Failed to remove an entry from the catalog.
  3. 2 β€” Failed to save to the catalog, check file permissions.
  4. 3 β€” Failed to add an entry to the catalog.
  5. 4 β€” Failed to look up an entry in the catalog.

πŸ‘€ SEE ALSO πŸ‘€

more information can be found at:


✍️ AUTHOR ✍️

John Fleck <jfleck@inkstain.net> β€” thank you for your service, king. 🫑


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