libxml2_tree.h File Reference

Typedef xmlParserInputBuffer

typedef struct _xmlParserInputBufferxmlParserInputBuffer

Typedef xmlParserInputBufferPtr

typedef xmlParserInputBuffer *xmlParserInputBufferPtr

Typedef xmlOutputBuffer

typedef struct _xmlOutputBufferxmlOutputBuffer

Typedef xmlOutputBufferPtr

typedef xmlOutputBuffer *xmlOutputBufferPtr

Typedef xmlParserCtxt

typedef struct _xmlParserCtxtxmlParserCtxt

Typedef xmlParserCtxtPtr

typedef xmlParserCtxt *xmlParserCtxtPtr

Typedef xmlSAXLocator

typedef struct _xmlSAXLocatorxmlSAXLocator

Typedef xmlSAXLocatorPtr

typedef xmlSAXLocator *xmlSAXLocatorPtr

Typedef xmlSAXHandler

typedef struct _xmlSAXHandlerxmlSAXHandler

Typedef xmlSAXHandlerPtr

typedef xmlSAXHandler *xmlSAXHandlerPtr

Typedef xmlEntity

typedef struct _xmlEntityxmlEntity

Typedef xmlEntityPtr

typedef xmlEntity *xmlEntityPtr

BASE_BUFFER_SIZE

BASE_BUFFER_SIZE:

default buffer size 4000.

XML_XML_NAMESPACE

XML_XML_NAMESPACE:

This is the namespace for the special xml: prefix predefined in the XML Namespace specification.

XML_XML_ID

XML_XML_ID:

This is the name for the special xml:id attribute

Enum xmlElementType

Typedef xmlNotation

typedef struct _xmlNotationxmlNotation

xmlNotation:

A DTD Notation definition.

Typedef xmlNotationPtr

typedef xmlNotation *xmlNotationPtr

Enum xmlAttributeDefault

xmlAttributeDefault:

A DTD Attribute default definition.

Typedef xmlEnumeration

typedef struct _xmlEnumerationxmlEnumeration

xmlEnumeration:

List structure used when there is an enumeration in DTDs.

Typedef xmlEnumerationPtr

typedef xmlEnumeration *xmlEnumerationPtr

Typedef xmlAttribute

typedef struct _xmlAttributexmlAttribute

xmlAttribute:

An Attribute declaration in a DTD.

Typedef xmlAttributePtr

typedef xmlAttribute *xmlAttributePtr

Enum xmlElementContentType

xmlElementContentType:

Possible definitions of element content types.

Enum xmlElementContentOccur

xmlElementContentOccur:

Possible definitions of element content occurrences.

Typedef xmlElementContent

typedef struct _xmlElementContentxmlElementContent

xmlElementContent:

An XML Element content as stored after parsing an element definition in a DTD.

Typedef xmlElementContentPtr

typedef xmlElementContent *xmlElementContentPtr

Enum xmlElementTypeVal

xmlElementTypeVal:

The different possibilities for an element content type.

Typedef xmlElement

typedef struct _xmlElementxmlElement

xmlElement:

An XML Element declaration from a DTD.

Typedef xmlElementPtr

typedef xmlElement *xmlElementPtr

XML_LOCAL_NAMESPACE

XML_LOCAL_NAMESPACE:

A namespace declaration node.

Typedef xmlNsType

typedef xmlElementType xmlNsType

Typedef xmlNs

typedef struct _xmlNsxmlNs

xmlNs:

An XML namespace. Note that prefix == NULL is valid, it defines the default namespace within the subtree (until overridden).

xmlNsType is unified with xmlElementType.

Typedef xmlNsPtr

typedef xmlNs *xmlNsPtr

Typedef xmlDtd

typedef struct _xmlDtdxmlDtd

xmlDtd:

An XML DTD, as defined by <!DOCTYPE ... There is actually one for the internal subset and for the external subset.

Typedef xmlDtdPtr

typedef xmlDtd *xmlDtdPtr

Typedef xmlAttr

typedef struct _xmlAttrxmlAttr

xmlAttr:

An attribute on an XML node.

Typedef xmlAttrPtr

typedef xmlAttr *xmlAttrPtr

Typedef xmlID

typedef struct _xmlIDxmlID

xmlID:

An XML ID instance.

Typedef xmlIDPtr

typedef xmlID *xmlIDPtr

Typedef xmlRef

typedef struct _xmlRefxmlRef

xmlRef:

An XML IDREF instance.

Typedef xmlRefPtr

typedef xmlRef *xmlRefPtr

Enum xmlBufferAllocationScheme

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.

Typedef xmlBuffer

typedef struct _xmlBufferxmlBuffer

xmlBuffer:

A buffer structure.

Typedef xmlBufferPtr

typedef xmlBuffer *xmlBufferPtr

Typedef xmlNode

typedef struct _xmlNodexmlNode

xmlNode:

A node in an XML tree.

Note: Text nodes are also used to store binary data in the tree. 'content' field is used to store a pointer to binary data 'properties' field is used to store int length of the data

Typedef xmlNodePtr

typedef xmlNode *xmlNodePtr

XML_GET_CONTENT

XML_GET_CONTENT:

Macro to extract the content pointer of a node.

Typedef xmlDoc

typedef struct _xmlDocxmlDoc

xmlDoc:

An XML document.

Typedef xmlDocPtr

typedef xmlDoc *xmlDocPtr

