Details
enum xmlElementType
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
} xmlElementType; |
BAD_CAST
#define BAD_CAST (xmlChar *) |
struct xmlNotation
struct xmlNotation {
const xmlChar *name; /* Notation name */
const xmlChar *PublicID; /* Public identifier, if any */
const xmlChar *SystemID; /* System identifier, if any */
}; |
xmlNotationPtr
typedef xmlNotation *xmlNotationPtr; |
enum xmlAttributeType
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; |
enum xmlAttributeDefault
typedef enum {
XML_ATTRIBUTE_NONE = 1,
XML_ATTRIBUTE_REQUIRED,
XML_ATTRIBUTE_IMPLIED,
XML_ATTRIBUTE_FIXED
} xmlAttributeDefault; |
struct xmlEnumeration
struct xmlEnumeration {
struct _xmlEnumeration *next; /* next one */
const xmlChar *name; /* Enumeration name */
}; |
xmlEnumerationPtr
typedef xmlEnumeration *xmlEnumerationPtr; |
struct xmlAttribute
struct xmlAttribute {
const xmlChar *elem; /* Element holding the attribute */
const xmlChar *name; /* Attribute name */
struct _xmlAttribute *next; /* list of attributes of an element */
xmlAttributeType type; /* The 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 */
}; |
xmlAttributePtr
typedef xmlAttribute *xmlAttributePtr; |
enum xmlElementContentType
typedef enum {
XML_ELEMENT_CONTENT_PCDATA = 1,
XML_ELEMENT_CONTENT_ELEMENT,
XML_ELEMENT_CONTENT_SEQ,
XML_ELEMENT_CONTENT_OR
} xmlElementContentType; |
enum xmlElementContentOccur
typedef enum {
XML_ELEMENT_CONTENT_ONCE = 1,
XML_ELEMENT_CONTENT_OPT,
XML_ELEMENT_CONTENT_MULT,
XML_ELEMENT_CONTENT_PLUS
} xmlElementContentOccur; |
struct xmlElementContent
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 */
}; |
xmlElementContentPtr
typedef xmlElementContent *xmlElementContentPtr; |
enum xmlElementTypeVal
typedef enum {
XML_ELEMENT_TYPE_EMPTY = 1,
XML_ELEMENT_TYPE_ANY,
XML_ELEMENT_TYPE_MIXED,
XML_ELEMENT_TYPE_ELEMENT
} xmlElementTypeVal; |
struct xmlElement
struct xmlElement {
const xmlChar *name; /* Element name */
xmlElementTypeVal type; /* The type */
xmlElementContentPtr content; /* the allowed element content */
xmlAttributePtr attributes; /* List of the declared attributes */
}; |
xmlElementPtr
typedef xmlElement *xmlElementPtr; |
enum xmlNsType
typedef enum {
XML_GLOBAL_NAMESPACE = 1, /* old style global namespace */
XML_LOCAL_NAMESPACE /* new style local scoping */
} xmlNsType; |
struct xmlNs
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 */
}; |
struct xmlDtd
struct xmlDtd {
const xmlChar *name; /* Name of the DTD */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
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 */
/* struct xmlDtd *next; * next link for this document */
}; |
xmlDtdPtr
typedef xmlDtd *xmlDtdPtr; |
struct xmlAttr
struct xmlAttr {
#ifndef XML_WITHOUT_CORBA
void *_private; /* for Corba, must be first ! */
void *vepv; /* for Corba, must be next ! */
#endif
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct _xmlNode *node; /* attr->node link */
struct _xmlAttr *next; /* attribute list link */
const xmlChar *name; /* the name of the property */
struct _xmlNode *val; /* the value of the property */
xmlNs *ns; /* pointer to the associated namespace */
}; |
xmlAttrPtr
typedef xmlAttr *xmlAttrPtr; |
struct xmlID
struct xmlID {
struct _xmlID *next; /* next ID */
const xmlChar *value; /* The ID name */
xmlAttrPtr attr; /* The attribut holding it */
}; |
struct xmlRef
struct xmlRef {
struct _xmlRef *next; /* next Ref */
const xmlChar *value; /* The Ref name */
xmlAttrPtr attr; /* The attribut holding it */
}; |
xmlRefPtr
typedef xmlRef *xmlRefPtr; |
enum xmlBufferAllocationScheme
typedef enum {
XML_BUFFER_ALLOC_DOUBLEIT,
XML_BUFFER_ALLOC_EXACT
} xmlBufferAllocationScheme; |
Sets the allocation scheme for this buffer
struct xmlBuffer
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 */
}; |
xmlBufferPtr
typedef xmlBuffer *xmlBufferPtr; |
struct xmlNode
struct xmlNode {
#ifndef XML_WITHOUT_CORBA
void *_private; /* for Corba, must be first ! */
void *vepv; /* for Corba, must be next ! */
#endif
xmlElementType type; /* type number in the DTD, must be third ! */
struct _xmlDoc *doc; /* the containing document */
struct _xmlNode *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlNode *childs; /* parent->childs link */
struct _xmlNode *last; /* last child link */
struct _xmlAttr *properties;/* properties list */
const xmlChar *name; /* the name of the node, or the entity */
xmlNs *ns; /* pointer to the associated namespace */
xmlNs *nsDef; /* namespace definitions on this node */
#ifndef XML_USE_BUFFER_CONTENT
xmlChar *content; /* the content */
#else
xmlBufferPtr content; /* the content in a buffer */
#endif
}; |
xmlNodePtr
typedef xmlNode *xmlNodePtr; |
struct xmlDoc
struct xmlDoc {
#ifndef XML_WITHOUT_CORBA
void *_private; /* for Corba, must be first ! */
void *vepv; /* for Corba, must be next ! */
#endif
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* encoding, if any */
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 */
struct _xmlNode *root; /* the document tree */
void *ids; /* Hash table for ID attributes if any */
void *refs; /* Hash table for IDREFs attributes if any */
}; |
xmlDocPtr
typedef xmlDoc *xmlDocPtr; |
oldXMLWDcompatibility
extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */ |
xmlIndentTreeOutput
extern int xmlIndentTreeOutput; /* try to indent the tree dumps */ |
xmlBufferAllocScheme
extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */ |
xmlSaveNoEmptyTags
extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */ |
xmlBufferCreate ()
routine to create an XML buffer.
xmlBufferCreateSize ()
routine to create an XML buffer.
xmlBufferFree ()
Frees an XML buffer.
xmlBufferDump ()
Dumps an XML buffer to a FILE *.
xmlBufferAdd ()
Add a string range to an XML buffer. if len == -1, the lenght of
str is recomputed.
xmlBufferCat ()
Append a zero terminated string to an XML buffer.
xmlBufferCCat ()
Append a zero terminated C string to an XML buffer.
xmlBufferShrink ()
Remove the beginning of an XML buffer.
xmlBufferEmpty ()
empty a buffer.
xmlBufferSetAllocationScheme ()
xmlCreateIntSubset ()
Create the internal subset of a document
xmlNewDtd ()
Creation of a new DTD.
xmlFreeDtd ()
Free a DTD structure.
xmlNewGlobalNs ()
Creation of a Namespace, the old way using PI and without scoping
DEPRECATED !!!
It now create a namespace on the root element of the document if found.
xmlNewNs ()
Creation of a new Namespace. This function will refuse to create
a namespace with a similar prefix than an existing one present on this
node.
xmlFreeNs ()
Free up the structures associated to a namespace
xmlFreeDoc ()
Free up all the structures used by a document, tree included.
xmlNewDocProp ()
Create a new property carried by a document.
xmlNewProp ()
Create a new property carried by a node.
xmlNewNsProp ()
Create a new property tagged with a namespace and carried by a node.
xmlFreePropList ()
Free a property and all its siblings, all the childs are freed too.
xmlFreeProp ()
Free one attribute, all the content is freed too
xmlCopyProp ()
Do a copy of the attribute.
xmlCopyPropList ()
Do a copy of an attribute list.
xmlCopyDtd ()
Do a copy of the dtd.
xmlCopyDoc ()
Do a copy of the document info. If recursive, the content tree will
be copied too as well as Dtd, namespaces and entities.
xmlNewDocNode ()
Creation of a new node element within a document. ns and content
are optionnal (NULL).
NOTE: content is supposed to be a piece of XML CDATA, so it allow entities
references, but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you don't
need entities support.
xmlNewDocRawNode ()
Creation of a new node element within a document. ns and content
are optionnal (NULL).
xmlNewNode ()
Creation of a new node element. ns and content are optionnal (NULL).
If content is non NULL, a child list containing the TEXTs and
ENTITY_REFs node will be created.
xmlNewChild ()
Creation of a new child element, added at the end of parent childs list.
ns and content parameters are optionnal (NULL). If content is non NULL,
a child list containing the TEXTs and ENTITY_REFs node will be created.
NOTE: content is supposed to be a piece of XML CDATA, so it allow entities
references, but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant(). Use xmlNewTextChild() if entities
support is not needed.
xmlNewTextChild ()
Creation of a new child element, added at the end of parent childs list.
ns and content parameters are optionnal (NULL). If content is non NULL,
a child TEXT node will be created containing the string content.
xmlNewDocText ()
Creation of a new text node within a document.
xmlNewText ()
Creation of a new text node.
xmlNewPI ()
Creation of a processing instruction element.
xmlNewDocTextLen ()
Creation of a new text node with an extra content lenght parameter. The
text node pertain to a given document.
xmlNewTextLen ()
Creation of a new text node with an extra parameter for the content's lenght
xmlNewDocComment ()
Creation of a new node containing a commentwithin a document.
xmlNewComment ()
Creation of a new node containing a comment.
xmlNewCDataBlock ()
Creation of a new node containing a CData block.
xmlNewReference ()
Creation of a new reference node.
xmlCopyNode ()
Do a copy of the node.
xmlCopyNodeList ()
Do a recursive copy of the node list.
xmlNewDocFragment ()
Creation of a new Fragment node.
xmlDocGetRootElement ()
Get the root element of the document (doc->root is a list
containing possibly comments, PIs, etc ...).
xmlGetLastChild ()
Search the last child of a node.
xmlNodeIsText ()
Is this node a Text node ?
xmlDocSetRootElement ()
Set the root element of the document (doc->root is a list
containing possibly comments, PIs, etc ...).
xmlNodeSetName ()
Searches the language of a node, i.e. the values of the xml:lang
attribute or the one carried by the nearest ancestor.
xmlAddChild ()
Add a new child element, to parent, at the end of the child list.
xmlReplaceNode ()
Unlink the old node from it's current context, prune the new one
at the same place. If cur was already inserted in a document it is
first unlinked from its existing context.
xmlAddSibling ()
Add a new element elem to the list of siblings of cur
If the new element was already inserted in a document it is
first unlinked from its existing context.
xmlAddPrevSibling ()
Add a new element elem as the previous siblings of cur
If the new element was already inserted in a document it is
first unlinked from its existing context.
xmlAddNextSibling ()
Add a new element elem as the next siblings of cur
If the new element was already inserted in a document it is
first unlinked from its existing context.
xmlUnlinkNode ()
Unlink a node from it's current context, the node is not freed
xmlTextMerge ()
Merge two text nodes into one
xmlTextConcat ()
Concat the given string at the end of the existing node content
xmlFreeNodeList ()
Free a node and all its siblings, this is a recursive behaviour, all
the childs are freed too.
xmlFreeNode ()
Free a node, this is a recursive behaviour, all the childs are freed too.
xmlRemoveProp ()
Unlink and free one attribute, all the content is freed too
Note this doesn't work for namespace definition attributes
xmlSearchNs ()
Search a Ns registered under a given name space for a document.
recurse on the parents until it finds the defined namespace
or return NULL otherwise.
nameSpace can be NULL, this is a search for the default namespace.
xmlSearchNsByHref ()
Search a Ns aliasing a given URI. Recurse on the parents until it finds
the defined namespace or return NULL otherwise.
xmlGetNsList ()
Search all the namespace applying to a given element.
xmlSetNs ()
Associate a namespace to a node, a posteriori.
xmlCopyNamespace ()
Do a copy of the namespace.
xmlCopyNamespaceList ()
Do a copy of an namespace list.
xmlSetProp ()
Set (or reset) an attribute carried by a node.
xmlGetProp ()
Search and get the value of an attribute associated to a node
This does the entity substitution.
This function looks in DTD attribute declaration for FIXED or
default declaration values unless DTD use has been turned off.
xmlGetNsProp ()
Search and get the value of an attribute associated to a node
This attribute has to be anchored in the namespace specified.
This does the entity substitution.
This function looks in DTD attribute declaration for FIXED or
default declaration values unless DTD use has been turned off.
xmlStringGetNodeList ()
Parse the value string and build the node list associated. Should
produce a flat tree with only TEXTs and ENTITY_REFs.
xmlStringLenGetNodeList ()
Parse the value string and build the node list associated. Should
produce a flat tree with only TEXTs and ENTITY_REFs.
xmlNodeListGetString ()
Returns the string equivalent to the text contained in the Node list
made of TEXTs and ENTITY_REFs
xmlNodeSetContent ()
Replace the content of a node.
xmlNodeSetContentLen ()
Replace the content of a node.
xmlNodeAddContent ()
Append the extra substring to the node content.
xmlNodeAddContentLen ()
Append the extra substring to the node content.
xmlNodeGetContent ()
Read the value of a node, this can be either the text carried
directly by this node if it's a TEXT node or the aggregate string
of the values carried by this node child's (TEXT and ENTITY_REF).
Entity references are substitued.
xmlNodeGetLang ()
Searches the language of a node, i.e. the values of the xml:lang
attribute or the one carried by the nearest ancestor.
xmlNodeSetLang ()
Set the language of a node, i.e. the values of the xml:lang
attribute.
xmlNodeGetBase ()
Searches for the BASE URL. The code should work on both XML
and HTML document even if base mechanisms are completely different.
xmlBufferWriteCHAR ()
routine which manage and grows an output buffer. This one add
xmlChars at the end of the buffer.
xmlBufferWriteChar ()
void xmlBufferWriteChar (xmlBufferPtr buf,
const char *string); |
routine which manage and grows an output buffer. This one add
C chars at the end of the array.
xmlBufferWriteQuotedString ()
routine which manage and grows an output buffer. This one writes
a quoted or double quoted xmlChar string, checking first if it holds
quote or double-quotes internally
xmlDocDumpMemory ()
Dump an XML document in memory and return the xmlChar * and it's size.
It's up to the caller to free the memory.
xmlDocDump ()
Dump an XML document to an open FILE.
xmlElemDump ()
Dump an XML/HTML node, recursive behaviour,children are printed too.
xmlSaveFile ()
int xmlSaveFile (const char *filename,
xmlDocPtr cur); |
Dump an XML document to a file. Will use compression if
compiled in and enabled. If filename is "-" the stdout file is
used.
xmlGetDocCompressMode ()
get the compression ratio for a document, ZLIB based
xmlSetDocCompressMode ()
void xmlSetDocCompressMode (xmlDocPtr doc,
int mode); |
set the compression ratio for a document, ZLIB based
Correct values: 0 (uncompressed) to 9 (max compression)
xmlGetCompressMode ()
int xmlGetCompressMode (void); |
get the default compression mode used, ZLIB based.
xmlSetCompressMode ()
void xmlSetCompressMode (int mode); |
set the default compression mode used, ZLIB based
Correct values: 0 (uncompressed) to 9 (max compression)