1HXSELECT(1)                     HTML-XML-utils                     HXSELECT(1)
2
3
4

NAME

6       hxselect - extract elements that match a (CSS) selector
7

SYNOPSIS

9       hxselect [ -i ] [ -c ] [ -l language ] [ -s separator ] selector
10

DESCRIPTION

12       hxselect  reads  a  well-formed  XML document and outputs elements that
13       match the CSS selector that is given as an argument. For example
14
15           hxselect ol li:first-child
16
17       selects the first li (list item in XHTML) in an ol (ordered list).
18
19       The command operates on the standard input.
20
21       Assumes that class selectors (".foo")  refer  to  an  attribute  called
22       "class".
23
24       Assumes that ID selectors ("#foo") refer to an attribute called "id".
25

OPTIONS

27       The following options are supported:
28
29       -i        Match  case-insensitively.  Useful  for  HTML  and some other
30                 SGML-based languages.
31
32       -c        Print content only. Without -c, the start and end tag of  the
33                 matched  element  are  printed as well; with -c only the con‐
34                 tents of the matched element are printed.
35
36       -l language
37                 Sets the default language, in case the root  element  doesn't
38                 have an xml:lang attribute (default: none). Example: -l en
39
40       -s separator
41                 A  string to print after each match (default: empty). Accepts
42                 C-like escapes. Example: -s '\n\n' to  print  an  empty  line
43                 after each match.
44
45       -?        Show command usage.
46

OPERANDS

48       The following operand is supported:
49
50       selector
51              A  selector. Most selectors from CSS level 3 are supported, with
52              the exception of pseudo-classes, pseudo-elements  and  selectors
53              with last- in their name.
54
55
56
575.x                               21 Nov 2008                      HXSELECT(1)
Impressum