htmldoc
htmldoc(doc[, source_loc[, css_mode[, encodingstring]]])
This function creates, in memory, a virtual HTML document conforming to the html DTD. The generated document is based on the current FOSI. It uses the print FOSI, if set. If a print FOSI is not set, it uses the Editor FOSI.
Upon successful completion, it returns the document ID for the virtual HTML document. If an error occurs, it returns a -1.
The document identifier doc specifies the source document.
Set source_loc to 1 (true) to add the srctreeloc attribute to the elements in the virtual HTML document. The srctreeloc attribute value is a tree location string indicating the element's location in the source document. The default is 0.
Specify css_mode to set the level of Cascading Stylesheet (CSS) information you want to incorporate in the HTML document. Following are the valid parameters and what they generate:
• 0 — No CSS mode. Generates HTML without any CSS style or class information. This is the default.
• 1 — CSS style. Generates HTML with CSS properties specified within the style attribute of various HTML elements, but no classes are defined or used.
• 2 — CSS classes. Generates HTML with CSS properties specified by classes only. These classes are defined within the content of the HTML <style> element, and are referred to within the class attribute of various HTML elements.
|
This parameter may not convey as much style information as with CSS modes 1 and 3.
|
• 3 — CSS style and classes. Generates HTML with CSS properties specified by classes that are defined within the HTML <style> element, and augmented by CSS properties specified within the styleattribute of various HTML elements.
Set encoding to a string that specifies the encoding for the HTML document. The following encodings are supported:
• ISO-8859-1
• ISO-8859-2
• ISO-8859-5
• ISO-8859-7
• ISO-8859-9
• Windows-1252
• UTF-8
|
The encoding you specify should match the encoding parameter specified for the write command.
|
To display the HTML document, create a new window and perform a doc_show using the document ID that was returned.
|
If the HTML document incorporates CSS information, you must use a browser that supports HTML version 3.2 and above to view it.
|
Related Topics