From c8be0285bb5cb43f3000c67ef279d98385182f8d Mon Sep 17 00:00:00 2001 From: Sebastien Godard Date: Wed, 31 Aug 2011 15:11:25 +0200 Subject: [PATCH] Fixed bugs in sadf XML output and in DTD/XSD documents. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On 08/29/2011 02:27 PM, "Jürgen Heinemann (Undefined)" wrote: > Hallo Sebastian, > I have found some bugs with sadf -x command. > You can see my changes in sysstat-10.0.2.rc1.diff attachment. > The Doctype Declaration in sadf_misc.c isn't set to "sysstat" rootNode > and timetamp Element closed with child Elements > See my Example xslt > > sadf -P 0,1 -x > input.xml > xsltproc --encoding utf-8 --novalid sysstat.xslt input.xml > > greets Jürgen /** * @file sysstat-10.0.2.rc1.diff * @author Juergen Heinemann (Undefined) http://www.hjcms.de * @since Mon Aug 29 14:11:17 CEST 2011 * @short diff options:-Nau6 */ --- ./xml/sysstat.xsd.orig 2011-08-29 13:42:49.124597092 +0200 +++ ./xml/sysstat.xsd 2011-08-29 13:43:54.065167625 +0200 @@ -40,13 +40,13 @@ - + @@ -284,17 +284,16 @@ - - - - - + + + + --- ./xml/sysstat.dtd.orig 2011-08-29 14:00:46.827833320 +0200 +++ ./xml/sysstat.dtd 2011-08-29 14:10:59.347827319 +0200 @@ -2,13 +2,16 @@ - + + + + @@ -19,13 +22,13 @@ - + --- ./sadf_misc.c.orig 2011-08-29 13:54:54.673109443 +0200 +++ ./sadf_misc.c 2011-08-29 14:02:55.640212688 +0200 @@ -285,13 +285,13 @@ *************************************************************************** */ __printf_funct_t print_xml_timestamp(int *tab, int action, char *cur_date, char *cur_time, int utc, unsigned long long itv) { if (action & F_BEGIN) { - xprintf(*tab, "", + xprintf(*tab, "", cur_date, cur_time, utc ? 1 : 0, itv); } if (action & F_END) { xprintf(--(*tab), ""); } } sysstat.xslt: ============ --- CHANGES | 4 ++++ CREDITS | 1 + sadf.h | 2 +- sadf_misc.c | 4 ++-- xml/sysstat.dtd | 9 ++++++--- xml/sysstat.xsd | 13 ++++++------- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index b84de35..3ccc58b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ Changes: xxxx/xx/xx: Version 10.0.3 - Sebastien Godard (sysstat orange.fr) + * [Jürgen Heinemann]: Fixed a bug in sadf XML output. + * [Jürgen Heinemann]: Fixed several bugs in DTD and XSD + documents. + * CREDITS file updated. 2011/08/28: Version 10.0.2 - Sebastien Godard (sysstat orange.fr) * sadf modified to make it easier to add new output formats. diff --git a/CREDITS b/CREDITS index de9a8c9..3631abd 100644 --- a/CREDITS +++ b/CREDITS @@ -154,6 +154,7 @@ I would also thank the following people for their hints or bug reports David Gesswein Ladislav Hagara Don Harrop + Jürgen Heinemann Kei Ishida Tatsuo Ito David S. Jackson diff --git a/sadf.h b/sadf.h index 660d739..be7e82b 100644 --- a/sadf.h +++ b/sadf.h @@ -9,7 +9,7 @@ #include "sa.h" /* DTD version for XML output */ -#define XML_DTD_VERSION "2.12" +#define XML_DTD_VERSION "2.13" /* Possible actions for functions used to display reports */ #define F_BEGIN 0x01 diff --git a/sadf_misc.c b/sadf_misc.c index fe5f1fd..7b5a309 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -288,7 +288,7 @@ __printf_funct_t print_xml_timestamp(int *tab, int action, char *cur_date, char *cur_time, int utc, unsigned long long itv) { if (action & F_BEGIN) { - xprintf(*tab, "", + xprintf(*tab, "", cur_date, cur_time, utc ? 1 : 0, itv); } if (action & F_END) { @@ -324,7 +324,7 @@ __printf_funct_t print_xml_header(int *tab, int action, char *dfile, if (action & F_BEGIN) { printf("\n"); - printf("\n"); diff --git a/xml/sysstat.dtd b/xml/sysstat.dtd index dc96ff7..05182d6 100644 --- a/xml/sysstat.dtd +++ b/xml/sysstat.dtd @@ -1,11 +1,14 @@ - + - + + + + @@ -22,7 +25,7 @@ - + - -- XML Schema v2.12 for sysstat. See sadf.h -- + -- XML Schema v2.13 for sysstat. See sadf.h -- @@ -43,7 +43,7 @@ - + @@ -287,11 +287,10 @@ - - - - - + + + + -- 2.40.0