Attributes for Generating HTML

These document-wide attributes provide control over the form of generated HTML—you use them only for writing HTML

Overview

NSExcludedElementsDocumentAttribute allows control over the tags used. The recognized values in the NSExcludedElementsDocumentAttribute array are (case-insensitive) HTML tags, plus DOCTYPE (representing a doctype declaration) and XML (representing an XML declaration). By default, if this attribute is not present, the excluded elements will be those deprecated in HTML 4 (APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U) plus XML. If XML is on the list, HTML forms are used; if XML is not on the list, XHTML forms are used where there is a distinction. Either NSCharacterEncodingDocumentAttribute or NSTextEncodingNameDocumentAttribute may be used to control the encoding used for generated HTML; character entities are used for characters not representable in the specified encoding. NSPrefixSpacesDocumentAttribute allows some control over formatting.

Topics

Constants

NSExcludedElementsDocumentAttribute

An NSArray object containing NSString objects, representing HTML elements not to be used in generated HTML.

NSTextEncodingNameDocumentAttribute

An NSString object containing the name, IANA or otherwise, of a text encoding to be used; mutually exclusive with NSCharacterEncodingDocumentAttribute.

NSPrefixSpacesDocumentAttribute

An NSNumber object containing an integer (default 0) representing the number of spaces per level by which to indent certain nested HTML elements.