xmlValidateNCName ( const xmlChar *, int )

XMLPUBFUN int XMLCALLxmlValidateNCName(const xmlChar *value,
intspace
)

xmlValidateQName ( const xmlChar *, int )

XMLPUBFUN int XMLCALLxmlValidateQName(const xmlChar *value,
intspace
)

xmlValidateName ( const xmlChar *, int )

XMLPUBFUN int XMLCALLxmlValidateName(const xmlChar *value,
intspace
)

xmlValidateNMToken ( const xmlChar *, int )

XMLPUBFUN int XMLCALLxmlValidateNMToken(const xmlChar *value,
intspace
)

xmlBuildQName ( const xmlChar *, const xmlChar *, xmlChar *, int )

XMLPUBFUN xmlChar *XMLCALLxmlBuildQName(const xmlChar *ncname,
const xmlChar *prefix,
xmlChar *memory,
intlen
)

xmlBuildQName: Builds the QName prefix:ncname in memory if there is enough space and prefix is not NULL nor empty, otherwise allocate a new string. If prefix is NULL or empty it returns ncname.

Returns the new string which must be freed by the caller if different from memory and ncname or NULL in case of error

OOM: possible --> returns NULL, OOM flag is set

Parameters
ncnamethe Name
prefixthe prefix
memorypreallocated memory
lenpreallocated memory length

xmlSplitQName2 ( const xmlChar *, xmlChar ** )

XMLPUBFUN xmlChar *XMLCALLxmlSplitQName2(const xmlChar *name,
xmlChar **prefix
)

xmlSplitQName2: parse an XML qualified name string

[NS 5] QName ::= (Prefix ':')? LocalPart

[NS 6] Prefix ::= NCName

[NS 7] LocalPart ::= NCName

Returns NULL if not a QName, otherwise the local part, and prefix is updated to get the Prefix if any.

OOM: possible --> when returns NULL and OOM flag is set

Parameters
namethe full QName
prefixa xmlChar **

xmlSplitQName3 ( const xmlChar *, int * )

XMLPUBFUN const xmlChar *XMLCALLxmlSplitQName3(const xmlChar *name,
int *len
)

xmlSplitQName3: parse an XML qualified name string,i

returns NULL if it is not a Qualified Name, otherwise, update len with the lenght in byte of the prefix and return a pointer

Parameters
namethe full QName
lenan int *

xmlSetBufferAllocationScheme ( xmlBufferAllocationScheme )

XMLPUBFUN void XMLCALLxmlSetBufferAllocationScheme(xmlBufferAllocationSchemescheme)

xmlSetBufferAllocationScheme: Set the buffer allocation method. Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance

Parameters
schemeallocation method to use

xmlGetBufferAllocationScheme ( void )

XMLPUBFUN xmlBufferAllocationScheme XMLCALLxmlGetBufferAllocationScheme(void)

xmlGetBufferAllocationScheme:

Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance

Returns the current allocation scheme

xmlBufferCreate ( void )

XMLPUBFUN xmlBufferPtr XMLCALLxmlBufferCreate(void)

xmlBufferCreate:

routine to create an XML buffer. returns the new structure.

OOM: possible --> NULL is returned and OOM flag is set

xmlBufferCreateSize ( size_t )

XMLPUBFUN xmlBufferPtr XMLCALLxmlBufferCreateSize(size_tsize)

xmlBufferCreateSize: routine to create an XML buffer. returns the new structure.

OOM: possible --> NULL is returned && OOM flag is set

Parameters
sizeinitial size of buffer

xmlBufferCreateStatic ( void *, size_t )

XMLPUBFUN xmlBufferPtr XMLCALLxmlBufferCreateStatic(void *mem,
size_tsize
)

xmlBufferCreateStatic: routine to create an XML buffer from an immutable memory area. The area won't be modified nor copied, and is expected to be present until the end of the buffer lifetime.

returns the new structure.

Parameters
memthe memory area
sizethe size in byte

xmlBufferResize ( xmlBufferPtr, unsigned int )

XMLPUBFUN int XMLCALLxmlBufferResize(xmlBufferPtrbuf,
unsigned intsize
)

xmlBufferResize: Resize a buffer to accommodate minimum size of size.

Returns 0 in case of problems, 1 otherwise

OOM: possible --> OOM flag is set && returns 0

Parameters
bufthe buffer to resize
sizethe desired size

xmlBufferFree ( xmlBufferPtr )

XMLPUBFUN void XMLCALLxmlBufferFree(xmlBufferPtrbuf)

xmlBufferFree: Frees an XML buffer. It frees both the content and the structure which encapsulate it.

OOM: never

Parameters
bufthe buffer to free

xmlBufferDump ( FILE *, xmlBufferPtr )

XMLPUBFUN int XMLCALLxmlBufferDump(FILE *file,
xmlBufferPtrbuf
)

xmlBufferDump: Dumps an XML buffer to a FILE *. Returns the number of xmlChar written

Parameters
filethe file output
bufthe buffer to dump

xmlBufferAdd ( xmlBufferPtr, const xmlChar *, int )

XMLPUBFUN void XMLCALLxmlBufferAdd(xmlBufferPtrbuf,
const xmlChar *str,
intlen
)

xmlBufferAdd: Add a string range to an XML buffer. if len == -1, the length of str is recomputed.

OOM: possible --> check OOM flag

Parameters
bufthe buffer to dump
strthe xmlChar string
lenthe number of xmlChar to add

