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 returned from fpInit() or fpInitWithLicenseData(). |
|
|
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
eStyleSheetTypeinKVXMLOptionsis set toXML_XSLorXML_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
pszStyleSheetNameincludes the output directory, thehrefonly consists of the file name since the XML output resides in the same directory as the style sheet file. -
If the value for
pszStyleSheetNamepoints to a directory other than the output directory, thehrefconsists of the full path and file name. -
Style sheet information cannot be written to an external
XSLfile. XML Export can only reference an existing XSL style sheet. -
When
XML_CSSis 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 callingKVXMLSetStyleSheetagain with thepszStyleSheetNameandpszRefset toNULL. The file name can then be set to a different value by callingKVXMLSetStyleSheetwith 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().