.de d \" begin display .sp .in +4 .nf .. .de e \" end display .in -4 .fi .sp .. .TH man 1 "27 May 2004" .SH NAME addid \- add ID's to selected elements .SH SYNOPSIS .B addid .RB "[\| " \-x " \|]" .RB "[\-\-]" .IR elem|.class|elem.class .RB "[\| " html-file " \|]" .SH DESCRIPTION .LP The .B addid command opies an HTML or XML file to standard output, while adding element IDs to the specified elements or classes. .LP For example, given the input .d

A paragraph without an ID

.e the command .d addid p .e will output .d

A paragraph without an ID

.e .LP If you specify a class using \fB.class\fP then IDs will only be added to elements that contain that class. And if you specify a element and a class using \fBelem.class\fP then IDs will only be added to the specified elements that contain the specified class. .LP If two elements would naturally generate the same ID, a number is added to the ID name (starting with 0) to make sure the IDs are unique. IDs are not added to matching elements that already contain an ID. .SH OPTIONS The following options are supported: .TP 10 .B \-x Use XML conventions: empty elements are written with a slash at the end: Also causes the name of the attribute (see option \fB\-a\fP) to become case-sensitive. .SH OPERANDS The following operand is supported: .TP 10 .I elem The name of element to select. .TP 10 .I .class The name of class to select. .TP 10 .I elem.class The name of element that contains class to select. .TP 10 .I html-file The name of an HTML file. .SH "EXIT STATUS" The following exit values are returned: .TP 10 .B 0 Successful completion. .TP .B >0 An error occurred in the parsing of one of the HTML or XML files. .SH "SEE ALSO" .BR xml2asc (1), .BR UTF-8 (RFC 2279), .BR normalize-html (1), .BR num (1), .BR toc (1), .BR htmlprune (1). .BR unent (1) .BR asc2xml (1) .SH BUGS .LP Assumes UTF-8 as input. Doesn't expand character entities. Instead pipe the input through .BR unent (1) and .BR asc2xml (1) to convert it to UTF-8.