xmlBufferAddHead ( xmlBufferPtr, const xmlChar *, int )

XMLPUBFUN void XMLCALLxmlBufferAddHead(xmlBufferPtrbuf,
const xmlChar *str,
intlen
)

xmlBufferAddHead: Add a string range to the beginning of an XML buffer. if len == -1, the length of str is recomputed.

OOM: possible --> OOM flag is set

Parameters
bufthe buffer
strthe xmlChar string
lenthe number of xmlChar to add

xmlBufferCat ( xmlBufferPtr, const xmlChar * )

XMLPUBFUN void XMLCALLxmlBufferCat(xmlBufferPtrbuf,
const xmlChar *str
)

xmlBufferCat: Append a zero terminated string to an XML buffer.

OOM: possible / NOT REVIEWED

Parameters
bufthe buffer to dump
strthe xmlChar string

xmlBufferCCat ( xmlBufferPtr, const char * )

XMLPUBFUN void XMLCALLxmlBufferCCat(xmlBufferPtrbuf,
const char *str
)

xmlBufferCCat: Append a zero terminated C string to an XML buffer.

Parameters
bufthe buffer to dump
strthe C char string

xmlBufferShrink ( xmlBufferPtr, unsigned int )

XMLPUBFUN int XMLCALLxmlBufferShrink(xmlBufferPtrbuf,
unsigned intlen
)

xmlBufferShrink: Remove the beginning of an XML buffer.

Returns the number of xmlChar removed, or -1 in case of failure.

OOM: never

Parameters
bufthe buffer to dump
lenthe number of xmlChar to remove

xmlBufferGrow ( xmlBufferPtr, unsigned int )

XMLPUBFUN int XMLCALLxmlBufferGrow(xmlBufferPtrbuf,
unsigned intlen
)

xmlBufferGrow: Grow the available space of an XML buffer.

Returns the new available space or -1 in case of error

OOM: possible --> returns -1 && sets OOM flag

Parameters
bufthe buffer
lenthe minimum free size to allocate

xmlBufferEmpty ( xmlBufferPtr )

XMLPUBFUN void XMLCALLxmlBufferEmpty(xmlBufferPtrbuf)

xmlBufferEmpty: empty a buffer.

Parameters
bufthe buffer

xmlBufferSetAllocationScheme ( xmlBufferPtr, xmlBufferAllocationScheme )

XMLPUBFUN void XMLCALLxmlBufferSetAllocationScheme(xmlBufferPtrbuf,
xmlBufferAllocationSchemescheme
)

xmlBufferSetAllocationScheme: Sets the allocation scheme for this buffer

Parameters
bufthe buffer to tune
schemeallocation scheme to use

xmlBufferLength ( const xmlBufferPtr )

XMLPUBFUN int XMLCALLxmlBufferLength(const xmlBufferPtrbuf)

xmlBufferContent: Function to extract the content of a buffer

Returns the internal content xmlBufferLength: Function to get the length of a buffer

Returns the length of data in the internal content

Parameters
bufthe buffer

xmlBufferContent

xmlBufferContent: Function to extract the content of a buffer

Returns the internal content

