1HXNAME2ID(1) HTML-XML-utils HXNAME2ID(1)
2
3
4
6 hxname2id - move some NAME and ID attributes from an A to its parent
7
9 hxname2id [ -x ] [ file ]
10
12 The hxname2id command reads an HTML file and looks for elements with an
13 A element as first child, with no intervening text other than white‐
14 space. If that A element has an ID or NAME attribute, it is moved to
15 the parent element and removed from the A.
16
17 Because Netscape 4 doesn't understand ID attributes, it was common
18 practice to write <H2><A NAME="sect7">...</A></H2> instead of <H2
19 ID="sect7">. This program can be used to convert such old HTML files to
20 the new convention.
21
22 Other programs in this suite, such as hxmultitoc(1), require IDs on
23 headings instead of A elements with NAME attributes. So it is useful to
24 run hxname2id prior to running hxmultitoc and similar program.
25 hxname2id can be used in a pipe.
26
28 The following options are supported:
29
30 -x Use XML conventions: empty elements are written with a slash
31 at the end: <IMG />
32
34 The following operand is supported:
35
36 file The name of an HTML file. If absent, standard input is read
37 instead.
38
40 The following exit values are returned:
41
42 0 Successful completion.
43
44 > 0 An error occurred in the parsing of the HTML file. hxname2id
45 will try to correct the error and produce output anyway.
46
48 asc2xml(1), hxmultitoc(1), hxnormalize(1), hxnum(1), hxtoc(1),
49 xml2asc(1)
50
52 The error recovery for incorrect HTML is primitive.
53
54
55
565.x 21 Nov 2008 HXNAME2ID(1)