typedef struct _xmlParserInputBuffer | xmlParserInputBuffer |
typedef xmlParserInputBuffer * | xmlParserInputBufferPtr |
typedef struct _xmlOutputBuffer | xmlOutputBuffer |
typedef xmlOutputBuffer * | xmlOutputBufferPtr |
typedef struct _xmlParserCtxt | xmlParserCtxt |
typedef xmlParserCtxt * | xmlParserCtxtPtr |
typedef struct _xmlSAXLocator | xmlSAXLocator |
typedef xmlSAXLocator * | xmlSAXLocatorPtr |
typedef struct _xmlSAXHandler | xmlSAXHandler |
typedef xmlSAXHandler * | xmlSAXHandlerPtr |
typedef struct _xmlEntity | xmlEntity |
typedef xmlEntity * | xmlEntityPtr |
XML_XML_NAMESPACE:
This is the namespace for the special xml: prefix predefined in the XML Namespace specification.
typedef xmlNotation * | xmlNotationPtr |
xmlAttributeDefault:
A DTD Attribute default definition.
Enumerator | Value | Description |
---|---|---|
XML_ATTRIBUTE_NONE | 1 | |
XML_ATTRIBUTE_REQUIRED | ||
XML_ATTRIBUTE_IMPLIED | ||
XML_ATTRIBUTE_FIXED |
typedef struct _xmlEnumeration | xmlEnumeration |
xmlEnumeration:
List structure used when there is an enumeration in DTDs.
typedef xmlEnumeration * | xmlEnumerationPtr |
typedef struct _xmlAttribute | xmlAttribute |
xmlAttribute:
An Attribute declaration in a DTD.
typedef xmlAttribute * | xmlAttributePtr |
xmlElementContentType:
Possible definitions of element content types.
Enumerator | Value | Description |
---|---|---|
XML_ELEMENT_CONTENT_PCDATA | 1 | |
XML_ELEMENT_CONTENT_ELEMENT | ||
XML_ELEMENT_CONTENT_SEQ | ||
XML_ELEMENT_CONTENT_OR |
xmlElementContentOccur:
Possible definitions of element content occurrences.
Enumerator | Value | Description |
---|---|---|
XML_ELEMENT_CONTENT_ONCE | 1 | |
XML_ELEMENT_CONTENT_OPT | ||
XML_ELEMENT_CONTENT_MULT | ||
XML_ELEMENT_CONTENT_PLUS |
typedef struct _xmlElementContent | xmlElementContent |
xmlElementContent:
An XML Element content as stored after parsing an element definition in a DTD.
typedef xmlElementContent * | xmlElementContentPtr |
xmlElementTypeVal:
The different possibilities for an element content type.
Enumerator | Value | Description |
---|---|---|
XML_ELEMENT_TYPE_UNDEFINED | 0 | |
XML_ELEMENT_TYPE_EMPTY | 1 | |
XML_ELEMENT_TYPE_ANY | ||
XML_ELEMENT_TYPE_MIXED | ||
XML_ELEMENT_TYPE_ELEMENT |
typedef struct _xmlElement | xmlElement |
xmlElement:
An XML Element declaration from a DTD.
typedef xmlElement * | xmlElementPtr |
typedef xmlElementType | xmlNsType |
typedef struct _xmlNs | xmlNs |
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 xmlNs * | xmlNsPtr |
typedef struct _xmlDtd | xmlDtd |
xmlDtd:
An XML DTD, as defined by <!DOCTYPE ... There is actually one for the internal subset and for the external subset.
typedef xmlDtd * | xmlDtdPtr |
typedef xmlAttr * | xmlAttrPtr |
typedef xmlID * | xmlIDPtr |
typedef xmlRef * | xmlRefPtr |
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.
Enumerator | Value | Description |
---|---|---|
XML_BUFFER_ALLOC_DOUBLEIT | ||
XML_BUFFER_ALLOC_EXACT | ||
XML_BUFFER_ALLOC_IMMUTABLE |
typedef xmlBuffer * | xmlBufferPtr |
typedef struct _xmlNode | xmlNode |
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 xmlNode * | xmlNodePtr |
typedef xmlDoc * | xmlDocPtr |
XMLPUBFUN int XMLCALL | xmlValidateNCName | ( | const xmlChar * | value, |
int | space | |||
) |
XMLPUBFUN int XMLCALL | xmlValidateQName | ( | const xmlChar * | value, |
int | space | |||
) |
XMLPUBFUN int XMLCALL | xmlValidateName | ( | const xmlChar * | value, |
int | space | |||
) |
XMLPUBFUN int XMLCALL | xmlValidateNMToken | ( | const xmlChar * | value, |
int | space | |||
) |
XMLPUBFUN xmlChar *XMLCALL | xmlBuildQName | ( | const xmlChar * | ncname, |
const xmlChar * | prefix, | |||
xmlChar * | memory, | |||
int | len | |||
) |
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 | |
---|---|
ncname | the Name |
prefix | the prefix |
memory | preallocated memory |
len | preallocated memory length |
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 | |
---|---|
name | the full QName |
prefix | a xmlChar ** |
XMLPUBFUN void XMLCALL | xmlSetBufferAllocationScheme | ( | xmlBufferAllocationScheme | scheme | ) |
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 | |
---|---|
scheme | allocation method to use |
XMLPUBFUN xmlBufferAllocationScheme XMLCALL | xmlGetBufferAllocationScheme | ( | 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
XMLPUBFUN xmlBufferPtr XMLCALL | xmlBufferCreate | ( | void | ) |
xmlBufferCreate:
routine to create an XML buffer. returns the new structure.
OOM: possible --> NULL is returned and OOM flag is set
XMLPUBFUN xmlBufferPtr XMLCALL | xmlBufferCreateSize | ( | size_t | size | ) |
xmlBufferCreateSize: routine to create an XML buffer. returns the new structure.
OOM: possible --> NULL is returned && OOM flag is set
Parameters | |
---|---|
size | initial size of buffer |
XMLPUBFUN xmlBufferPtr XMLCALL | xmlBufferCreateStatic | ( | void * | mem, |
size_t | size | |||
) |
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 | |
---|---|
mem | the memory area |
size | the size in byte |
XMLPUBFUN int XMLCALL | xmlBufferResize | ( | xmlBufferPtr | buf, |
unsigned int | size | |||
) |
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 | |
---|---|
buf | the buffer to resize |
size | the desired size |
XMLPUBFUN void XMLCALL | xmlBufferFree | ( | xmlBufferPtr | buf | ) |
xmlBufferFree: Frees an XML buffer. It frees both the content and the structure which encapsulate it.
OOM: never
Parameters | |
---|---|
buf | the buffer to free |
XMLPUBFUN int XMLCALL | xmlBufferDump | ( | FILE * | file, |
xmlBufferPtr | buf | |||
) |
xmlBufferDump: Dumps an XML buffer to a FILE *. Returns the number of xmlChar written
Parameters | |
---|---|
file | the file output |
buf | the buffer to dump |
XMLPUBFUN void XMLCALL | xmlBufferAdd | ( | xmlBufferPtr | buf, |
const xmlChar * | str, | |||
int | len | |||
) |
xmlBufferAdd: Add a string range to an XML buffer. if len == -1, the length of str is recomputed.
OOM: possible --> check OOM flag
Parameters | |
---|---|
buf | the buffer to dump |
str | the xmlChar string |
len | the number of xmlChar to add |
XMLPUBFUN void XMLCALL | xmlBufferAddHead | ( | xmlBufferPtr | buf, |
const xmlChar * | str, | |||
int | len | |||
) |
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 | |
---|---|
buf | the buffer |
str | the xmlChar string |
len | the number of xmlChar to add |
XMLPUBFUN void XMLCALL | xmlBufferCat | ( | xmlBufferPtr | buf, |
const xmlChar * | str | |||
) |
xmlBufferCat: Append a zero terminated string to an XML buffer.
OOM: possible / NOT REVIEWED
Parameters | |
---|---|
buf | the buffer to dump |
str | the xmlChar string |
XMLPUBFUN void XMLCALL | xmlBufferCCat | ( | xmlBufferPtr | buf, |
const char * | str | |||
) |
xmlBufferCCat: Append a zero terminated C string to an XML buffer.
Parameters | |
---|---|
buf | the buffer to dump |
str | the C char string |
XMLPUBFUN int XMLCALL | xmlBufferShrink | ( | xmlBufferPtr | buf, |
unsigned int | len | |||
) |
xmlBufferShrink: Remove the beginning of an XML buffer.
Returns the number of xmlChar removed, or -1 in case of failure.
OOM: never
Parameters | |
---|---|
buf | the buffer to dump |
len | the number of xmlChar to remove |
XMLPUBFUN int XMLCALL | xmlBufferGrow | ( | xmlBufferPtr | buf, |
unsigned int | len | |||
) |
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 | |
---|---|
buf | the buffer |
len | the minimum free size to allocate |
XMLPUBFUN void XMLCALL | xmlBufferEmpty | ( | xmlBufferPtr | buf | ) |
xmlBufferEmpty: empty a buffer.
Parameters | |
---|---|
buf | the buffer |
XMLPUBFUN void XMLCALL | xmlBufferSetAllocationScheme | ( | xmlBufferPtr | buf, |
xmlBufferAllocationScheme | scheme | |||
) |
xmlBufferSetAllocationScheme: Sets the allocation scheme for this buffer
Parameters | |
---|---|
buf | the buffer to tune |
scheme | allocation scheme to use |
XMLPUBFUN int XMLCALL | xmlBufferLength | ( | const xmlBufferPtr | buf | ) |
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 | |
---|---|
buf | the buffer |
xmlBufferContent: Function to extract the content of a buffer
Returns the internal content
XMLPUBFUN xmlDtdPtr XMLCALL | xmlCreateIntSubset | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document pointer |
name | the DTD name |
ExternalID | the external (PUBLIC) ID |
SystemID | the system ID |
XMLPUBFUN xmlDtdPtr XMLCALL | xmlNewDtd | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document pointer |
name | the DTD name |
ExternalID | the external ID |
SystemID | the system ID |
XMLPUBFUN void XMLCALL | xmlFreeDtd | ( | xmlDtdPtr | cur | ) |
xmlFreeDtd: Free a DTD structure.
Parameters | |
---|---|
cur | the DTD structure to free up |
XMLPUBFUN xmlNsPtr XMLCALL | xmlNewNs | ( | xmlNodePtr | node, |
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)
XMLPUBFUN void XMLCALL | xmlFreeNs | ( | xmlNsPtr | cur | ) |
xmlFreeNs: Free up the structures associated to a namespace
OOM: never Precondition: cur is not NULL
Parameters | |
---|---|
cur | the namespace pointer |
XMLPUBFUN void XMLCALL | xmlFreeNsList | ( | xmlNsPtr | cur | ) |
xmlFreeNsList: Free up all the structures associated to the chained namespaces.
OOM: never
Parameters | |
---|---|
cur | the first namespace pointer |
XMLPUBFUN void XMLCALL | xmlFreeDoc | ( | xmlDocPtr | cur | ) |
xmlFreeDoc: Free up all the structures used by a document, tree included.
Parameters | |
---|---|
cur | pointer to the document |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlNewDocProp | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document |
name | the name of the attribute |
value | the value of the attribute |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlNewProp | ( | xmlNodePtr | node, |
const xmlChar * | name, | |||
const xmlChar * | value | |||
) |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlNewNsProp | ( | xmlNodePtr | node, |
xmlNsPtr | ns, | |||
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 | |
---|---|
node | the holding node |
ns | the namespace |
name | the name of the attribute |
value | the value of the attribute |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlNewNsPropEatName | ( | xmlNodePtr | node, |
xmlNsPtr | ns, | |||
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 | |
---|---|
node | the holding node |
ns | the namespace |
name | the name of the attribute |
value | the value of the attribute |
XMLPUBFUN void XMLCALL | xmlFreePropList | ( | xmlAttrPtr | cur | ) |
xmlFreePropList: Free a property and all its siblings, all the children are freed too.
Parameters | |
---|---|
cur | the first property in the list |
XMLPUBFUN void XMLCALL | xmlFreeProp | ( | xmlAttrPtr | cur | ) |
xmlFreeProp: Free one attribute, all the content is freed too
OOM: never
Parameters | |
---|---|
cur | an attribute |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlCopyProp | ( | xmlNodePtr | target, |
xmlAttrPtr | cur | |||
) |
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 | |
---|---|
target | the element where the attribute will be grafted |
cur | the attribute |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlCopyPropList | ( | xmlNodePtr | target, |
xmlAttrPtr | cur | |||
) |
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 | |
---|---|
target | the element where the attributes will be grafted |
cur | the first attribute |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocNode | ( | xmlDocPtr | doc, |
xmlNsPtr | ns, | |||
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 | |
---|---|
doc | the document |
ns | namespace if any |
name | the node name |
content | the XML text content if any |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocNodeEatName | ( | xmlDocPtr | doc, |
xmlNsPtr | ns, | |||
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 | |
---|---|
doc | the document |
ns | namespace if any |
name | the node name |
content | the XML text content if any |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocRawNode | ( | xmlDocPtr | doc, |
xmlNsPtr | ns, | |||
const xmlChar * | name, | |||
const xmlChar * | content | |||
) |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewNode | ( | xmlNsPtr | ns, |
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 | |
---|---|
ns | namespace if any |
name | the node name |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewNodeEatName | ( | xmlNsPtr | ns, |
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 | |
---|---|
ns | namespace if any |
name | the node name |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewChild | ( | xmlNodePtr | parent, |
xmlNsPtr | ns, | |||
const xmlChar * | name, | |||
const xmlChar * | content | |||
) |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewTextChild | ( | xmlNodePtr | parent, |
xmlNsPtr | ns, | |||
const xmlChar * | name, | |||
const xmlChar * | content | |||
) |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocText | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document |
content | the text content |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewText | ( | 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 | |
---|---|
content | the text content |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewPI | ( | 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 | |
---|---|
name | the processing instruction name |
content | the PI content |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocTextLen | ( | xmlDocPtr | doc, |
const xmlChar * | content, | |||
int | len | |||
) |
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 | |
---|---|
doc | the document |
content | the text content |
len | the text len. |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewTextLen | ( | const xmlChar * | content, |
int | len | |||
) |
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 | |
---|---|
content | the text content |
len | the text len. |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewDocComment | ( | xmlDocPtr | doc, |
const xmlChar * | content | |||
) |
xmlNewDocComment: Creation of a new node containing a comment within a document. Returns a pointer to the new node object.
Parameters | |
---|---|
doc | the document |
content | the comment content |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewComment | ( | 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 | |
---|---|
content | the comment content |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewCDataBlock | ( | xmlDocPtr | doc, |
const xmlChar * | content, | |||
int | len | |||
) |
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 | |
---|---|
doc | the document |
content | the CDATA block content content |
len | the length of the block |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewCharRef | ( | xmlDocPtr | doc, |
const xmlChar * | name | |||
) |
xmlNewCharRef: Creation of a new character reference node. Returns a pointer to the new node object.
Parameters | |
---|---|
doc | the document |
name | the char ref string, starting with # or "&# ... ;" |
XMLPUBFUN xmlNodePtr XMLCALL | xmlNewReference | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document |
name | the reference name, or the reference string with & and ; |
XMLPUBFUN xmlNodePtr XMLCALL | xmlCopyNode | ( | const xmlNodePtr | node, |
int | recursive | |||
) |
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 | |
---|---|
node | the node |
recursive | if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) |
XMLPUBFUN xmlNodePtr XMLCALL | xmlDocCopyNode | ( | const xmlNodePtr | node, |
xmlDocPtr | doc, | |||
int | recursive | |||
) |
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 | |
---|---|
node | the node |
doc | the document |
recursive | if 1 - do a recursive copy (properties, namespaces and children when applicable) if 2 - copy properties and namespaces (when applicable) |
XMLPUBFUN xmlNodePtr XMLCALL | xmlCopyNodeList | ( | const xmlNodePtr | node | ) |
xmlCopyNodeList: Do a recursive copy of the node list.
Returns: a new xmlNodePtr, or NULL in case of error.
Parameters | |
---|---|
node | the first node in the list. |
XMLPUBFUN xmlNodePtr XMLCALL | xmlDocGetRootElement | ( | xmlDocPtr | doc | ) |
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 | |
---|---|
doc | the document |
XMLPUBFUN xmlNodePtr XMLCALL | xmlGetLastChild | ( | xmlNodePtr | parent | ) |
xmlGetLastChild: Search the last child of a node. Returns the last child or NULL if none.
Parameters | |
---|---|
parent | the parent node |
XMLPUBFUN int XMLCALL | xmlNodeIsText | ( | xmlNodePtr | node | ) |
xmlNodeIsText: Is this node a Text node ? Returns 1 yes, 0 no
Parameters | |
---|---|
node | the node |
XMLPUBFUN int XMLCALL | xmlIsBlankNode | ( | xmlNodePtr | node | ) |
xmlIsBlankNode: Checks whether this node is an empty or whitespace only (and possibly ignorable) text-node.
Returns 1 yes, 0 no
Parameters | |
---|---|
node | the node |
XMLPUBFUN xmlNodePtr XMLCALL | xmlAddChild | ( | xmlNodePtr | parent, |
xmlNodePtr | cur | |||
) |
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 | |
---|---|
parent | the parent node |
cur | the child node |
XMLPUBFUN xmlNodePtr XMLCALL | xmlAddChildList | ( | xmlNodePtr | parent, |
xmlNodePtr | cur | |||
) |
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 | |
---|---|
parent | the parent node |
cur | the first node in the list |
XMLPUBFUN xmlNodePtr XMLCALL | xmlAddSibling | ( | xmlNodePtr | cur, |
xmlNodePtr | elem | |||
) |
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 | |
---|---|
cur | the child node |
elem | the new node |
XMLPUBFUN xmlNodePtr XMLCALL | xmlAddNextSibling | ( | xmlNodePtr | cur, |
xmlNodePtr | elem | |||
) |
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 | |
---|---|
cur | the child node |
elem | the new node |
XMLPUBFUN void XMLCALL | xmlUnlinkNode | ( | xmlNodePtr | cur | ) |
xmlUnlinkNode: Unlink a node from it's current context, the node is not freed
OOM: never
Parameters | |
---|---|
cur | the node |
XMLPUBFUN xmlNodePtr XMLCALL | xmlTextMerge | ( | xmlNodePtr | first, |
xmlNodePtr | second | |||
) |
xmlTextMerge: Merge two text nodes into one Returns the first text node augmented
OOM: possible --> OOM flag is set, returns NULL
Parameters | |
---|---|
first | the first text node |
second | the second text node being merged |
XMLPUBFUN int XMLCALL | xmlTextConcat | ( | xmlNodePtr | node, |
const xmlChar * | content, | |||
int | len | |||
) |
xmlTextConcat: Concat the given string at the end of the existing node content
Returns -1 in case of error, 0 otherwise
Parameters | |
---|---|
node | the node |
content | the content |
len | content length |
XMLPUBFUN void XMLCALL | xmlFreeNodeList | ( | xmlNodePtr | cur | ) |
xmlFreeNodeList: Free a node and all its siblings, this is a recursive behaviour, all the children are freed too.
OOM: never
Parameters | |
---|---|
cur | the first node in the list |
XMLPUBFUN void XMLCALL | xmlFreeNode | ( | xmlNodePtr | cur | ) |
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 | |
---|---|
cur | the node |
XMLPUBFUN void XMLCALL | xmlSetTreeDoc | ( | xmlNodePtr | tree, |
xmlDocPtr | doc | |||
) |
xmlSetTreeDoc: update all nodes under the tree to point to the right document
Parameters | |
---|---|
tree | the top element |
doc | the document |
XMLPUBFUN void XMLCALL | xmlSetListDoc | ( | xmlNodePtr | list, |
xmlDocPtr | doc | |||
) |
xmlSetListDoc: update all nodes in the list to point to the right document
OOM: never
Parameters | |
---|---|
list | the first element |
doc | the document |
XMLPUBFUN xmlNsPtr XMLCALL | xmlSearchNs | ( | xmlDocPtr | doc, |
xmlNodePtr | node, | |||
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 | |
---|---|
doc | the document |
node | the current node |
nameSpace | the namespace prefix |
XMLPUBFUN xmlNsPtr XMLCALL | xmlSearchNsByHref | ( | xmlDocPtr | doc, |
xmlNodePtr | node, | |||
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 | |
---|---|
doc | the document |
node | the current node |
href | the namespace value |
XMLPUBFUN void XMLCALL | xmlSetNs | ( | xmlNodePtr | node, |
xmlNsPtr | ns | |||
) |
xmlSetNs: Associate a namespace to a node, a posteriori.
Parameters | |
---|---|
node | a node in the document |
ns | a namespace pointer |
XMLPUBFUN xmlChar *XMLCALL | xmlGetNoNsProp | ( | xmlNodePtr | node, |
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 | |
---|---|
node | the node |
name | the attribute name |
XMLPUBFUN xmlChar *XMLCALL | xmlGetProp | ( | xmlNodePtr | node, |
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 | |
---|---|
node | the node |
name | the attribute name |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlHasProp | ( | xmlNodePtr | node, |
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 | |
---|---|
node | the node |
name | the attribute name |
XMLPUBFUN xmlAttrPtr XMLCALL | xmlHasNsProp | ( | xmlNodePtr | node, |
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 | |
---|---|
node | the node |
name | the attribute name |
nameSpace | the URI of the namespace |
XMLPUBFUN xmlChar *XMLCALL | xmlGetNsProp | ( | xmlNodePtr | node, |
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 | |
---|---|
node | the node |
name | the attribute name |
nameSpace | the URI of the namespace |
XMLPUBFUN xmlNodePtr XMLCALL | xmlStringGetNodeList | ( | xmlDocPtr | doc, |
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 | |
---|---|
doc | the document |
value | the value of the attribute |
XMLPUBFUN xmlNodePtr XMLCALL | xmlStringLenGetNodeList | ( | xmlDocPtr | doc, |
const xmlChar * | value, | |||
int | len | |||
) |
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 | |
---|---|
doc | the document |
value | the value of the text |
len | the length of the string value |
XMLPUBFUN xmlChar *XMLCALL | xmlNodeListGetString | ( | xmlDocPtr | doc, |
xmlNodePtr | list, | |||
int | inLine | |||
) |
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
XMLPUBFUN void XMLCALL | xmlNodeSetContent | ( | xmlNodePtr | cur, |
const xmlChar * | content | |||
) |
xmlNodeSetContent: Replace the content of a node.
OOM: possible --> sets OOM flag
Parameters | |
---|---|
cur | the node being modified |
content | the new value of the content |
XMLPUBFUN void XMLCALL | xmlNodeAddContent | ( | xmlNodePtr | cur, |
const xmlChar * | content | |||
) |
xmlNodeAddContent: Append the extra substring to the node content.
OOM: possible --> OOM flag is set
Parameters | |
---|---|
cur | the node being modified |
content | extra content |
XMLPUBFUN void XMLCALL | xmlNodeAddContentLen | ( | xmlNodePtr | cur, |
const xmlChar * | content, | |||
int | len | |||
) |
xmlNodeAddContentLen: Append the extra substring to the node content.
OOM: possible --> OOM flag is set
Parameters | |
---|---|
cur | the node being modified |
content | extra content |
len | the size of content |
XMLPUBFUN xmlChar *XMLCALL | xmlNodeGetContent | ( | xmlNodePtr | cur | ) |
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 | |
---|---|
cur | the node being read |
XMLPUBFUN int XMLCALL | xmlNodeBufGetContent | ( | xmlBufferPtr | buffer, |
xmlNodePtr | cur | |||
) |
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 | |
---|---|
buffer | a buffer |
cur | the node being read |
XMLPUBFUN xmlChar *XMLCALL | xmlNodeGetLang | ( | xmlNodePtr | cur | ) |
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 | |
---|---|
cur | the node being checked |
XMLPUBFUN int XMLCALL | xmlNodeGetSpacePreserve | ( | xmlNodePtr | cur | ) |
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 | |
---|---|
cur | the node being checked |
XMLPUBFUN xmlChar *XMLCALL | xmlNodeGetBase | ( | xmlDocPtr | doc, |
xmlNodePtr | cur | |||
) |
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 | |
---|---|
doc | the document the node pertains to |
cur | the node being checked |
XMLPUBFUN void XMLCALL | xmlBufferWriteCHAR | ( | xmlBufferPtr | buf, |
const xmlChar * | string | |||
) |
xmlBufferWriteCHAR: routine which manages and grows an output buffer. This one adds xmlChars at the end of the buffer.
Parameters | |
---|---|
buf | the XML buffer |
string | the string to add |
XMLPUBFUN void XMLCALL | xmlBufferWriteChar | ( | xmlBufferPtr | buf, |
const char * | string | |||
) |
xmlBufferWriteChar: routine which manage and grows an output buffer. This one add C chars at the end of the array.
Parameters | |
---|---|
buf | the XML buffer output |
string | the string to add |
XMLPUBFUN void XMLCALL | xmlBufferWriteQuotedString | ( | xmlBufferPtr | buf, |
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 | |
---|---|
buf | the XML buffer output |
string | the string to add |
XMLPUBFUN void | xmlAttrSerializeTxtContent | ( | xmlBufferPtr | buf, |
xmlDocPtr | doc, | |||
xmlAttrPtr | attr, | |||
const xmlChar * | string | |||
) |
XMLPUBFUN int XMLCALL | xmlReconciliateNs | ( | xmlDocPtr | doc, |
xmlNodePtr | tree | |||
) |
XMLPUBFUN void XMLCALL | xmlSetDocCompressMode | ( | xmlDocPtr | doc, |
int | mode | |||
) |
xmlSetDocCompressMode: set the compression ratio for a document, ZLIB based Correct values: 0 (uncompressed) to 9 (max compression)
Parameters | |
---|---|
doc | the document |
mode | the compression ratio |
XMLPUBFUN int XMLCALL | xmlGetDocCompressMode | ( | xmlDocPtr | doc | ) |
xmlGetDocCompressMode: get the compression ratio for a document, ZLIB based Returns 0 (uncompressed) to 9 (max compression)
Parameters | |
---|---|
doc | the document |