RXP(1)

πŸ“¦
version 1.5.2 Β· 2 versions
, in nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– RXP(1) πŸ’–

bestie, welcome to the General Commands Manual page for rxp β€” the XML parser program that's literally about to make your terminal sparkle ✨

🌸 NAME 🌸

rxp β€” the XML parser program, no cap πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

rxp [ -abemnNRsStvVx4 ] [ -o b|p|0|1|2|3|i|d ] [ U 0|1|2 ] [ -c encoding
] [ url ]

✨ DESCRIPTION ✨

okay so here's the tea: rxp reads and parses XML from the url (or from standard input if you didn't give it one, nbd) and writes it to standard output. it can optionally expand entities, default attributes, and translate to a different output encoding β€” it's giving multitasking icon πŸ’…

rxp accepts XML 1.0 and 1.1, and the corresponding versions of XML namespaces. it also implements the Oasis XML catalog specification, so you know it's legit 🫢

common option combos that slay: -Nxs to check a document for well-formedness and namespace well-formedness, and -VNxs to also check for DTD-validity. periodt πŸ’–

πŸ”₯ OPTIONS πŸ”₯

  • -a β€” insert declared default values for omitted attributes. so if you forgot to put something in, rxp will fill it in for you πŸ’–
  • -v β€” be verbose. it's giving "tell me everything" energy ✨
  • -V β€” validate the document. and bestie, if you repeat this option, the program treats validity errors as well-formedness errors and exits after the first validity error. otherwise it just prints a warning for each one. so like, one warning vs. immediate exit β€” choose your fighter πŸ’€
  • -d β€” read the whole DTD (internal and external parts) regardless of any standalone declaration. otherwise a declaration "standalone='yes'" will prevent the external part from being read (unless validation is selected). so this flag is like "I don't care about your standalone declaration, read it all" πŸ™ˆ
  • -N β€” enable XML namespace support. the document will be checked for correct namespace syntax, and if -b is specified, qualified element and attribute names will be displayed with their URIs. namespace vibes only 🌈
  • -R β€” the value of this flag is a time limit in seconds, after which the program will abort.
this is to protect against denial-of-service attacks using malicious documents. so like, set a timer bestie, because we're not about to get hacked πŸ’€πŸ”₯
  • -S β€” keep track of xml:space attributes. this will only affect output when -b is specified. space matters, okay? πŸŽ€
  • -e β€” obsolete, do not use.
seriously, don't. it's giving "why is this still here" energy πŸ™ˆ
  • -E β€” do not expand entity references (opposite of old -e flag). so like, leave those entities alone, periodt πŸ’…
  • -s β€” be silent (that is, suppress output). useful for benchmarking or if you just want to see the error messages. so it's like mute mode but for your terminal 🫢
  • -b β€” print output as "bits". it's giving binary realness πŸ’»
  • -n β€” treat the input as normalised SGML rather than XML. not intended for general use. so like, niche vibes only 🧚
  • -o β€” if this flag is p, output is in the default (plain) format. if it's b, output is printed as "bits" (equivalent to -b). if it's 0, output is suppressed (equivalent to -s). if it's 1, 2 or 3, output is in first, second or third canonical form. if it's i, output is a dump of the document's infoset. if it's d, output is in a form suitable for use with "diff"; in particular attributes are sorted into alphabetical order. so many options, so little time 😭
  • -m β€” merge PCData across entity references. this will only affect the output when -b is specified. merging like a boss πŸ’…
  • -t β€” read in the input as a tree, rather than bits. should make no difference to the output. so like, it's a vibe, but it's a neutral vibe 🌸
  • -u base_uri β€” use the specified base URI when resolving system identifiers. URIs are important, bestie πŸ’–
  • -U β€” this flag controls Unicode normalization checking and is only relevant when parsing XML 1.1 documents. if it is 0, no checking is done. if it is 1, rxp checks that the document is fully normalized as defined by the W3C character model. if it is 2, the document is checked and any unknown characters (which may be ones corresponding to a newer version of Unicode than rxp knows about) will also cause an error. unicode is a whole mood 🌈
  • -x β€” strict XML mode. this suppresses some warnings (eg entity redefinitions) but treats all XML well-formedness errors as fatal. this flag implies the -a flag, and sets the output encoding to UTF-8 unless the -c flag is given. it sets the output format to first canonical form unless the -o, -b or -s flag is given. so strict, so iconic πŸ‘‘
  • -c encoding β€” produce output in the specified character encoding. known encodings include ISO-8859-1, UTF-8, ISO-10646-UCS and UTF-16. 16-bit encoding names may be suffixed with -B or -L to specify big- or little-endian byte order (the default is the host byte order). if no -c or -x option is given, output is in the same encoding as the input document. encoding queen πŸ’…
  • -D name sysid β€” force use of the document type specified by sysid. the root element name for validation is name. any DTD in the document is ignored. this flag does not imply validation; use -V if required. so like, force it but don't validate it unless you say so πŸ’€
  • -i β€” do xml:id processing. attributes named xml:id are recognised as IDs even if not declared. ID vibes only πŸ†”
  • -I β€” the same as -i, but in addition xml:id attributes are checked for uniqueness. so like, -i but extra πŸ’…
  • -z β€” use a shorter format for error messages. particularly useful when using the parser in Emacs compilation mode, so that Emacs can find the error location. short and sweet, just like me 😌
  • -4 β€” use pre-fifth-edition rules for XML 1.0. XML 1.0 fifth edition extends the set of allowed name characters to match XML 1.1, and allows unrecognised version numbers of the form 1.x to be treated as 1.0. the -4 flag disables these changes. so like, throwback rules only πŸ•°οΈ

πŸ’€ EXIT STATUS πŸ’€

if the -V flag is given, and the document is well-formed but not valid, 2 is returned. if the document is not well-formed, or a system error occurs, 1 is returned. otherwise 0 is returned.

since the parser can expand external entities even when not validating, it treats certain errors which are technically validity errors as well-formedness errors. if -x is not specified, some well-formedness errors produce only warnings and do not affect the exit status. so like, warnings are just warnings until they're not πŸ’…

🌿 ENVIRONMENT 🌿

if the environment variable XML_CATALOG_FILES is set, XML catalog processing is enabled. a catalog can be used to map system and public identifiers to local files. in particular, this allows copies of common DTDs to be kept locally, so that rxp does not have to fetch them over the internet. XML_CATALOG_FILES should be set to a space-separated list of catalog files.

the variable XML_CATALOG_PREFER may be set to public or system to set the initial mode for catalog processing; the default is system.

if the variable RXPURL is set, it is used as the URL of the document to parse. this may be useful in CGI scripts and the like to avoid shell parsing of a user-supplied argument.

the variable http_proxy can be used to specify a proxy for HTTP connections. the syntax is hostname[:port]. proxy vibes only 🌐


and that's the tea, bestie! this page is brought to you by RXP release 1.5.2 β€” go forth and parse some XML like the icon you are πŸ’–βœ¨πŸŽ€