KVXMLSetStyleSheet()
This function is called directly and is used to specify the full path and file name of an external Style Sheet (XSL or CSS).
Syntax
BOOL pascal KVXMLSetStyleSheet( void *pContext, char *pszStyleSheetName, char *pszRef);
Arguments
|
A pointer to a KeyView Export session that you initialized by calling fpInit(). |
|
A pointer to the full path and file name of the style sheet. |
|
A pointer to the URL or file name of style sheet. |
Returns
-
If the call is successful, the return value is
TRUE
. -
If this call is unsuccessful, the return value is
FALSE
.
Discussion
-
When the value for
eStyleSheetType
inKVXMLOptions
is set toXML_XSL
orXML_CSS
, an external style sheet is referenced by a processing instruction of the form:<?xml-stylesheet href="pszRef" type="text/xsl"?>
or
<?xml-stylesheet href="pszRef" type="text/css"?>
-
If the value for
pszStyleSheetName
includes the output directory, thehref
only consists of the file name since the XML output resides in the same directory as the style sheet file. -
If the value for
pszStyleSheetName
points to a directory other than the output directory, thehref
consists of the full path and file name. -
Style sheet information cannot be written to an external
XSL
file. XML Export can only reference an existing XSL style sheet. -
When
XML_CSS
is specified, a CSS file can be created based onpszStyleSheetName
. -
If the name of the CSS is not specified by using this function, a CSS style file is created with an automatically-generated file name.
-
If this function is used to specify the name of the style file, that file is referenced in the processing instruction.
-
If the CSS file does not exist in the specified location, it is created.
-
If it exists, but is empty, CSS styles are written to it.
-
If the CSS file exists and is not empty, the file is not altered. There is no attempt made to validate the file.
-
-
If there are multiple calls made to
fpConvertStream()
orKVXMLConvertFile()
, and the name of the style sheet has been set withKVXMLSetStyleSheet
, the file name can be disabled by callingKVXMLSetStyleSheet
again with thepszStyleSheetName
andpszRef
set toNULL
. The file name can then be set to a different value by callingKVXMLSetStyleSheet
with the new file name prior to the next call tofpConvertStream()
orKVXMLConvertFile()
. -
This function runs in-process or out of process. See Convert Files Out of Process.
-
When converting out of process, this function must be called after the call to
KVXMLStartOOPSession()
and before the call toKVXMLEndOOPSession()
. See KVXMLStartOOPSession() and KVXMLEndOOPSession(). -
On Windows,
pszStyleSheetName
must be in the local Windows code page.