XML schema based validation of XML representations of SCAP documents.
More...
|
typedef enum oscap_document_type | oscap_document_type_t |
| SCAP document type identifiers.
|
|
typedef int(* | xml_reporter) (const char *file, int line, const char *msg, void *arg) |
|
|
enum | oscap_document_type {
OSCAP_DOCUMENT_UNKNOWN = 0
, OSCAP_DOCUMENT_OVAL_DEFINITIONS
, OSCAP_DOCUMENT_OVAL_VARIABLES
, OSCAP_DOCUMENT_OVAL_SYSCHAR
,
OSCAP_DOCUMENT_OVAL_RESULTS
, OSCAP_DOCUMENT_OVAL_DIRECTIVES
, OSCAP_DOCUMENT_XCCDF
, OSCAP_DOCUMENT_CPE_LANGUAGE
,
OSCAP_DOCUMENT_CPE_DICTIONARY
, OSCAP_DOCUMENT_CVE_FEED
, OSCAP_DOCUMENT_SCE_RESULT
, OSCAP_DOCUMENT_SDS
,
OSCAP_DOCUMENT_ARF
, OSCAP_DOCUMENT_XCCDF_TAILORING
, OSCAP_DOCUMENT_OCIL
, OSCAP_DOCUMENT_CVRF_FEED
} |
| SCAP document type identifiers. More...
|
|
|
OSCAP_API const char * | oscap_document_type_to_string (oscap_document_type_t type) |
| Convert oscap_document_type_t constant to human readable (english) representation. More...
|
|
OSCAP_API int | oscap_apply_xslt (const char *xmlfile, const char *xsltfile, const char *outfile, const char **params) |
| Apply a XSLT stylesheet to a XML file. More...
|
|
OSCAP_API const char * | oscap_path_to_schemas (void) |
| Function returns path used to locate OpenSCAP XML schemas.
|
|
OSCAP_API const char * | oscap_path_to_cpe (void) |
| Function returns path used to locate OpenSCAP Default CPE files.
|
|
XML schema based validation of XML representations of SCAP documents.
◆ oscap_document_type
SCAP document type identifiers.
Enumerator |
---|
OSCAP_DOCUMENT_UNKNOWN | The type is unknown.
|
OSCAP_DOCUMENT_OVAL_DEFINITIONS | OVAL Definitions file.
|
OSCAP_DOCUMENT_OVAL_VARIABLES | OVAL Variables.
|
OSCAP_DOCUMENT_OVAL_SYSCHAR | OVAL system characteristics file.
|
OSCAP_DOCUMENT_OVAL_RESULTS | OVAL results file.
|
OSCAP_DOCUMENT_OVAL_DIRECTIVES | OVAL directives file.
|
OSCAP_DOCUMENT_XCCDF | XCCDF benchmark file.
|
OSCAP_DOCUMENT_CPE_LANGUAGE | CPE language file.
|
OSCAP_DOCUMENT_CPE_DICTIONARY | CPE dictionary file.
|
OSCAP_DOCUMENT_CVE_FEED | CVE NVD feed.
|
OSCAP_DOCUMENT_SCE_RESULT | SCE result file.
|
OSCAP_DOCUMENT_SDS | Source Data Stream file.
|
OSCAP_DOCUMENT_ARF | Result Data Stream file.
|
OSCAP_DOCUMENT_XCCDF_TAILORING | XCCDF tailoring file.
|
OSCAP_DOCUMENT_OCIL | OCIL Definitions file.
|
OSCAP_DOCUMENT_CVRF_FEED | CVRF feed.
|
◆ oscap_apply_xslt()
OSCAP_API int oscap_apply_xslt |
( |
const char * |
xmlfile, |
|
|
const char * |
xsltfile, |
|
|
const char * |
outfile, |
|
|
const char ** |
params |
|
) |
| |
Apply a XSLT stylesheet to a XML file.
If xsltfile is not an absolute path, the file will be searched relatively to a path specified by the OSCAP_XSLT_PATH environment variable. If the variable does not exist a default path is used (usually something like $PREFIX/share/openscap/schemas).
- Parameters
-
xmlfile | File to be transformed. |
xsltfile | XSLT file |
outfile | Result file shall be written here (NULL for stdout). |
params | list of key-value pairs to pass to the stylesheet. |
- Returns
- the number of bytes written or -1 in case of failure
◆ oscap_document_type_to_string()
Convert oscap_document_type_t constant to human readable (english) representation.
- Parameters
-
type | OpenSCAP Document Type |
- Returns
- English string describing document type.
- Return values
-
Returned | value might be pointer to static memory and must not be modified. |
NULL | in case of unrecognized document type |