Open SCAP Library
|
Public Member Functions | |
struct oscap_source * | oscap_source_new_from_xmlDoc (xmlDoc *doc, const char *filepath) |
Build new oscap_source from existing xmlDoc. More... | |
xmlTextReader * | oscap_source_get_xmlTextReader (struct oscap_source *source) |
Get an xmlTextReader assigned with this resource. More... | |
xmlDoc * | oscap_source_get_xmlDoc (struct oscap_source *source) |
Get a DOM representation of this resource. More... | |
xmlDoc * | oscap_source_pop_xmlDoc (struct oscap_source *source) |
Get a DOM representation of this resource. More... | |
OSCAP_API const char * | oscap_source_get_filepath (struct oscap_source *source) |
Get filepath of the given resource. More... | |
OSCAP_API oscap_document_type_t | oscap_source_get_scap_type (struct oscap_source *source) |
Get SCAP document type of the given resource. More... | |
OSCAP_API const char * | oscap_source_get_schema_version (struct oscap_source *source) |
Get the version of the schema for the particular document type. More... | |
OSCAP_API int | oscap_source_validate (struct oscap_source *source, xml_reporter reporter, void *user) |
Validate the SCAP document against particular XML schema definition. More... | |
OSCAP_API int | oscap_source_validate_schematron (struct oscap_source *source, const char *outfile) |
Validate the SCAP document against schematron assertions. More... | |
OSCAP_API const char * | oscap_source_readable_origin (const struct oscap_source *source) |
Returns human readable description of oscap_source origin. More... | |
OSCAP_API int | oscap_source_save_as (struct oscap_source *source, const char *filename) |
Store the resource represented by oscap_source to the file. More... | |
int | oscap_source_apply_xslt_path (struct oscap_source *source, const char *xsltfile, const char *outfile, const char **params, const char *path_to_xslt) |
Apply stylesheet on XML file (represented by oscap_source structure). More... | |
char * | oscap_source_apply_xslt_path_mem (struct oscap_source *source, const char *xsltfile, const char **params, const char *path_to_xslt) |
Apply stylesheet on XML file (represented by oscap_source structure). More... | |
Data Fields | |
oscap_document_type_t | scap_type |
Type of SCAP document (XCCDF, OVAL, ...) | |
struct { | |
oscap_source_type_t type | |
Internal type of the oscap_source. | |
char * version | |
Version of the particular document type. | |
char * filepath | |
Filepath (if originated from file) | |
char * memory | |
Memory buffer (if originated from memory) | |
size_t memory_size | |
Size of the memory buffer (if originated from memory) | |
} | origin |
struct { | |
xmlDoc * doc | |
} | xml |
int oscap_source_apply_xslt_path | ( | struct oscap_source * | source, |
const char * | xsltfile, | ||
const char * | outfile, | ||
const char ** | params, | ||
const char * | path_to_xslt | ||
) |
Apply stylesheet on XML file (represented by oscap_source structure).
If xsltfile is an absolute path to the stylesheet, path_to_xslt will not be used.
source | oscap_surce structure representing file to transform |
xsltfile | absolute path to the stylesheet document or relative given the path_to_xslt |
outfile | output filename |
params | external params for xsl transformation |
path_to_xslt | optional path to xsl transformations |
char * oscap_source_apply_xslt_path_mem | ( | struct oscap_source * | source, |
const char * | xsltfile, | ||
const char ** | params, | ||
const char * | path_to_xslt | ||
) |
Apply stylesheet on XML file (represented by oscap_source structure).
If xsltfile is an absolute path to the stylesheet, path_to_xslt will not be used.
source | oscap_surce structure representing file to transform |
xsltfile | absolute path to the stylesheet document or relative given the path_to_xslt |
params | external params for xsl transformation |
path_to_xslt | optional path to xsl transformations |
OSCAP_API const char * oscap_source_get_filepath | ( | struct oscap_source * | source | ) |
Get filepath of the given resource.
source |
OSCAP_API oscap_document_type_t oscap_source_get_scap_type | ( | struct oscap_source * | source | ) |
Get SCAP document type of the given resource.
source |
OSCAP_API const char * oscap_source_get_schema_version | ( | struct oscap_source * | source | ) |
Get the version of the schema for the particular document type.
source | The oscap_source to get the schema version from. |
xmlDoc * oscap_source_get_xmlDoc | ( | struct oscap_source * | source | ) |
Get a DOM representation of this resource.
The document ins still owned by oscap_source.
source | Resource to build DOM representation from |
xmlTextReader * oscap_source_get_xmlTextReader | ( | struct oscap_source * | source | ) |
Get an xmlTextReader assigned with this resource.
The reader needs to be disposed by caller.
source | Resource to read the content |
struct oscap_source * oscap_source_new_from_xmlDoc | ( | xmlDoc * | doc, |
const char * | filepath | ||
) |
Build new oscap_source from existing xmlDoc.
The xmlDoc becomes owned by oscap_source.
doc | XML DOM to build from |
filepath | Suggested filename for the file or NULL |
xmlDoc * oscap_source_pop_xmlDoc | ( | struct oscap_source * | source | ) |
Get a DOM representation of this resource.
The document is removed from oscap_source and isn't owned by oscap_source anymore.
source | Resource to build DOM representation from |
OSCAP_API const char * oscap_source_readable_origin | ( | const struct oscap_source * | source | ) |
Returns human readable description of oscap_source origin.
source | The oscap_source to get readable source from. |
OSCAP_API int oscap_source_save_as | ( | struct oscap_source * | source, |
const char * | filename | ||
) |
Store the resource represented by oscap_source to the file.
source | The oscap_source to save |
filename | The filename or NULL, the previously supplied name will be used if filename is NULL. |
OSCAP_API int oscap_source_validate | ( | struct oscap_source * | source, |
xml_reporter | reporter, | ||
void * | user | ||
) |
Validate the SCAP document against particular XML schema definition.
source | The oscap_source to validate |
OSCAP_API int oscap_source_validate_schematron | ( | struct oscap_source * | source, |
const char * | outfile | ||
) |
Validate the SCAP document against schematron assertions.
source | The oscap_source to validate |
outfile | path to out file containing errors, NULL for stdout |