1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/*
* Copyright (C) 2009 Red Hat Inc.
*
* David Sommerseth <davids@redhat.com>
*
*
* This application is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
/**
* @file xmlparser.h
* @author David Sommerseth <davids@redhat.com>
* @date Wed Oct 7 17:27:39 2009
*
* @brief Parses summary.xml reports from rteval into a standardised XML format
* which is useful when putting data into a database.
*
*/
#ifndef _XMLPARSER_H
#define _XMLPARSER_H
/**
* Parameters needed by the the xmlparser.xsl XSLT template.
*/
typedef struct {
const char *table; /**< Which table to parse data for. Required*/
unsigned int submid; /**< Submission ID, needed by the 'rtevalruns' table */
unsigned int syskey; /**< System key (referencing systems.syskey) */
const char *report_filename; /**< Filename to the saved report (after being parsed) */
unsigned int rterid; /**< References rtevalruns.rterid */
} parseParams;
xmlDoc *parseToSQLdata(LogContext *log, xsltStylesheet *xslt, xmlDoc *indata_d, parseParams *params);
char *sqldataExtractContent(LogContext *log, xmlNode *sql_n);
int sqldataGetFid(LogContext *log, xmlNode *sqld, const char *fname);
char *sqldataGetValue(LogContext *log, xmlDoc *sqld, const char *fname, int recid);
xmlDoc *sqldataGetHostInfo(LogContext *log, xsltStylesheet *xslt, xmlDoc *summaryxml,
int syskey, char **hostname, char **ipaddr);
int sqldataGetRequiredSchemaVer(LogContext *log, xmlNode *sqldata_root);
#endif
|