.de d \" begin display .sp .in +4 .nf .. .de e \" end display .in -4 .fi .sp .. .TH "HXREMOVE" "1" "10 Jul 2011" "7.x" "HTML-XML-utils" .SH NAME hxremove \- remove elements from an XML file by means of a CSS selector .SH SYNOPSIS .B hxremove .RB "[\| " \-i " \|]" .RB "[\| " \-l .IR language " \|]" .I selectors .SH DESCRIPTION .B 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. For example .d hxremove ol li:first-child .e removes the first li (list item in XHTML) from every ol (ordered list). .PP If there are multiple selectors, they must be separated by commas. For example, .d hxremove p + ul, blockquote ol .e removes all ul elements that follow a p element and also all ol elements that are descendants of a blockquote element. .PP .B hxremove assumes that class selectors (".foo") refer to an attribute called "class". And assumes that ID selectors ("#foo") refer to an attribute called "id". .PP To handle HTML files, make them well-formed XML first, e.g., with .BR "hxnormalize -x" . .PP Compare with .BR hxselect , which removes everything .I but the selected elements. .SH OPTIONS The following options are supported: .TP 10 .B \-i Match case-insensitively. Useful for HTML and some other SGML-based languages. .TP .BI \-l " language" Sets the default language, in case the root element doesn't have an xml:lang attribute (default: none). Example: .B \-l en .SH OPERANDS The following operand is supported: .TP .I selectors One or more comma-separated selectors. Most selectors from CSS level 3 are supported. .SH "SEE ALSO" .BR asc2xml (1), .BR xml2asc (1), .BR hxnormalize (1), .BR hxselect (1), .BR UTF-8 " (RFC 2279)"