File: hxremove.1

package info (click to toggle)
html-xml-utils 7.7-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 2,488 kB
  • sloc: ansic: 11,213; sh: 7,996; lex: 243; makefile: 193; yacc: 125
file content (74 lines) | stat: -rw-r--r-- 1,767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.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)"