HXREMOVE(1)
π HXREMOVE(1) π
okay bestie, welcome to the HTML-XML-utils corner of the group chat β this one's hxremove from the HTML-XML-utils fam, and she is so useful. let's get into it πΈ
β¨ NAME β¨
hxremove β remove elements from an XML file by means of a CSS selector π
π¦ SYNOPSIS π¦
hxremove [ -i ] [ -l language ] selectors
π DESCRIPTION π
okay so. hxremove reads a well-formed XML document from standard input and writes it to standard output without any elements that match one of the CSS selectors that are given as argument. no cap, that's the whole vibe. for example:
hxremove ol li:first-child
this removes the first li (list item in XHTML) from every ol (ordered list). iconic behavior honestly. β¨
if there are multiple selectors, they must be separated by commas. like, mandatory bestie. for example:
hxremove p + ul, blockquote ol
this removes all ul elements that follow a p element and also all ol elements that are descendants of a blockquote element. two for one, we love to see it π«Ά
hxremove assumes that class selectors (".foo") refer to an attribute called "class". and assumes that ID selectors ("#foo") refer to an attribute called "id". that's just the deal, iykyk π
to handle HTML files, make them well-formed XML first, e.g., with hxnormalize -x. it's giving "prep your data first, queen" π§
compare with hxselect, which removes everything but the selected elements. literally the opposite energy. π
β OPTIONS β
the following options are supported:
-iβ match case-insensitively. useful for HTML and some other SGML-based languages. (case who? don't know her π )-l languageβ sets the default language, in case the root element doesn't have anxml:langattribute (default:none). example:-l enπ
π OPERANDS π
the following operand is supported:
selectorsβ one or more comma-separated selectors. most selectors from CSS level 3 are supported. so like, go off. π
π₯ SEE ALSO π₯
asc2xml(1), xml2asc(1), hxnormalize(1), hxselect(1), UTF-8 (RFC 2279)
and that's the tea β version 7.x, dated 10 Jul 2011 β go forth and delete some elements, bestie, you're the main character of this pipeline πΈπ
β¨
π¦ where this page comes from
- alpine 3.24: html-xml-utils-doc 8.7-r0 Β· W3C
- arch rolling: html-xml-utils 8.8-1 Β· W3C
- debian bookworm: html-xml-utils 7.7-1.1 Β· W3C
- debian trixie: html-xml-utils 7.7-1.1+b1 Β· W3C
- fedora 43: html-xml-utils 8.6-2.fc41 Β· W3C AND BSD-3-Clause
- fedora 44: html-xml-utils 8.7-1.fc44 Β· W3C AND BSD-3-Clause
- nixos 26.05: html-xml-utils 8.7
- nixpkgs unstable: html-xml-utils 8.7
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- ubuntu jammy: html-xml-utils 7.7-1.1 Β· W3C
- ubuntu noble: html-xml-utils 7.7-1.1build2 Β· W3C
- ubuntu questing: html-xml-utils 7.7-1.1build2
- ubuntu resolute: html-xml-utils 7.7-1.3 Β· W3C
- ubuntu stonking: html-xml-utils 7.7-1.3 Β· W3C
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms