.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 selector .SH DESCRIPTION .B hxremove reads a well-formed XML document from standard input and writes it to standard output without any elements that match the CSS selector that is given as argument. For example .d .B hxremove ol li:first-child .e removes the first li (list item in XHTML) from every ol (ordered list). .PP 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 .TP .B \-? Show command usage. .SH OPERANDS The following operand is supported: .TP .I selector A selector. Most selectors from CSS level 3 are supported, with the exception of pseudo-classes, pseudo-elements and selectors with \fBlast\-\fR in their name. .SH "SEE ALSO" .BR asc2xml (1), .BR xml2asc (1), .BR hxnormalize (1), .BR hxselect (1), .BR UTF-8 " (RFC 2279)"