xmlCreateIntSubset ( xmlDocPtr, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlDtdPtr XMLCALLxmlCreateIntSubset(xmlDocPtrdoc,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID
)

xmlCreateIntSubset: Create the internal subset of a document Returns a pointer to the new DTD structure

Parameters
docthe document pointer
namethe DTD name
ExternalIDthe external (PUBLIC) ID
SystemIDthe system ID

xmlNewDtd ( xmlDocPtr, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlDtdPtr XMLCALLxmlNewDtd(xmlDocPtrdoc,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID
)

xmlNewDtd: Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset().

Returns a pointer to the new DTD structure

OOM: possible --> if returns NULL, OOM flag is set too

Parameters
docthe document pointer
namethe DTD name
ExternalIDthe external ID
SystemIDthe system ID

xmlGetIntSubset ( xmlDocPtr )

XMLPUBFUN xmlDtdPtr XMLCALLxmlGetIntSubset(xmlDocPtrdoc)

xmlGetIntSubset: Get the internal subset of a document Returns a pointer to the DTD structure or NULL if not found

Parameters
docthe document pointer

xmlFreeDtd ( xmlDtdPtr )

XMLPUBFUN void XMLCALLxmlFreeDtd(xmlDtdPtrcur)

xmlFreeDtd: Free a DTD structure.

Parameters
curthe DTD structure to free up

xmlNewGlobalNs ( xmlDocPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNsPtr XMLCALLxmlNewGlobalNs(xmlDocPtrdoc,
const xmlChar *href,
const xmlChar *prefix
)

xmlNewNs ( xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNsPtr XMLCALLxmlNewNs(xmlNodePtrnode,
const xmlChar *href,
const xmlChar *prefix
)

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. We use href==NULL in the case of an element creation where the namespace was not defined. Returns a new namespace pointer or NULL

OOM: possible --> sets OOM flag and returns NULL Check OOM flag always! (NULL may be if node!=NULL && prefix is already bound)

xmlFreeNs ( xmlNsPtr )

XMLPUBFUN void XMLCALLxmlFreeNs(xmlNsPtrcur)

xmlFreeNs: Free up the structures associated to a namespace

OOM: never Precondition: cur is not NULL

Parameters
curthe namespace pointer

xmlFreeNsList ( xmlNsPtr )

XMLPUBFUN void XMLCALLxmlFreeNsList(xmlNsPtrcur)

xmlFreeNsList: Free up all the structures associated to the chained namespaces.

OOM: never

Parameters
curthe first namespace pointer

xmlNewDoc ( const xmlChar * )

XMLPUBFUN xmlDocPtr XMLCALLxmlNewDoc(const xmlChar *version)

xmlNewDoc: Creates a new XML document

Returns a new document

OOM: possible --> returns NULL, OOM flag is set

Parameters
versionxmlChar string giving the version of XML "1.0"

xmlFreeDoc ( xmlDocPtr )

XMLPUBFUN void XMLCALLxmlFreeDoc(xmlDocPtrcur)

xmlFreeDoc: Free up all the structures used by a document, tree included.

Parameters
curpointer to the document

xmlNewDocProp ( xmlDocPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlNewDocProp(xmlDocPtrdoc,
const xmlChar *name,
const xmlChar *value
)

xmlNewDocProp: Create a new property carried by a document. Returns a pointer to the attribute

OOM: possible -> NULL is returned for name!=NULL, OOM flag is set

Parameters
docthe document
namethe name of the attribute
valuethe value of the attribute

xmlNewProp ( xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlNewProp(xmlNodePtrnode,
const xmlChar *name,
const xmlChar *value
)

xmlNewNsProp ( xmlNodePtr, xmlNsPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlNewNsProp(xmlNodePtrnode,
xmlNsPtrns,
const xmlChar *name,
const xmlChar *value
)

xmlNewNsProp: Create a new property tagged with a namespace and carried by a node. Returns a pointer to the attribute

Parameters
nodethe holding node
nsthe namespace
namethe name of the attribute
valuethe value of the attribute

xmlNewNsPropEatName ( xmlNodePtr, xmlNsPtr, xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlNewNsPropEatName(xmlNodePtrnode,
xmlNsPtrns,
xmlChar *name,
const xmlChar *value
)

xmlNewNsPropEatName: Create a new property tagged with a namespace and carried by a node. Returns a pointer to the attribute

Parameters
nodethe holding node
nsthe namespace
namethe name of the attribute
valuethe value of the attribute

xmlFreePropList ( xmlAttrPtr )

XMLPUBFUN void XMLCALLxmlFreePropList(xmlAttrPtrcur)

xmlFreePropList: Free a property and all its siblings, all the children are freed too.

Parameters
curthe first property in the list

xmlFreeProp ( xmlAttrPtr )

XMLPUBFUN void XMLCALLxmlFreeProp(xmlAttrPtrcur)

xmlFreeProp: Free one attribute, all the content is freed too

OOM: never

Parameters
curan attribute

xmlCopyProp ( xmlNodePtr, xmlAttrPtr )

XMLPUBFUN xmlAttrPtr XMLCALLxmlCopyProp(xmlNodePtrtarget,
xmlAttrPtrcur
)

xmlCopyProp: Do a copy of the attribute.

Returns: a new xmlAttrPtr, or NULL in case of error.

OOM: possible --> NULL is returned for cur!=NULL, OOM flag is set

Parameters
targetthe element where the attribute will be grafted
curthe attribute

xmlCopyPropList ( xmlNodePtr, xmlAttrPtr )

XMLPUBFUN xmlAttrPtr XMLCALLxmlCopyPropList(xmlNodePtrtarget,
xmlAttrPtrcur
)

xmlCopyPropList: Do a copy of an attribute list.

Returns: a new xmlAttrPtr, or NULL in case of error.

OOM: possible --> returns NULL for cur!=NULL, sets OOM flag

Parameters
targetthe element where the attributes will be grafted
curthe first attribute

xmlNewDocNode ( xmlDocPtr, xmlNsPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocNode(xmlDocPtrdoc,
xmlNsPtrns,
const xmlChar *name,
const xmlChar *content
)

xmlNewDocNode: Creation of a new node element within a document. ns and content are optional (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.

Returns a pointer to the new node object.

Parameters
docthe document
nsnamespace if any
namethe node name
contentthe XML text content if any

xmlNewDocNodeEatName ( xmlDocPtr, xmlNsPtr, xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocNodeEatName(xmlDocPtrdoc,
xmlNsPtrns,
xmlChar *name,
const xmlChar *content
)

xmlNewDocNodeEatName: Creation of a new node element within a document. ns and content are optional (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.

Returns a pointer to the new node object.

Parameters
docthe document
nsnamespace if any
namethe node name
contentthe XML text content if any

xmlNewDocRawNode ( xmlDocPtr, xmlNsPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocRawNode(xmlDocPtrdoc,
xmlNsPtrns,
const xmlChar *name,
const xmlChar *content
)

xmlNewNode ( xmlNsPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewNode(xmlNsPtrns,
const xmlChar *name
)

xmlNewNode: Creation of a new node element. ns is optional (NULL).

Returns a pointer to the new node object. Uses xmlStrdup() to make copy of name.

Parameters
nsnamespace if any
namethe node name

xmlNewNodeEatName ( xmlNsPtr, xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewNodeEatName(xmlNsPtrns,
xmlChar *name
)

xmlNewNodeEatName: Creation of a new node element. ns is optional (NULL).

Returns a pointer to the new node object, with pointer name as new node's name. Use xmlNewNode() if a copy of name string is is needed as new node's name.

Parameters
nsnamespace if any
namethe node name

xmlNewChild ( xmlNodePtr, xmlNsPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewChild(xmlNodePtrparent,
xmlNsPtrns,
const xmlChar *name,
const xmlChar *content
)

xmlNewTextChild ( xmlNodePtr, xmlNsPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewTextChild(xmlNodePtrparent,
xmlNsPtrns,
const xmlChar *name,
const xmlChar *content
)

xmlNewDocText ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocText(xmlDocPtrdoc,
const xmlChar *content
)

xmlNewDocText: Creation of a new text node within a document. Returns a pointer to the new node object.

OOM: possible --> returns NULL and sets OOM flag

Parameters
docthe document
contentthe text content

xmlNewText ( const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewText(const xmlChar *content)

xmlNewText: Creation of a new text node. Returns a pointer to the new node object.

OOM: possible --> returns NULL and sets OOM flag

Parameters
contentthe text content

xmlNewPI ( const xmlChar *, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewPI(const xmlChar *name,
const xmlChar *content
)

xmlNewPI: Creation of a processing instruction element. Returns a pointer to the new node object.

OOM: possible --> returns NULL for name!=NULL; OOM flag is set

Parameters
namethe processing instruction name
contentthe PI content

xmlNewDocTextLen ( xmlDocPtr, const xmlChar *, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocTextLen(xmlDocPtrdoc,
const xmlChar *content,
intlen
)

xmlNewDocTextLen: Creation of a new text node with an extra content length parameter. The text node pertain to a given document. Returns a pointer to the new node object.

OOM: possible --> returns NULL and sets OOM flag

Parameters
docthe document
contentthe text content
lenthe text len.

xmlNewTextLen ( const xmlChar *, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewTextLen(const xmlChar *content,
intlen
)

xmlNewTextLen: Creation of a new text node with an extra parameter for the content's length Returns a pointer to the new node object.

OOM: possible --> returns NULL, sets OOM flag

Parameters
contentthe text content
lenthe text len.

xmlNewDocComment ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewDocComment(xmlDocPtrdoc,
const xmlChar *content
)

xmlNewDocComment: Creation of a new node containing a comment within a document. Returns a pointer to the new node object.

Parameters
docthe document
contentthe comment content

xmlNewComment ( const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewComment(const xmlChar *content)

xmlNewComment: Creation of a new node containing a comment. Returns a pointer to the new node object.

OOM: possible --> returns NULL; OOM flag is set

Parameters
contentthe comment content

xmlNewCDataBlock ( xmlDocPtr, const xmlChar *, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewCDataBlock(xmlDocPtrdoc,
const xmlChar *content,
intlen
)

xmlNewCDataBlock: Creation of a new node containing a CDATA block. Returns a pointer to the new node object.

OOM: possible --> returns NULL; sets OOM flag

Parameters
docthe document
contentthe CDATA block content content
lenthe length of the block

xmlNewCharRef ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewCharRef(xmlDocPtrdoc,
const xmlChar *name
)

xmlNewCharRef: Creation of a new character reference node. Returns a pointer to the new node object.

Parameters
docthe document
namethe char ref string, starting with # or "&# ... ;"

xmlNewReference ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlNewReference(xmlDocPtrdoc,
const xmlChar *name
)

xmlNewReference: Creation of a new reference node. Returns a pointer to the new node object.

OOM: returns NULL, sets OOM flag

Parameters
docthe document
namethe reference name, or the reference string with & and ;

xmlCopyNode ( const xmlNodePtr, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlCopyNode(const xmlNodePtrnode,
intrecursive
)

xmlCopyNode: Do a copy of the node.

Returns: a new xmlNodePtr, or NULL in case of error.

OOM: possible --> OOM flag should be checked

Parameters
nodethe node
recursiveif 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)

xmlDocCopyNode ( const xmlNodePtr, xmlDocPtr, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlDocCopyNode(const xmlNodePtrnode,
xmlDocPtrdoc,
intrecursive
)

xmlDocCopyNode: Do a copy of the node to a given document.

Returns: a new xmlNodePtr, or NULL in case of error.

OOM: possible --> OOM flag should be checked

Parameters
nodethe node
docthe document
recursiveif 1 - do a recursive copy (properties, namespaces and children when applicable) if 2 - copy properties and namespaces (when applicable)

xmlCopyNodeList ( const xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlCopyNodeList(const xmlNodePtrnode)

xmlCopyNodeList: Do a recursive copy of the node list.

Returns: a new xmlNodePtr, or NULL in case of error.

Parameters
nodethe first node in the list.

xmlDocGetRootElement ( xmlDocPtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlDocGetRootElement(xmlDocPtrdoc)

xmlDocGetRootElement: Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).

Returns the xmlNodePtr for the root or NULL

Parameters
docthe document

xmlGetLastChild ( xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlGetLastChild(xmlNodePtrparent)

xmlGetLastChild: Search the last child of a node. Returns the last child or NULL if none.

Parameters
parentthe parent node

xmlNodeIsText ( xmlNodePtr )

XMLPUBFUN int XMLCALLxmlNodeIsText(xmlNodePtrnode)

xmlNodeIsText: Is this node a Text node ? Returns 1 yes, 0 no

Parameters
nodethe node

xmlIsBlankNode ( xmlNodePtr )

XMLPUBFUN int XMLCALLxmlIsBlankNode(xmlNodePtrnode)

xmlIsBlankNode: Checks whether this node is an empty or whitespace only (and possibly ignorable) text-node.

Returns 1 yes, 0 no

Parameters
nodethe node

xmlAddChild ( xmlNodePtr, xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlAddChild(xmlNodePtrparent,
xmlNodePtrcur
)

xmlAddChild: Add a new node to parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case cur is freed) If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed.

Returns the child or NULL in case of error.

OOM: possible --> OOM flag is set, NULL is returned if OOM then 'cur' never freed

Parameters
parentthe parent node
curthe child node

xmlAddChildList ( xmlNodePtr, xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlAddChildList(xmlNodePtrparent,
xmlNodePtrcur
)

xmlAddChildList: Add a list of node at the end of the child list of the parent merging adjacent TEXT nodes (cur may be freed)

Returns the last child or NULL in case of error.

Parameters
parentthe parent node
curthe first node in the list

xmlAddSibling ( xmlNodePtr, xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlAddSibling(xmlNodePtrcur,
xmlNodePtrelem
)

xmlAddSibling: Add a new element elem to the list of siblings of cur merging adjacent TEXT nodes (elem may be freed) If the new element was already inserted in a document it is first unlinked from its existing context.

Returns the new element or NULL in case of error.

Parameters
curthe child node
elemthe new node

xmlAddNextSibling ( xmlNodePtr, xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlAddNextSibling(xmlNodePtrcur,
xmlNodePtrelem
)

xmlAddNextSibling: Add a new node elem as the next sibling of cur If the new node was already inserted in a document it is first unlinked from its existing context. As a result of text merging elem may be freed. If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed.

Returns the new node or NULL in case of error.

OOM: possible --> sets OOM flag, returns NULL elem is not freed in OOM

Parameters
curthe child node
elemthe new node

xmlUnlinkNode ( xmlNodePtr )

XMLPUBFUN void XMLCALLxmlUnlinkNode(xmlNodePtrcur)

xmlUnlinkNode: Unlink a node from it's current context, the node is not freed

OOM: never

Parameters
curthe node

xmlTextMerge ( xmlNodePtr, xmlNodePtr )

XMLPUBFUN xmlNodePtr XMLCALLxmlTextMerge(xmlNodePtrfirst,
xmlNodePtrsecond
)

xmlTextMerge: Merge two text nodes into one Returns the first text node augmented

OOM: possible --> OOM flag is set, returns NULL

Parameters
firstthe first text node
secondthe second text node being merged

xmlTextConcat ( xmlNodePtr, const xmlChar *, int )

XMLPUBFUN int XMLCALLxmlTextConcat(xmlNodePtrnode,
const xmlChar *content,
intlen
)

xmlTextConcat: Concat the given string at the end of the existing node content

Returns -1 in case of error, 0 otherwise

Parameters
nodethe node
contentthe content
lencontent length

xmlFreeNodeList ( xmlNodePtr )

XMLPUBFUN void XMLCALLxmlFreeNodeList(xmlNodePtrcur)

xmlFreeNodeList: Free a node and all its siblings, this is a recursive behaviour, all the children are freed too.

OOM: never

Parameters
curthe first node in the list

xmlFreeNode ( xmlNodePtr )

XMLPUBFUN void XMLCALLxmlFreeNode(xmlNodePtrcur)

xmlFreeNode: Free a node, this is a recursive behaviour, all the children are freed too. This doesn't unlink the child from the list, use xmlUnlinkNode() first.

OOM: never

Parameters
curthe node

xmlSetTreeDoc ( xmlNodePtr, xmlDocPtr )

XMLPUBFUN void XMLCALLxmlSetTreeDoc(xmlNodePtrtree,
xmlDocPtrdoc
)

xmlSetTreeDoc: update all nodes under the tree to point to the right document

Parameters
treethe top element
docthe document

xmlSetListDoc ( xmlNodePtr, xmlDocPtr )

XMLPUBFUN void XMLCALLxmlSetListDoc(xmlNodePtrlist,
xmlDocPtrdoc
)

xmlSetListDoc: update all nodes in the list to point to the right document

OOM: never

Parameters
listthe first element
docthe document

xmlSearchNs ( xmlDocPtr, xmlNodePtr, const xmlChar * )

XMLPUBFUN xmlNsPtr XMLCALLxmlSearchNs(xmlDocPtrdoc,
xmlNodePtrnode,
const xmlChar *nameSpace
)

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. nsPrefix can be NULL, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case.

Returns the namespace pointer or NULL.

OOM: possible only for "xml" prefix, when (!doc && node->type==XML_ELEMENT_NODE) || !doc->oldNs , NULL is returned then as if "NOT FOUND" result and OOM flag is set

Parameters
docthe document
nodethe current node
nameSpacethe namespace prefix

xmlSearchNsByHref ( xmlDocPtr, xmlNodePtr, const xmlChar * )

XMLPUBFUN xmlNsPtr XMLCALLxmlSearchNsByHref(xmlDocPtrdoc,
xmlNodePtrnode,
const xmlChar *href
)

xmlSearchNsByHref: Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return NULL otherwise. Returns the namespace pointer or NULL.

OOM: possible iif: href is XML_XML_NAMESPACE && (!doc && node->type == XML_ELEMENT_NODE) || !(doc->oldNs)) --> then OOM flag is set when it returns NULL, otherwise, OOM never happens

Parameters
docthe document
nodethe current node
hrefthe namespace value

xmlSetNs ( xmlNodePtr, xmlNsPtr )

XMLPUBFUN void XMLCALLxmlSetNs(xmlNodePtrnode,
xmlNsPtrns
)

xmlSetNs: Associate a namespace to a node, a posteriori.

Parameters
nodea node in the document
nsa namespace pointer

xmlCopyNamespace ( xmlNsPtr )

XMLPUBFUN xmlNsPtr XMLCALLxmlCopyNamespace(xmlNsPtrcur)

xmlCopyNamespace: Do a copy of the namespace.

Returns: a new xmlNsPtr, or NULL in case of error.

OOM: possible --> returns NULL and sets OOM

Parameters
curthe namespace

xmlCopyNamespaceList ( xmlNsPtr )

XMLPUBFUN xmlNsPtr XMLCALLxmlCopyNamespaceList(xmlNsPtrcur)

xmlCopyNamespaceList: Do a copy of an namespace list.

Returns: a new xmlNsPtr, or NULL in case of error.

OOM: possible --> if returns NULL for cur!=NULL (sets OOM flag too)

Parameters
curthe first namespace

xmlGetNoNsProp ( xmlNodePtr, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlGetNoNsProp(xmlNodePtrnode,
const xmlChar *name
)

xmlGetNoNsProp: 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. This function is similar to xmlGetProp except it will accept only an attribute in no namespace.

Returns the attribute value or NULL if not found. It's up to the caller to free the memory with xmlFree().

Parameters
nodethe node
namethe attribute name

xmlGetProp ( xmlNodePtr, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlGetProp(xmlNodePtrnode,
const xmlChar *name
)

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. NOTE: this function acts independently of namespaces associated to the attribute. Use xmlGetNsProp() or xmlGetNoNsProp() for namespace aware processing.

Returns the attribute value or NULL if not found. It's up to the caller to free the memory with xmlFree().

Parameters
nodethe node
namethe attribute name

xmlHasProp ( xmlNodePtr, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlHasProp(xmlNodePtrnode,
const xmlChar *name
)

xmlHasProp: Search an attribute associated to a node This function also looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off.

Returns the attribute or the attribute declaration or NULL if neither was found.

OOM: possible --> iif returns NULL and OOM flag is set

Parameters
nodethe node
namethe attribute name

xmlHasNsProp ( xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlAttrPtr XMLCALLxmlHasNsProp(xmlNodePtrnode,
const xmlChar *name,
const xmlChar *nameSpace
)

xmlHasNsProp: Search for 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.

Returns the attribute or the attribute declaration or NULL if neither was found.

OOM: possible --> iif returns NULL AND OOM flag is set

Parameters
nodethe node
namethe attribute name
nameSpacethe URI of the namespace

xmlGetNsProp ( xmlNodePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlGetNsProp(xmlNodePtrnode,
const xmlChar *name,
const xmlChar *nameSpace
)

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.

Returns the attribute value or NULL if not found. It's up to the caller to free the memory with xmlFree().

Parameters
nodethe node
namethe attribute name
nameSpacethe URI of the namespace

xmlStringGetNodeList ( xmlDocPtr, const xmlChar * )

XMLPUBFUN xmlNodePtr XMLCALLxmlStringGetNodeList(xmlDocPtrdoc,
const xmlChar *value
)

xmlStringGetNodeList: Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. Returns a pointer to the first child

OOM: possible --> iif returms NULL for value!=NULL and OOM flag is set

Parameters
docthe document
valuethe value of the attribute

xmlStringLenGetNodeList ( xmlDocPtr, const xmlChar *, int )

XMLPUBFUN xmlNodePtr XMLCALLxmlStringLenGetNodeList(xmlDocPtrdoc,
const xmlChar *value,
intlen
)

xmlStringLenGetNodeList: Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. Returns a pointer to the first child

Parameters
docthe document
valuethe value of the text
lenthe length of the string value

xmlNodeListGetString ( xmlDocPtr, xmlNodePtr, int )

XMLPUBFUN xmlChar *XMLCALLxmlNodeListGetString(xmlDocPtrdoc,
xmlNodePtrlist,
intinLine
)

xmlNodeListGetString: Build the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs

Returns a pointer to the string copy, the caller must free it with xmlFree().

OOM: global flag is set in OOM when NULL is returned --> flag should be checked

xmlNodeSetContent ( xmlNodePtr, const xmlChar * )

XMLPUBFUN void XMLCALLxmlNodeSetContent(xmlNodePtrcur,
const xmlChar *content
)

xmlNodeSetContent: Replace the content of a node.

OOM: possible --> sets OOM flag

Parameters
curthe node being modified
contentthe new value of the content

xmlNodeAddContent ( xmlNodePtr, const xmlChar * )

XMLPUBFUN void XMLCALLxmlNodeAddContent(xmlNodePtrcur,
const xmlChar *content
)

xmlNodeAddContent: Append the extra substring to the node content.

OOM: possible --> OOM flag is set

Parameters
curthe node being modified
contentextra content

xmlNodeAddContentLen ( xmlNodePtr, const xmlChar *, int )

XMLPUBFUN void XMLCALLxmlNodeAddContentLen(xmlNodePtrcur,
const xmlChar *content,
intlen
)

xmlNodeAddContentLen: Append the extra substring to the node content.

OOM: possible --> OOM flag is set

Parameters
curthe node being modified
contentextra content
lenthe size of content

xmlNodeGetContent ( xmlNodePtr )

XMLPUBFUN xmlChar *XMLCALLxmlNodeGetContent(xmlNodePtrcur)

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 substituted. Returns a new xmlChar* or NULL if no content is available. It's up to the caller to free the memory with xmlFree().

OOM: possible --> check OOM flag always // NOT REVIEWED COMPLETELY

Parameters
curthe node being read

xmlNodeBufGetContent ( xmlBufferPtr, xmlNodePtr )

XMLPUBFUN int XMLCALLxmlNodeBufGetContent(xmlBufferPtrbuffer,
xmlNodePtrcur
)

xmlNodeBufGetContent: Read the value of a node cur, 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 substituted. Fills up the buffer buffer with this value

Returns 0 in case of success and -1 in case of error.

OOM: possible / NOT REVIEWED

Parameters
buffera buffer
curthe node being read

xmlNodeGetLang ( xmlNodePtr )

XMLPUBFUN xmlChar *XMLCALLxmlNodeGetLang(xmlNodePtrcur)

xmlNodeGetLang: Searches the language of a node, i.e. the values of the xml:lang attribute or the one carried by the nearest ancestor.

Returns a pointer to the lang value, or NULL if not found It's up to the caller to free the memory with xmlFree().

Parameters
curthe node being checked

xmlNodeGetSpacePreserve ( xmlNodePtr )

XMLPUBFUN int XMLCALLxmlNodeGetSpacePreserve(xmlNodePtrcur)

xmlNodeGetSpacePreserve: Searches the space preserving behaviour of a node, i.e. the values of the xml:space attribute or the one carried by the nearest ancestor.

Returns -1 if xml:space is not inherited, 0 if "default", 1 if "preserve"

Parameters
curthe node being checked

xmlNodeGetBase ( xmlDocPtr, xmlNodePtr )

XMLPUBFUN xmlChar *XMLCALLxmlNodeGetBase(xmlDocPtrdoc,
xmlNodePtrcur
)

xmlNodeGetBase: Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it does not return the document base (5.1.3), use xmlDocumentGetBase() for this

Returns a pointer to the base URL, or NULL if not found It's up to the caller to free the memory with xmlFree().

OOM: possible --> check OOM flag // NOT REVIEWED

Parameters
docthe document the node pertains to
curthe node being checked

xmlBufferWriteCHAR ( xmlBufferPtr, const xmlChar * )

XMLPUBFUN void XMLCALLxmlBufferWriteCHAR(xmlBufferPtrbuf,
const xmlChar *string
)

xmlBufferWriteCHAR: routine which manages and grows an output buffer. This one adds xmlChars at the end of the buffer.

Parameters
bufthe XML buffer
stringthe string to add

xmlBufferWriteChar ( xmlBufferPtr, const char * )

XMLPUBFUN void XMLCALLxmlBufferWriteChar(xmlBufferPtrbuf,
const char *string
)

xmlBufferWriteChar: routine which manage and grows an output buffer. This one add C chars at the end of the array.

Parameters
bufthe XML buffer output
stringthe string to add

xmlBufferWriteQuotedString ( xmlBufferPtr, const xmlChar * )

XMLPUBFUN void XMLCALLxmlBufferWriteQuotedString(xmlBufferPtrbuf,
const xmlChar *string
)

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

Parameters
bufthe XML buffer output
stringthe string to add

xmlAttrSerializeTxtContent ( xmlBufferPtr, xmlDocPtr, xmlAttrPtr, const xmlChar * )

XMLPUBFUN voidxmlAttrSerializeTxtContent(xmlBufferPtrbuf,
xmlDocPtrdoc,
xmlAttrPtrattr,
const xmlChar *string
)

xmlReconciliateNs ( xmlDocPtr, xmlNodePtr )

XMLPUBFUN int XMLCALLxmlReconciliateNs(xmlDocPtrdoc,
xmlNodePtrtree
)

xmlIsXHTML ( const xmlChar *, const xmlChar * )

XMLPUBFUN int XMLCALLxmlIsXHTML(const xmlChar *systemID,
const xmlChar *publicID
)

xmlIsXHTML: Try to find if the document correspond to an XHTML DTD

Returns 1 if true, 0 if not and -1 in case of error

Parameters
systemIDthe system identifier
publicIDthe public identifier

xmlSetDocCompressMode ( xmlDocPtr, int )

XMLPUBFUN void XMLCALLxmlSetDocCompressMode(xmlDocPtrdoc,
intmode
)

xmlSetDocCompressMode: set the compression ratio for a document, ZLIB based Correct values: 0 (uncompressed) to 9 (max compression)

Parameters
docthe document
modethe compression ratio

xmlGetDocCompressMode ( xmlDocPtr )

XMLPUBFUN int XMLCALLxmlGetDocCompressMode(xmlDocPtrdoc)

xmlGetDocCompressMode: get the compression ratio for a document, ZLIB based Returns 0 (uncompressed) to 9 (max compression)

Parameters
docthe document

xmlGetCompressMode ( void )

XMLPUBFUN int XMLCALLxmlGetCompressMode(void)

xmlGetCompressMode:

get the default compression mode used, ZLIB based. Returns 0 (uncompressed) to 9 (max compression)

xmlSetCompressMode ( int )

XMLPUBFUN void XMLCALLxmlSetCompressMode(intmode)

xmlSetCompressMode: set the default compression mode used, ZLIB based Correct values: 0 (uncompressed) to 9 (max compression)

Parameters
modethe compression ratio