.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

...

instead of

. 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: .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.