|
Publishing Framework
INSERT_HTML
Inserts HTML files into a package.
Syntax
CALL INSERT_HTML(packageId, body, bodyUrl, frame,
frameUrl, contents, contentsUrl, page,
pageUrl, desc, nameValue, rc<,
properties, propValue1, ...propValueN>);
- packageId
- Numeric, input.
Identifies the package.
- body
- Character, input.
Names the HTML body file, using the following syntax:
- FILEREF: SAS_fileref
- FILENAME: external_filename
Refer to the Details section below for information about inserting
multiple body files.
- bodyURL
- Character, input.
Specifies the URL to be used for the body file.
- frame
- Character, input.
Names the HTML frame file, using the following syntax:
- FILEREF: SAS_fileref
- FILENAME: external_filename
- frameURL
- Character, input.
Specifies the URL to be used for the frame file.
- contents
- Character, input.
Names the HTML contents file, using the following syntax:
- FILEREF: SAS_fileref
- FILENAME: external_filename
- contentsURL
- Character, input.
Specifies the URL to be used for the contents file.
- page
- Character, input.
Names the HTML page file, using the following syntax:
- FILEREF: SAS_fileref
- FILENAME: external_filename
- pageURL
- Character, input.
Specifies the URL to be used for the page file.
- desc
- Character, input.
Character string describes the inserted HTML package entry.
- nameValue
- Character, input.
Identifies a list of one or more space-separated name/value pairs, each in the
form of name=value. Name/value pairs are site-specific; they are
used for the purpose of filtering.
- rc
- Numeric, output.
Receives a return code.
- properties
- Character, input.
Identifies a comma-separated list of optional property names. Valid property
names are as follows:
- ENCODING
- COMPANION_FILE
- COMPANION_MIMETYPE
- COMPANION_URL
- GPATH
- GPATH_URL
- NESTED_NAME
- propValue1, ...propValueN
- Character, input
Specifies one value for each specified property name. The order of the property
values must match the order of the property names in the properties
parameter. Valid property values are defined as follows:
- ENCODING
- Character string indicates the character set of the HTML files, such as
ISO-8859-1. Refer to
Publish/Retrieve Encoding Behavior
for details. The default encoding is assumed from the native session.
- COMPANION_FILE
- Character string indicates the name of an additional HTML file that is to
be added to this set of HTML files. Multiple COMPANION_FILE properties and
values may be specified. Name the companion files, using the following syntax:
- FILEREF: SAS_fileref
- FILENAME: external_filename
- COMPANION_MIMETYPE
- Character string indicates the MIME type of the companion file to be added to the inserted HTML entry. If specified, this property must be preceded by the COMPANION_FILE property.
- COMPANION_URL
- Character string indicates the URL of an HTML file that is to be added to
the inserted HTML entry. If specified, this property must be preceded by the
COMPANION_FILE property.
- GPATH
- Character string indicates the name of a single directory that contains the ODS-generated graphical files for inclusion as companion files to the HTML file set.
Note: All files in the specified directory will be included as companion files.
- GPATH_URL
-
Character string indicates the URL of the directory that contains the ODS-generated graphical files. An example of a URL might be ~ods-output/images.
Alternatively, you can specify "NONE" as the GPATH_URL property value. If the value of "NONE" is specified, only the file name is used as the URL.
Note: If GPATH_URL is specified, you must also specify the GPATH property.
- NESTED_NAME
- Character string indicates the name of the nested directory to create for the storage of the set of HTML files. If you do not specify a value for this property, a name is generated automatically.
Note: The NESTED_NAME property is valid only when publishing to the WebDAV-compliant server transport.
The files that may be inserted include the body, frame, contents, and page
files.
When the NEWFILE= option is specified in the ODS HTML statement, ODS may
generate multiple body files. When ODS generates multiple body files it uses a
numeric file naming sequence of the general form: bodyfilenameNumber, as in
body1.html, body2.html, body3.html. To insert an entire sequence of body files,
use the following syntax:
FILENAME: bodyFilename*.extension
When an asterisk is specified in the body parameter, an asterisk
should also be specified in the bodyUrl parameter. For further
information about ODS, refer to SAS Language: Reference and
SAS Language Reference: Concepts.
Note: As a best practice, it is suggested that a MIME type be provided for any companion files inserted into the HTML entry. The MIME type is useful for applications that will later consume or display the published package.
Examples
Example 1
The following example generates ODS files and inserts those files into a
package.
Desc='HTML output for payroll processing';
nameValue = '';
filename f '/users/f.html';
filename c '/users/c.html';
filename b '/users/b.html';
filename p '/users/p.html';
ods html frame=f contents=c(url='c.html')
body=b(url='b.html') page=p(url='p.html');
/* insert SAS statements here to generate ODS output */
ods html close;
CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
'fileref:f', "f.html", 'fileref:c', "c.html",
'fileref:p', "p.html", desc, nameValue, rc);
Example 2
The following example replaces the INSERT_HTML CALL routine in the example
above with another version of the CALL routine that inserts ODS files using the
ENCODING property. In this case the ENCODING property specifies the ISO-Latin-1
character set.
Desc='HTML output for payroll processing';
nameValue = '';
CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
'fileref:f', "f.html", 'fileref:c', "c.html",
'fileref:p', "p.html", desc, nameValue, rc,
"encoding", "ISO-8859-1");
Example 3
The following example specifies a character set encoding and adds two HTML
files to the original set of inserted files.
Desc='HTML output for payroll processing';
nameValue = '';
properties='encoding, companion_file, companion_file';
encodingV = "ISO-88591-1";
file1 = "filename: report.html";
file2 = "filename: dept.html";
CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
'fileref:f', "f.html", 'fileref:c', "c.html",
'fileref:p', "p.html", desc, nameValue, rc,
properties, encodingV, file1, file2);
Example 4
The following example uses an asterisk (*) to specify that all body files
are to be included in the set of inserted HTML files. The naming sequence used
is the same as the naming sequence used in ODS. So the files body.html,
body1.html, body2.html and so on (for all files found in this sequence), will
be published. See the SAS Language Reference: Concepts for further
information about the ODS naming sequence used in conjunction with the NEWLINE=
option.
Desc='HTML output for payroll processing';
nameValue = '';
CALL INSERT_HTML(packageId,
'filename:/users/jsmith/body*.html', "body*.html",
'fileref:f', "f.html", 'fileref:c', "c.html",
'fileref:p', "p.html", desc, nameValue, rc);
See Also
- Refer to
Publish/Retrieve Encoding Behavior for more
information about HTML publishing and the use of the ENCODING property.
- PACKAGE_BEGIN
- SAS Language Reference: Language
- SAS Language Reference: Concepts
- The Complete Guide to the SAS(R) Output Delivery System
|