File: hxname2id.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 (62 lines) | stat: -rw-r--r-- 1,651 bytes parent folder | download | duplicates (3)
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
.TH "HXNAME2ID" "1" "10 Jul 2011" "7.x" "HTML-XML-utils"
.SH NAME
hxname2id \- move some NAME and ID attributes from an A to its parent
.SH SYNOPSIS
.B hxname2id
.RB "[\| " \-x " \|]"
.RI "[\| " file " \|]"
.SH DESCRIPTION
.LP
The
.B hxname2id
command reads an HTML file and looks for elements with an A element
as first child, with no intervening text other than whitespace. If
that A element has an ID or NAME attribute, it is moved to the parent
element and removed from the A.
.LP
Because Netscape 4 doesn't understand ID attributes, it was common
practice to write <H2><A NAME="sect7">...</A></H2> instead of <H2
ID="sect7">. This program can be used to convert such old HTML files
to the new convention.
.LP
Other programs in this suite, such as
.BR hxmultitoc (1),
require IDs on headings instead of A elements with NAME attributes. So
it is useful to run
.B hxname2id
prior to running
.B hxmultitoc
and similar program.
.B hxname2id
can be used in a pipe.
.SH OPTIONS
The following options are supported:
.TP 10
.B \-x
Use XML conventions: empty elements are written with a slash at the
end: <IMG\ />
.SH OPERANDS
The following operand is supported:
.TP 10
.I file
The name of an HTML file. If absent, standard input is read instead.
.SH "DIAGNOSTICS"
The following exit values are returned:
.TP 10
.B 0
Successful completion.
.TP
.B > 0
An error occurred in the parsing of the HTML file.
.B hxname2id
will try to correct the error and produce output anyway.
.SH "SEE ALSO"
.BR asc2xml (1),
.BR hxmultitoc (1),
.BR hxnormalize (1),
.BR hxnum (1),
.BR hxtoc (1),
.BR xml2asc (1)
.SH BUGS
.LP
The error recovery for incorrect HTML is primitive.