File:  [Public] / DOM / Node.h
Revision 1.6: download - view: text, annotated - select for diffs
Mon Jun 15 05:26:42 1998 UTC (25 years, 11 months ago) by daniel
Branches: MAIN
CVS tags: HEAD
Nearly completed Document interfaces, general cleanup, Daniel.

/*
 * Node.h : interfaces of the Node interface as defined by
 *       Document Object Model (Core) Level 1
 *       http://www.w3.org/TR/WD-DOM/level-one-core.html
 * 
 * Daniel.Veillard@w3.org
 *
 * $Id: Node.h,v 1.6 1998/06/15 05:26:42 daniel Exp $
 */

#ifndef __DOM_NODE_H__
#define __DOM_NODE_H__

/*
 * Constants
 */

typedef enum domNodeType {
DOM_NODE_DOCUMENT=1,
DOM_NODE_ELEMENT=2,
DOM_NODE_ATTRIBUTE=3,
DOM_NODE_PI=4,
DOM_NODE_COMMENT=5,
DOM_NODE_TEXT=6
} domNodeType;

/*
 * Structure
 */
typedef struct domNode {
    struct domDocument *doc;	/* The document owning this node */
    domNodeType type;		/* One of the DOM_NODE_xxx */
    struct domNode *parent;	/* The parent */
    struct domNode *childs;	/* The child list, if any */
    struct domNode *lastchild;	/* The last child in the list, if any */
    struct domNode *prev;	/* Previous sibling */
    struct domNode *next;	/* Next sibling */
    /* ELEMENT */
    struct domNode *attributes;	/* List of Attributes */
    struct domNode *lastattribute;/* last Attribute */
    /* ATTRIBUTE */
    int specified;		/* For default value madness */
    /* ATTRIBUTE, ELEMENT, PI */
    char *name;			/* The name of the attribute, tagName for
                                   Elements */
    /* ATTRIBUTE, TEXT, COMMENT, PI */
    char *value;		/* the string in the node */
} domNode, * domNodePtr;

/*
 * Functions
 */

extern int getNodeType(domNodePtr node);
extern domNodePtr getParentNode(domNodePtr node);
extern struct domNodeIterator *getChildNodes(domNodePtr node);
extern int hasChildNodes(domNodePtr node);
extern domNodePtr getFirstChild(domNodePtr node);
extern domNodePtr getPreviousSibling(domNodePtr node);
extern domNodePtr getNextSibling(domNodePtr node);
extern domNodePtr insertBefore(domNodePtr node, domNodePtr newChild,
                               domNodePtr refChild);
extern domNodePtr replaceChild(domNodePtr node, domNodePtr newChild,
                               domNodePtr oldChild);
extern domNodePtr removeChild(domNodePtr node, domNodePtr oldChild);

#endif /* __DOM_NODE_H__ */



Webmaster