Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

xml_handling.c File Reference

XML handling function definitions. More...

#include "config.h"
#include "defines.h"
#include <stdlib.h>
#include <gdome.h>
#include <pthread.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "cf_pthread.h"
#include "charconvert.h"
#include "utils.h"
#include "hashlib.h"
#include "readline.h"
#include "fo_server.h"
#include "configparser.h"
#include "xml_handling.h"
#include "serverlib.h"

Go to the source code of this file.

Functions

GdomeDocument * xml_create_doc (GdomeDOMImplementation *impl, const u_char *dtd_uri)
GdomeElement * xml_create_element (GdomeDocument *doc, const u_char *name)
void xml_set_attribute (GdomeElement *el, const u_char *name, const u_char *val)
void xml_set_value (GdomeDocument *doc, GdomeElement *el, const u_char *value)
t_postingstringify_posting (GdomeDocument *doc1, GdomeElement *t1, GdomeDocument *doc2, GdomeElement *t2, t_posting *p)
void stringify_thread_and_write_to_disk (GdomeDocument *doc1, t_thread *t)
u_char * get_node_value (GdomeNode *n)


Detailed Description

XML handling function definitions.

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains functions making it easier to handle the gdome library

Definition in file xml_handling.c.


Function Documentation

u_char* get_node_value GdomeNode *  n  ) 
 

This function tries to get the node content. The returned charset is UTF-8.

Parameters:
n The node value
Returns:
NULL on error, the content as a string on success.
Attention:
You have to free() the returned string!

Definition at line 348 of file xml_handling.c.

t_posting* stringify_posting GdomeDocument *  doc1,
GdomeElement *  t1,
GdomeDocument *  doc2,
GdomeElement *  t2,
t_posting p
 

This function stringifies the postings of a thread.

Parameters:
doc1 The Gdome DOM document of the index file
t1 The thread element of the index file
doc2 The Gdome DOM document of the thread file
t2 The thread element of the thread file
p The posting element
Returns:
The next posting in this hierarchy or lower this hierarchy level.

Definition at line 104 of file xml_handling.c.

void stringify_thread_and_write_to_disk GdomeDocument *  doc1,
t_thread t
 

This function stringifies the thread and its postings

Parameters:
doc1 The index file document
t The thread structure

Definition at line 278 of file xml_handling.c.

GdomeDocument* xml_create_doc GdomeDOMImplementation *  impl,
const u_char *  dtd_uri
 

This function creates a new DOM document.

Parameters:
impl The DOM implementation
dtd_uri The URI to the DTD
Returns:
NULL on error, the document on success
Attention:
You have to destroy the GdomeDocument!

Definition at line 47 of file xml_handling.c.

GdomeElement* xml_create_element GdomeDocument *  doc,
const u_char *  name
 

This function creates a new XML element.

Parameters:
doc The DOM document
name The element name
Returns:
NULL on error, the element object on success
Attention:
You have to destroy the GdomeElement!

Definition at line 63 of file xml_handling.c.

void xml_set_attribute GdomeElement *  el,
const u_char *  name,
const u_char *  val
 

This function sets a XML attribute to the element

Parameters:
el The DOM XML element object
name The attribute name
val The attribute value

Definition at line 74 of file xml_handling.c.

void xml_set_value GdomeDocument *  doc,
GdomeElement *  el,
const u_char *  value
 

This function sets a value to a GdomeElement.

Parameters:
doc The Gdome DOM document object
el The Gdome DOM XML element
value The value to set to the element

Definition at line 91 of file xml_handling.c.


Generated on Sun Apr 25 16:37:40 2004 for Classic Forum by doxygen 1.3.5