From 953b643be4a2d4fe4bbf7bed4f5c355d3756be45 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 12 Dec 2003 14:22:53 +0000 Subject: a bit of cleanup and bug fix here. added more test cases. 2003-12-12 Dodji Seketeli * docs/examples/selection-example-1.c: a bit of cleanup and bug fix here. * docs/examples/selection-example-1.css: added more test cases. --- docs/examples/selection-example-1.c | 32 ++++++++++++++++++++++++++------ docs/examples/selection-example-1.css | 12 +++++++++--- 2 files changed, 35 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/examples/selection-example-1.c b/docs/examples/selection-example-1.c index 0e0f111..ab94492 100644 --- a/docs/examples/selection-example-1.c +++ b/docs/examples/selection-example-1.c @@ -86,12 +86,32 @@ int init(struct workspace *ws, char **args) /* ...and destruct in reverse order*/ void fini(struct workspace *ws) { - if (ws->selector) cr_sel_eng_destroy(ws->selector); - if (ws->cascade) cr_cascade_destroy(ws->cascade); - if (ws->stylesheet) cr_stylesheet_destroy(ws->stylesheet); - if (ws->result) xmlXPathFreeObject(ws->result); - if (ws->xpath) xmlXPathFreeContext(ws->xpath); - if (ws->document) xmlFreeDoc(ws->document); + if (ws->selector) + { + cr_sel_eng_destroy(ws->selector); + ws->selector = NULL ; + } + if (ws->cascade) + { + cr_cascade_destroy(ws->cascade); + ws->cascade = NULL ; + } + + if (ws->result) + { + xmlXPathFreeObject(ws->result); + ws->result = NULL ; + } + if (ws->xpath) + { + xmlXPathFreeContext(ws->xpath); + ws->xpath = NULL ; + } + if (ws->document) + { + xmlFreeDoc(ws->document); + ws->document = NULL ; + } } void print_property(gpointer name, gpointer decl, gpointer data) diff --git a/docs/examples/selection-example-1.css b/docs/examples/selection-example-1.css index 8bf681b..a50fdb4 100644 --- a/docs/examples/selection-example-1.css +++ b/docs/examples/selection-example-1.css @@ -10,22 +10,28 @@ report > entry note { - color : green; + color : note-color; frame : solid; } note[id] { - color : blue; + color : note-id-color; frame : solid; } note[id=bar] { margin : 5px; + color: note-id-bar-color ; +} + +note[id=foo] +{ + color : note-id-foo-color; } entry[type=notice] note[id=bar] { padding : 5px; -} \ No newline at end of file +} -- cgit v1.2.1