2001-02-23 20:55:21 +03:00
/*
* tree . h : describes the structures found in an tree resulting
* from an XML parsing .
*
* See Copyright for the status of this software .
*
* Daniel . Veillard @ w3 . org
*
* 14 Nov 2000 ht - added redefinition of xmlBufferWriteChar for VMS
*
*/
# ifndef __XML_TREE_H__
# define __XML_TREE_H__
# include <stdio.h>
# include <libxml/xmlversion.h>
2001-04-11 18:39:16 +04:00
# include <libxml/xmlmemory.h>
2001-02-23 20:55:21 +03:00
# ifdef __cplusplus
extern " C " {
# endif
# define XML_XML_NAMESPACE \
( const xmlChar * ) " http://www.w3.org/XML/1998/namespace "
/*
* The different element types carried by an XML tree
*
* NOTE : This is synchronized with DOM Level1 values
* See http : //www.w3.org/TR/REC-DOM-Level-1/
*
* Actually this had diverged a bit , and now XML_DOCUMENT_TYPE_NODE should
* be deprecated to use an XML_DTD_NODE .
*/
typedef enum {
XML_ELEMENT_NODE = 1 ,
XML_ATTRIBUTE_NODE = 2 ,
XML_TEXT_NODE = 3 ,
XML_CDATA_SECTION_NODE = 4 ,
XML_ENTITY_REF_NODE = 5 ,
XML_ENTITY_NODE = 6 ,
XML_PI_NODE = 7 ,
XML_COMMENT_NODE = 8 ,
XML_DOCUMENT_NODE = 9 ,
XML_DOCUMENT_TYPE_NODE = 10 ,
XML_DOCUMENT_FRAG_NODE = 11 ,
XML_NOTATION_NODE = 12 ,
XML_HTML_DOCUMENT_NODE = 13 ,
XML_DTD_NODE = 14 ,
XML_ELEMENT_DECL = 15 ,
XML_ATTRIBUTE_DECL = 16 ,
XML_ENTITY_DECL = 17 ,
XML_NAMESPACE_DECL = 18 ,
XML_XINCLUDE_START = 19 ,
XML_XINCLUDE_END = 20
2001-04-23 17:41:34 +04:00
# ifdef LIBXML_DOCB_ENABLED
, XML_DOCB_DOCUMENT_NODE = 21
2001-02-23 20:55:21 +03:00
# endif
} xmlElementType ;
2001-05-19 18:59:49 +04:00
/**
* xmlChar :
2001-02-23 20:55:21 +03:00
*
2001-05-19 18:59:49 +04:00
* This is a basic byte in an UTF - 8 encoded string .
* It ' s unsigned allowing to pinpoint case where char * are assigned
* to xmlChar * ( possibly making serialization back impossible ) .
2001-02-23 20:55:21 +03:00
*/
typedef unsigned char xmlChar ;
2001-05-19 18:59:49 +04:00
/*
* Removed in 2.3 .9 . . . nobody should still use this
*
2001-02-23 20:55:21 +03:00
# ifndef WIN32
# ifndef CHAR
# define CHAR xmlChar
# endif
# endif
2001-05-19 18:59:49 +04:00
*/
2001-02-23 20:55:21 +03:00
2001-05-19 18:59:49 +04:00
/**
* BAD_CAST :
*
* Macro to cast a string to an xmlChar * when one know its safe .
*/
2001-02-23 20:55:21 +03:00
# define BAD_CAST (xmlChar *)
2001-05-19 18:59:49 +04:00
/**
* xmlNotation :
*
2001-02-23 20:55:21 +03:00
* a DTD Notation definition
*/
typedef struct _xmlNotation xmlNotation ;
typedef xmlNotation * xmlNotationPtr ;
struct _xmlNotation {
2001-03-19 02:17:47 +03:00
const xmlChar * name ; /* Notation name */
2001-02-23 20:55:21 +03:00
const xmlChar * PublicID ; /* Public identifier, if any */
const xmlChar * SystemID ; /* System identifier, if any */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlAttributeType :
*
* a DTD Attribute type definition
2001-02-23 20:55:21 +03:00
*/
typedef enum {
XML_ATTRIBUTE_CDATA = 1 ,
XML_ATTRIBUTE_ID ,
XML_ATTRIBUTE_IDREF ,
XML_ATTRIBUTE_IDREFS ,
XML_ATTRIBUTE_ENTITY ,
XML_ATTRIBUTE_ENTITIES ,
XML_ATTRIBUTE_NMTOKEN ,
XML_ATTRIBUTE_NMTOKENS ,
XML_ATTRIBUTE_ENUMERATION ,
XML_ATTRIBUTE_NOTATION
} xmlAttributeType ;
2001-05-19 18:59:49 +04:00
/**
* xmlAttributeDefault :
*
* a DTD Attribute default definition
*/
2001-02-23 20:55:21 +03:00
typedef enum {
XML_ATTRIBUTE_NONE = 1 ,
XML_ATTRIBUTE_REQUIRED ,
XML_ATTRIBUTE_IMPLIED ,
XML_ATTRIBUTE_FIXED
} xmlAttributeDefault ;
2001-05-19 18:59:49 +04:00
/**
* xmlEnumeration :
*
* list structure used when there is an enumeration in DTDs
*/
2001-02-23 20:55:21 +03:00
typedef struct _xmlEnumeration xmlEnumeration ;
typedef xmlEnumeration * xmlEnumerationPtr ;
struct _xmlEnumeration {
struct _xmlEnumeration * next ; /* next one */
const xmlChar * name ; /* Enumeration name */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlAttribute :
*
* an Attribute declaration in a DTD
*/
2001-02-23 20:55:21 +03:00
typedef struct _xmlAttribute xmlAttribute ;
typedef xmlAttribute * xmlAttributePtr ;
struct _xmlAttribute {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* XML_ATTRIBUTE_DECL, must be second ! */
const xmlChar * name ; /* Attribute name */
struct _xmlNode * children ; /* NULL */
struct _xmlNode * last ; /* NULL */
struct _xmlDtd * parent ; /* -> DTD */
struct _xmlNode * next ; /* next sibling link */
struct _xmlNode * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* the containing document */
struct _xmlAttribute * nexth ; /* next in hash table */
xmlAttributeType atype ; /* The attribute type */
xmlAttributeDefault def ; /* the default */
const xmlChar * defaultValue ; /* or the default value */
xmlEnumerationPtr tree ; /* or the enumeration tree if any */
const xmlChar * prefix ; /* the namespace prefix if any */
const xmlChar * elem ; /* Element holding the attribute */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlElementContentType :
*
* Possible definitions of element content types
2001-02-23 20:55:21 +03:00
*/
typedef enum {
XML_ELEMENT_CONTENT_PCDATA = 1 ,
XML_ELEMENT_CONTENT_ELEMENT ,
XML_ELEMENT_CONTENT_SEQ ,
XML_ELEMENT_CONTENT_OR
} xmlElementContentType ;
2001-05-19 18:59:49 +04:00
/**
* xmlElementContentOccur :
*
* Possible definitions of element content occurences
*/
2001-02-23 20:55:21 +03:00
typedef enum {
XML_ELEMENT_CONTENT_ONCE = 1 ,
XML_ELEMENT_CONTENT_OPT ,
XML_ELEMENT_CONTENT_MULT ,
XML_ELEMENT_CONTENT_PLUS
} xmlElementContentOccur ;
2001-05-19 18:59:49 +04:00
/**
* xmlElementContent :
*
* an XML Element content as stored after parsing an element definition
* in a DTD .
*/
2001-02-23 20:55:21 +03:00
typedef struct _xmlElementContent xmlElementContent ;
typedef xmlElementContent * xmlElementContentPtr ;
struct _xmlElementContent {
xmlElementContentType type ; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur ; /* ONCE, OPT, MULT or PLUS */
const xmlChar * name ; /* Element name */
struct _xmlElementContent * c1 ; /* first child */
struct _xmlElementContent * c2 ; /* second child */
2001-04-20 17:03:48 +04:00
struct _xmlElementContent * parent ; /* parent */
2001-02-23 20:55:21 +03:00
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlElementTypeVal :
*
* the differnt possibility for an element content type
*/
2001-02-23 20:55:21 +03:00
typedef enum {
2001-04-18 17:09:01 +04:00
XML_ELEMENT_TYPE_UNDEFINED = 0 ,
2001-02-23 20:55:21 +03:00
XML_ELEMENT_TYPE_EMPTY = 1 ,
XML_ELEMENT_TYPE_ANY ,
XML_ELEMENT_TYPE_MIXED ,
XML_ELEMENT_TYPE_ELEMENT
} xmlElementTypeVal ;
2001-05-19 18:59:49 +04:00
/**
* xmlElement :
*
* an XML Element declaration from a DTD
*/
2001-02-23 20:55:21 +03:00
typedef struct _xmlElement xmlElement ;
typedef xmlElement * xmlElementPtr ;
struct _xmlElement {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* XML_ELEMENT_DECL, must be second ! */
const xmlChar * name ; /* Element name */
struct _xmlNode * children ; /* NULL */
struct _xmlNode * last ; /* NULL */
struct _xmlDtd * parent ; /* -> DTD */
struct _xmlNode * next ; /* next sibling link */
struct _xmlNode * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* the containing document */
xmlElementTypeVal etype ; /* The type */
xmlElementContentPtr content ; /* the allowed element content */
xmlAttributePtr attributes ; /* List of the declared attributes */
const xmlChar * prefix ; /* the namespace prefix if any */
} ;
2001-05-19 18:59:49 +04:00
# define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
typedef xmlElementType xmlNsType ;
/**
* xmlNs :
*
2001-02-23 20:55:21 +03:00
* An XML namespace .
* Note that prefix = = NULL is valid , it defines the default namespace
* within the subtree ( until overriden ) .
*
* XML_GLOBAL_NAMESPACE is now deprecated for good
* xmlNsType is unified with xmlElementType
*/
typedef struct _xmlNs xmlNs ;
typedef xmlNs * xmlNsPtr ;
struct _xmlNs {
struct _xmlNs * next ; /* next Ns link for this node */
xmlNsType type ; /* global or local */
const xmlChar * href ; /* URL for the namespace */
const xmlChar * prefix ; /* prefix for the namespace */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlDtd :
*
* An XML DtD , as defined by < ! DOCTYPE . . . There is actually one for
* the internal subset and for the external subset
2001-02-23 20:55:21 +03:00
*/
typedef struct _xmlDtd xmlDtd ;
typedef xmlDtd * xmlDtdPtr ;
struct _xmlDtd {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* XML_DTD_NODE, must be second ! */
const xmlChar * name ; /* Name of the DTD */
struct _xmlNode * children ; /* the value of the property link */
struct _xmlNode * last ; /* last child link */
struct _xmlDoc * parent ; /* child->parent link */
struct _xmlNode * next ; /* next sibling link */
struct _xmlNode * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* the containing document */
/* End of common part */
void * notations ; /* Hash table for notations if any */
void * elements ; /* Hash table for elements if any */
void * attributes ; /* Hash table for attributes if any */
void * entities ; /* Hash table for entities if any */
const xmlChar * ExternalID ; /* External identifier for PUBLIC DTD */
const xmlChar * SystemID ; /* URI for a SYSTEM or PUBLIC DTD */
void * pentities ; /* Hash table for param entities if any */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlAttr :
*
* A attribute on an XML node .
2001-02-23 20:55:21 +03:00
*/
typedef struct _xmlAttr xmlAttr ;
typedef xmlAttr * xmlAttrPtr ;
struct _xmlAttr {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* XML_ATTRIBUTE_NODE, must be second ! */
const xmlChar * name ; /* the name of the property */
struct _xmlNode * children ; /* the value of the property */
struct _xmlNode * last ; /* NULL */
struct _xmlNode * parent ; /* child->parent link */
struct _xmlAttr * next ; /* next sibling link */
struct _xmlAttr * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* the containing document */
xmlNs * ns ; /* pointer to the associated namespace */
xmlAttributeType atype ; /* the attribute type if validating */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlID :
*
2001-02-23 20:55:21 +03:00
* An XML ID instance .
*/
typedef struct _xmlID xmlID ;
typedef xmlID * xmlIDPtr ;
struct _xmlID {
struct _xmlID * next ; /* next ID */
const xmlChar * value ; /* The ID name */
xmlAttrPtr attr ; /* The attribut holding it */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlRef :
*
2001-02-23 20:55:21 +03:00
* An XML IDREF instance .
*/
typedef struct _xmlRef xmlRef ;
typedef xmlRef * xmlRefPtr ;
struct _xmlRef {
struct _xmlRef * next ; /* next Ref */
const xmlChar * value ; /* The Ref name */
xmlAttrPtr attr ; /* The attribut holding it */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlBufferAllocationScheme :
*
* A buffer allocation scheme can be defined to either match exactly the
* need or double it ' s allocated size each time it is found too small
2001-02-23 20:55:21 +03:00
*/
typedef enum {
XML_BUFFER_ALLOC_DOUBLEIT ,
XML_BUFFER_ALLOC_EXACT
} xmlBufferAllocationScheme ;
2001-05-19 18:59:49 +04:00
/**
* xmlBuffer :
*
* A buffer structure
*/
2001-02-23 20:55:21 +03:00
typedef struct _xmlBuffer xmlBuffer ;
typedef xmlBuffer * xmlBufferPtr ;
struct _xmlBuffer {
xmlChar * content ; /* The buffer content UTF8 */
unsigned int use ; /* The buffer size used */
unsigned int size ; /* The buffer size */
xmlBufferAllocationScheme alloc ; /* The realloc method */
} ;
2001-05-19 17:24:56 +04:00
/**
* xmlNode :
*
2001-02-23 20:55:21 +03:00
* A node in an XML tree .
*/
typedef struct _xmlNode xmlNode ;
typedef xmlNode * xmlNodePtr ;
struct _xmlNode {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* type number, must be second ! */
const xmlChar * name ; /* the name of the node, or the entity */
struct _xmlNode * children ; /* parent->childs link */
struct _xmlNode * last ; /* last child link */
struct _xmlNode * parent ; /* child->parent link */
struct _xmlNode * next ; /* next sibling link */
struct _xmlNode * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* the containing document */
xmlNs * ns ; /* pointer to the associated namespace */
# ifndef XML_USE_BUFFER_CONTENT
xmlChar * content ; /* the content */
# else
xmlBufferPtr content ; /* the content in a buffer */
# endif
/* End of common part */
struct _xmlAttr * properties ; /* properties list */
xmlNs * nsDef ; /* namespace definitions on this node */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlDoc :
*
2001-02-23 20:55:21 +03:00
* An XML document .
*/
typedef struct _xmlDoc xmlDoc ;
typedef xmlDoc * xmlDocPtr ;
struct _xmlDoc {
# ifndef XML_WITHOUT_CORBA
void * _private ; /* for Corba, must be first ! */
# endif
xmlElementType type ; /* XML_DOCUMENT_NODE, must be second ! */
char * name ; /* name/filename/URI of the document */
struct _xmlNode * children ; /* the document tree */
struct _xmlNode * last ; /* last child link */
struct _xmlNode * parent ; /* child->parent link */
struct _xmlNode * next ; /* next sibling link */
struct _xmlNode * prev ; /* previous sibling link */
struct _xmlDoc * doc ; /* autoreference to itself */
/* End of common part */
int compression ; /* level of zlib compression */
int standalone ; /* standalone document (no external refs) */
struct _xmlDtd * intSubset ; /* the document internal subset */
struct _xmlDtd * extSubset ; /* the document external subset */
struct _xmlNs * oldNs ; /* Global namespace, the old way */
const xmlChar * version ; /* the XML version string */
const xmlChar * encoding ; /* external initial encoding, if any */
void * ids ; /* Hash table for ID attributes if any */
void * refs ; /* Hash table for IDREFs attributes if any */
const xmlChar * URL ; /* The URI for that document */
int charset ; /* encoding of the in-memory content
actually an xmlCharEncoding */
} ;
2001-05-19 18:59:49 +04:00
/**
* xmlChildrenNode :
*
* Macro for compatibility naming layer with libxml1
2001-02-23 20:55:21 +03:00
*/
# ifndef xmlChildrenNode
# define xmlChildrenNode children
2001-05-19 18:59:49 +04:00
# endif
/**
* xmlRootNode :
*
* Macro for compatibility naming layer with libxml1
*/
# ifndef xmlRootNode
2001-02-23 20:55:21 +03:00
# define xmlRootNode children
# endif
/*
* Variables .
*/
LIBXML_DLL_IMPORT extern xmlNsPtr baseDTD ;
LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility ; /* maintain compatibility with old WD */
LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput ; /* try to indent the tree dumps */
LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme ; /* alloc scheme to use */
2001-03-10 15:32:04 +03:00
LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags ; /* save empty tags as <empty></empty> */
LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize ; /* default buffer size */
2001-02-23 20:55:21 +03:00
/*
* Handling Buffers .
*/
2001-03-24 20:00:36 +03:00
void xmlSetBufferAllocationScheme ( xmlBufferAllocationScheme scheme ) ;
xmlBufferAllocationScheme xmlGetBufferAllocationScheme ( void ) ;
2001-02-23 20:55:21 +03:00
xmlBufferPtr xmlBufferCreate ( void ) ;
xmlBufferPtr xmlBufferCreateSize ( size_t size ) ;
2001-03-24 20:00:36 +03:00
int xmlBufferResize ( xmlBufferPtr buf ,
unsigned int size ) ;
2001-02-23 20:55:21 +03:00
void xmlBufferFree ( xmlBufferPtr buf ) ;
int xmlBufferDump ( FILE * file ,
xmlBufferPtr buf ) ;
void xmlBufferAdd ( xmlBufferPtr buf ,
const xmlChar * str ,
int len ) ;
void xmlBufferAddHead ( xmlBufferPtr buf ,
const xmlChar * str ,
int len ) ;
void xmlBufferCat ( xmlBufferPtr buf ,
const xmlChar * str ) ;
void xmlBufferCCat ( xmlBufferPtr buf ,
const char * str ) ;
int xmlBufferShrink ( xmlBufferPtr buf ,
unsigned int len ) ;
int xmlBufferGrow ( xmlBufferPtr buf ,
unsigned int len ) ;
void xmlBufferEmpty ( xmlBufferPtr buf ) ;
const xmlChar * xmlBufferContent ( const xmlBufferPtr buf ) ;
int xmlBufferUse ( const xmlBufferPtr buf ) ;
void xmlBufferSetAllocationScheme ( xmlBufferPtr buf ,
xmlBufferAllocationScheme scheme ) ;
int xmlBufferLength ( const xmlBufferPtr buf ) ;
/*
* Creating / freeing new structures
*/
xmlDtdPtr xmlCreateIntSubset ( xmlDocPtr doc ,
const xmlChar * name ,
const xmlChar * ExternalID ,
const xmlChar * SystemID ) ;
xmlDtdPtr xmlNewDtd ( xmlDocPtr doc ,
const xmlChar * name ,
const xmlChar * ExternalID ,
const xmlChar * SystemID ) ;
xmlDtdPtr xmlGetIntSubset ( xmlDocPtr doc ) ;
void xmlFreeDtd ( xmlDtdPtr cur ) ;
xmlNsPtr xmlNewGlobalNs ( xmlDocPtr doc ,
const xmlChar * href ,
const xmlChar * prefix ) ;
xmlNsPtr xmlNewNs ( xmlNodePtr node ,
const xmlChar * href ,
const xmlChar * prefix ) ;
void xmlFreeNs ( xmlNsPtr cur ) ;
2001-03-24 20:00:36 +03:00
void xmlFreeNsList ( xmlNsPtr cur ) ;
2001-02-23 20:55:21 +03:00
xmlDocPtr xmlNewDoc ( const xmlChar * version ) ;
void xmlFreeDoc ( xmlDocPtr cur ) ;
xmlAttrPtr xmlNewDocProp ( xmlDocPtr doc ,
const xmlChar * name ,
const xmlChar * value ) ;
xmlAttrPtr xmlNewProp ( xmlNodePtr node ,
const xmlChar * name ,
const xmlChar * value ) ;
xmlAttrPtr xmlNewNsProp ( xmlNodePtr node ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * value ) ;
void xmlFreePropList ( xmlAttrPtr cur ) ;
void xmlFreeProp ( xmlAttrPtr cur ) ;
xmlAttrPtr xmlCopyProp ( xmlNodePtr target ,
xmlAttrPtr cur ) ;
xmlAttrPtr xmlCopyPropList ( xmlNodePtr target ,
xmlAttrPtr cur ) ;
xmlDtdPtr xmlCopyDtd ( xmlDtdPtr dtd ) ;
xmlDocPtr xmlCopyDoc ( xmlDocPtr doc ,
int recursive ) ;
/*
* Creating new nodes
*/
xmlNodePtr xmlNewDocNode ( xmlDocPtr doc ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * content ) ;
xmlNodePtr xmlNewDocRawNode ( xmlDocPtr doc ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * content ) ;
xmlNodePtr xmlNewNode ( xmlNsPtr ns ,
const xmlChar * name ) ;
xmlNodePtr xmlNewChild ( xmlNodePtr parent ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * content ) ;
xmlNodePtr xmlNewTextChild ( xmlNodePtr parent ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * content ) ;
xmlNodePtr xmlNewDocText ( xmlDocPtr doc ,
const xmlChar * content ) ;
xmlNodePtr xmlNewText ( const xmlChar * content ) ;
xmlNodePtr xmlNewPI ( const xmlChar * name ,
const xmlChar * content ) ;
xmlNodePtr xmlNewDocTextLen ( xmlDocPtr doc ,
const xmlChar * content ,
int len ) ;
xmlNodePtr xmlNewTextLen ( const xmlChar * content ,
int len ) ;
xmlNodePtr xmlNewDocComment ( xmlDocPtr doc ,
const xmlChar * content ) ;
xmlNodePtr xmlNewComment ( const xmlChar * content ) ;
xmlNodePtr xmlNewCDataBlock ( xmlDocPtr doc ,
const xmlChar * content ,
int len ) ;
xmlNodePtr xmlNewCharRef ( xmlDocPtr doc ,
const xmlChar * name ) ;
xmlNodePtr xmlNewReference ( xmlDocPtr doc ,
const xmlChar * name ) ;
xmlNodePtr xmlCopyNode ( xmlNodePtr node ,
int recursive ) ;
2001-04-12 12:55:36 +04:00
xmlNodePtr xmlDocCopyNode ( xmlNodePtr node ,
xmlDocPtr doc ,
int recursive ) ;
2001-02-23 20:55:21 +03:00
xmlNodePtr xmlCopyNodeList ( xmlNodePtr node ) ;
xmlNodePtr xmlNewDocFragment ( xmlDocPtr doc ) ;
/*
* Navigating
*/
xmlNodePtr xmlDocGetRootElement ( xmlDocPtr doc ) ;
xmlNodePtr xmlGetLastChild ( xmlNodePtr parent ) ;
int xmlNodeIsText ( xmlNodePtr node ) ;
int xmlIsBlankNode ( xmlNodePtr node ) ;
/*
* Changing the structure
*/
xmlNodePtr xmlDocSetRootElement ( xmlDocPtr doc ,
xmlNodePtr root ) ;
void xmlNodeSetName ( xmlNodePtr cur ,
const xmlChar * name ) ;
xmlNodePtr xmlAddChild ( xmlNodePtr parent ,
xmlNodePtr cur ) ;
xmlNodePtr xmlAddChildList ( xmlNodePtr parent ,
xmlNodePtr cur ) ;
xmlNodePtr xmlReplaceNode ( xmlNodePtr old ,
xmlNodePtr cur ) ;
xmlNodePtr xmlAddSibling ( xmlNodePtr cur ,
xmlNodePtr elem ) ;
xmlNodePtr xmlAddPrevSibling ( xmlNodePtr cur ,
xmlNodePtr elem ) ;
xmlNodePtr xmlAddNextSibling ( xmlNodePtr cur ,
xmlNodePtr elem ) ;
void xmlUnlinkNode ( xmlNodePtr cur ) ;
xmlNodePtr xmlTextMerge ( xmlNodePtr first ,
xmlNodePtr second ) ;
void xmlTextConcat ( xmlNodePtr node ,
const xmlChar * content ,
int len ) ;
void xmlFreeNodeList ( xmlNodePtr cur ) ;
void xmlFreeNode ( xmlNodePtr cur ) ;
void xmlSetTreeDoc ( xmlNodePtr tree ,
xmlDocPtr doc ) ;
void xmlSetListDoc ( xmlNodePtr list ,
xmlDocPtr doc ) ;
/*
* Namespaces
*/
xmlNsPtr xmlSearchNs ( xmlDocPtr doc ,
xmlNodePtr node ,
const xmlChar * nameSpace ) ;
xmlNsPtr xmlSearchNsByHref ( xmlDocPtr doc ,
xmlNodePtr node ,
const xmlChar * href ) ;
xmlNsPtr * xmlGetNsList ( xmlDocPtr doc ,
xmlNodePtr node ) ;
void xmlSetNs ( xmlNodePtr node ,
xmlNsPtr ns ) ;
xmlNsPtr xmlCopyNamespace ( xmlNsPtr cur ) ;
xmlNsPtr xmlCopyNamespaceList ( xmlNsPtr cur ) ;
/*
* Changing the content .
*/
xmlAttrPtr xmlSetProp ( xmlNodePtr node ,
const xmlChar * name ,
const xmlChar * value ) ;
xmlChar * xmlGetProp ( xmlNodePtr node ,
const xmlChar * name ) ;
2001-05-11 21:41:21 +04:00
int xmlUnsetProp ( xmlNodePtr node ,
const xmlChar * name ) ;
2001-02-23 20:55:21 +03:00
xmlAttrPtr xmlHasProp ( xmlNodePtr node ,
const xmlChar * name ) ;
xmlAttrPtr xmlSetNsProp ( xmlNodePtr node ,
xmlNsPtr ns ,
const xmlChar * name ,
const xmlChar * value ) ;
xmlChar * xmlGetNsProp ( xmlNodePtr node ,
const xmlChar * name ,
const xmlChar * nameSpace ) ;
2001-05-11 21:41:21 +04:00
int xmlUnsetNsProp ( xmlNodePtr node ,
xmlNsPtr ns ,
const xmlChar * name ) ;
2001-02-23 20:55:21 +03:00
xmlNodePtr xmlStringGetNodeList ( xmlDocPtr doc ,
const xmlChar * value ) ;
xmlNodePtr xmlStringLenGetNodeList ( xmlDocPtr doc ,
const xmlChar * value ,
int len ) ;
xmlChar * xmlNodeListGetString ( xmlDocPtr doc ,
xmlNodePtr list ,
int inLine ) ;
xmlChar * xmlNodeListGetRawString ( xmlDocPtr doc ,
xmlNodePtr list ,
int inLine ) ;
void xmlNodeSetContent ( xmlNodePtr cur ,
const xmlChar * content ) ;
void xmlNodeSetContentLen ( xmlNodePtr cur ,
const xmlChar * content ,
int len ) ;
void xmlNodeAddContent ( xmlNodePtr cur ,
const xmlChar * content ) ;
void xmlNodeAddContentLen ( xmlNodePtr cur ,
const xmlChar * content ,
int len ) ;
xmlChar * xmlNodeGetContent ( xmlNodePtr cur ) ;
xmlChar * xmlNodeGetLang ( xmlNodePtr cur ) ;
void xmlNodeSetLang ( xmlNodePtr cur ,
const xmlChar * lang ) ;
int xmlNodeGetSpacePreserve ( xmlNodePtr cur ) ;
void xmlNodeSetSpacePreserve ( xmlNodePtr cur , int
val ) ;
xmlChar * xmlNodeGetBase ( xmlDocPtr doc ,
xmlNodePtr cur ) ;
void xmlNodeSetBase ( xmlNodePtr cur ,
xmlChar * uri ) ;
/*
* Removing content .
*/
int xmlRemoveProp ( xmlAttrPtr attr ) ;
int xmlRemoveNode ( xmlNodePtr node ) ; /* TODO */
/*
* Internal , don ' t use
*/
# ifdef VMS
void xmlBufferWriteXmlCHAR ( xmlBufferPtr buf ,
const xmlChar * string ) ;
# define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR
# else
void xmlBufferWriteCHAR ( xmlBufferPtr buf ,
const xmlChar * string ) ;
# endif
void xmlBufferWriteChar ( xmlBufferPtr buf ,
const char * string ) ;
void xmlBufferWriteQuotedString ( xmlBufferPtr buf ,
const xmlChar * string ) ;
/*
* Namespace handling
*/
int xmlReconciliateNs ( xmlDocPtr doc ,
xmlNodePtr tree ) ;
/*
* Saving
*/
void xmlDocDumpFormatMemory ( xmlDocPtr cur ,
xmlChar * * mem ,
int * size ,
int format ) ;
void xmlDocDumpMemory ( xmlDocPtr cur ,
xmlChar * * mem ,
int * size ) ;
void xmlDocDumpMemoryEnc ( xmlDocPtr out_doc ,
xmlChar * * doc_txt_ptr ,
int * doc_txt_len ,
const char * txt_encoding ) ;
void xmlDocDumpFormatMemoryEnc ( xmlDocPtr out_doc ,
xmlChar * * doc_txt_ptr ,
int * doc_txt_len ,
const char * txt_encoding ,
int format ) ;
int xmlDocDump ( FILE * f ,
xmlDocPtr cur ) ;
void xmlElemDump ( FILE * f ,
xmlDocPtr doc ,
xmlNodePtr cur ) ;
int xmlSaveFile ( const char * filename ,
xmlDocPtr cur ) ;
2001-04-26 22:59:03 +04:00
int xmlSaveFormatFile ( const char * filename ,
xmlDocPtr cur ,
int format ) ;
2001-02-23 20:55:21 +03:00
void xmlNodeDump ( xmlBufferPtr buf ,
xmlDocPtr doc ,
xmlNodePtr cur ,
int level ,
int format ) ;
2001-04-28 20:55:50 +04:00
/* These are exported from xmlIO.h
2001-02-23 20:55:21 +03:00
int xmlSaveFileTo ( xmlOutputBuffer * buf ,
xmlDocPtr cur ,
const char * encoding ) ;
2001-04-28 20:55:50 +04:00
int xmlSaveFormatFileTo ( xmlOutputBuffer * buf ,
xmlDocPtr cur ,
const char * encoding ,
int format ) ;
2001-02-23 20:55:21 +03:00
*/
int xmlSaveFileEnc ( const char * filename ,
xmlDocPtr cur ,
const char * encoding ) ;
/*
* Compression
*/
int xmlGetDocCompressMode ( xmlDocPtr doc ) ;
void xmlSetDocCompressMode ( xmlDocPtr doc ,
int mode ) ;
int xmlGetCompressMode ( void ) ;
void xmlSetCompressMode ( int mode ) ;
# ifdef __cplusplus
}
# endif
# endif /* __XML_TREE_H__ */