X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=doc%2Fhtml%2Flibxml-tree.html;h=5d932cbe8c3b70846470cf0726b74038a6afa400;hb=4e8fa1efca3c71ef7e0c515afb175e849a97d416;hp=eb7c2bc952a0467ef394e3e723f56489c517ee9a;hpb=f1203bb16d4c806ad871c24d097983c3fa550048;p=platform%2Fupstream%2Flibxml2.git diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html index eb7c2bc..5d932cb 100644 --- a/doc/html/libxml-tree.html +++ b/doc/html/libxml-tree.html @@ -10,12 +10,15 @@ A:link, A:visited, A:active { text-decoration: underline } Module tree from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module tree from libxml2

API Menu
API Indexes
Related links

this module describes the structures found in an tree resulting from an XML or HTML parsing, as well as the API provided for various processing on that tree

Table of Contents

#define BASE_BUFFER_SIZE
#define XML_GET_CONTENT
#define XML_GET_LINE
#define XML_LOCAL_NAMESPACE
#define XML_XML_ID
#define XML_XML_NAMESPACE
#define xmlChildrenNode
#define xmlRootNode
Structure xmlAttr
struct _xmlAttr + Module tree from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module tree from libxml2

API Menu
API Indexes
Related links

this module describes the structures found in an tree resulting from an XML or HTML parsing, as well as the API provided for various processing on that tree

Table of Contents

#define BASE_BUFFER_SIZE
#define LIBXML2_NEW_BUFFER
#define XML_GET_CONTENT
#define XML_GET_LINE
#define XML_LOCAL_NAMESPACE
#define XML_XML_ID
#define XML_XML_NAMESPACE
#define xmlChildrenNode
#define xmlRootNode
Structure xmlAttr
struct _xmlAttr
Typedef xmlAttr * xmlAttrPtr
 
Structure xmlAttribute
struct _xmlAttribute
Enum xmlAttributeDefault
 
Typedef xmlAttribute * xmlAttributePtr
 
Enum xmlAttributeType
+
Structure xmlBuf
struct _xmlBuf +The content of this structure is not made public by the API. +
Typedef xmlBuf * xmlBufPtr
 
Structure xmlBuffer
struct _xmlBuffer
Enum xmlBufferAllocationScheme
 
Typedef xmlBuffer * xmlBufferPtr
@@ -67,6 +70,12 @@ A:link, A:visited, A:active { text-decoration: underline }
 
xmlNodePtr	xmlAddPrevSibling	(xmlNodePtr cur, 
xmlNodePtr elem)
xmlNodePtr	xmlAddSibling		(xmlNodePtr cur, 
xmlNodePtr elem)
void	xmlAttrSerializeTxtContent	(xmlBufferPtr buf, 
xmlDocPtr doc,
xmlAttrPtr attr,
const xmlChar * string)
+
xmlChar *	xmlBufContent		(const xmlBufPtr buf)
+
xmlChar *	xmlBufEnd		(const xmlBufPtr buf)
+
int	xmlBufGetNodeContent		(xmlBufPtr buf, 
xmlNodePtr cur)
+
size_t	xmlBufNodeDump			(xmlBufPtr buf, 
xmlDocPtr doc,
xmlNodePtr cur,
int level,
int format)
+
size_t	xmlBufShrink			(xmlBufPtr buf, 
size_t len)
+
size_t	xmlBufUse			(const xmlBufPtr buf)
int	xmlBufferAdd			(xmlBufferPtr buf, 
const xmlChar * str,
int len)
int	xmlBufferAddHead		(xmlBufferPtr buf, 
const xmlChar * str,
int len)
int	xmlBufferCCat			(xmlBufferPtr buf, 
const char * str)
@@ -224,6 +233,7 @@ A:link, A:visited, A:active { text-decoration: underline }
int	xmlValidateQName		(const xmlChar * value, 
int space)

Description

Macro: BASE_BUFFER_SIZE

#define BASE_BUFFER_SIZE

default buffer size 4000.

+

Macro: LIBXML2_NEW_BUFFER

#define LIBXML2_NEW_BUFFER

Macro used to express that the API use the new buffers for xmlParserInputBuffer and xmlOutputBuffer. The change was introduced in 2.9.0.

Macro: XML_GET_CONTENT

#define XML_GET_CONTENT

Macro to extract the content pointer of a node.

Macro: XML_GET_LINE

#define XML_GET_LINE

Macro to extract the line number of an element node.

Macro: XML_LOCAL_NAMESPACE

#define XML_LOCAL_NAMESPACE

A namespace declaration node.

@@ -279,7 +289,11 @@ A:link, A:visited, A:active { text-decoration: underline } XML_ATTRIBUTE_ENUMERATION = 9 XML_ATTRIBUTE_NOTATION = 10 } -

Structure xmlBuffer

Structure xmlBuffer
struct _xmlBuffer { +

Structure xmlBuf

Structure xmlBuf
struct _xmlBuf { +The content of this structure is not made public by the API. +}
+ A pointer to a buffer structure, the actual structure internals are not public +

Structure xmlBuffer

Structure xmlBuffer
struct _xmlBuffer { xmlChar * content : The buffer content UTF8 unsigned int use : The buffer size used unsigned int size : The buffer size @@ -478,8 +492,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlOutputWriteCallback writecallback xmlOutputCloseCallback closecallback xmlCharEncodingHandlerPtr encoder : I18N conversions to UTF-8 - xmlBufferPtr buffer : Local buffer encoded in UTF-8 or ISOLat - xmlBufferPtr conv : if encoder != NULL buffer for output + xmlBufPtr buffer : Local buffer encoded in UTF-8 or ISOLat + xmlBufPtr conv : if encoder != NULL buffer for output int written : total number of byte written int error }

Structure xmlParserCtxt

Structure xmlParserCtxt
struct _xmlParserCtxt { @@ -571,6 +585,7 @@ A:link, A:visited, A:active { text-decoration: underline } int nodeInfoMax : Max depth of the parsing stack xmlParserNodeInfo * nodeInfoTab : array of nodeInfos int input_id : we need to label inputs + unsigned long sizeentcopy : volume of entity copy }

Structure xmlParserInput

Structure xmlParserInput
struct _xmlParserInput { xmlParserInputBufferPtr buf : UTF-8 encoded buffer const char * filename : The file analyzed, if any @@ -592,8 +607,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlInputReadCallback readcallback xmlInputCloseCallback closecallback xmlCharEncodingHandlerPtr encoder : I18N conversions to UTF-8 - xmlBufferPtr buffer : Local buffer encoded in UTF-8 - xmlBufferPtr raw : if encoder != NULL buffer for raw input + xmlBufPtr buffer : Local buffer encoded in UTF-8 + xmlBufPtr raw : if encoder != NULL buffer for raw input int compressed : -1=unknown, 0=not compressed, 1=compres int error unsigned long rawconsumed : amount consumed from raw @@ -653,7 +668,19 @@ A:link, A:visited, A:active { text-decoration: underline }

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.

cur:the child node
elem:the new node
Returns:the new element or NULL in case of error.

Function: xmlAttrSerializeTxtContent

void	xmlAttrSerializeTxtContent	(xmlBufferPtr buf, 
xmlDocPtr doc,
xmlAttrPtr attr,
const xmlChar * string)

Serialize text attribute values to an xml simple buffer

-
buf:the XML buffer output
doc:the document
attr:the attribute node
string:the text content

Function: xmlBufferAdd

int	xmlBufferAdd			(xmlBufferPtr buf, 
const xmlChar * str,
int len)
+
buf:the XML buffer output
doc:the document
attr:the attribute node
string:the text content

Function: xmlBufContent

xmlChar *	xmlBufContent		(const xmlBufPtr buf)
+

Function to extract the content of a buffer

+
buf:the buffer
Returns:the internal content

Function: xmlBufEnd

xmlChar *	xmlBufEnd		(const xmlBufPtr buf)
+

Function to extract the end of the content of a buffer

+
buf:the buffer
Returns:the end of the internal content or NULL in case of error

Function: xmlBufGetNodeContent

int	xmlBufGetNodeContent		(xmlBufPtr buf, 
xmlNodePtr cur)
+

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

+
buf:a buffer xmlBufPtr
cur:the node being read
Returns:0 in case of success and -1 in case of error.

Function: xmlBufNodeDump

size_t	xmlBufNodeDump			(xmlBufPtr buf, 
xmlDocPtr doc,
xmlNodePtr cur,
int level,
int format)
+

Dump an XML node, recursive behaviour,children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called

+
buf:the XML buffer output
doc:the document
cur:the current node
level:the imbrication level for indenting
format:is formatting allowed
Returns:the number of bytes written to the buffer, in case of error 0 is returned or @buf stores the error

Function: xmlBufShrink

size_t	xmlBufShrink			(xmlBufPtr buf, 
size_t len)
+

Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.

+
buf:the buffer to dump
len:the number of xmlChar to remove
Returns:the number of byte removed or 0 in case of failure

Function: xmlBufUse

size_t	xmlBufUse			(const xmlBufPtr buf)
+

Function to get the length of a buffer

+
buf:the buffer
Returns:the length of data in the internal content

Function: xmlBufferAdd

int	xmlBufferAdd			(xmlBufferPtr buf, 
const xmlChar * str,
int len)

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

buf:the buffer to dump
str:the #xmlChar string
len:the number of #xmlChar to add
Returns:0 successful, a positive error code number otherwise and -1 in case of internal or API error.

Function: xmlBufferAddHead

int	xmlBufferAddHead		(xmlBufferPtr buf, 
const xmlChar * str,
int len)

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

@@ -781,7 +808,7 @@ A:link, A:visited, A:active { text-decoration: underline }
doc:the document pointer
Returns:a pointer to the DTD structure or NULL if not found

Function: xmlGetLastChild

xmlNodePtr	xmlGetLastChild		(xmlNodePtr parent)

Search the last child of a node.

parent:the parent node
Returns:the last child or NULL if none.

Function: xmlGetLineNo

long	xmlGetLineNo			(xmlNodePtr node)
-

Get line number of @node. This requires activation of this option before invoking the parser by calling xmlLineNumbersDefault(1)

+

Get line number of @node. Try to override the limitation of lines being store in 16 bits ints if XML_PARSE_BIG_LINES parser option was used

node:valid node
Returns:the line number if successful, -1 otherwise

Function: xmlGetNoNsProp

xmlChar *	xmlGetNoNsProp		(xmlNodePtr node, 
const xmlChar * name)

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.

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

Function: xmlGetNodePath

xmlChar *	xmlGetNodePath		(xmlNodePtr node)
@@ -865,7 +892,7 @@ A:link, A:visited, A:active { text-decoration: underline }
cur:the node being modified
content:extra content
len:the size of @content

Function: xmlNodeBufGetContent

int	xmlNodeBufGetContent		(xmlBufferPtr buffer, 
xmlNodePtr cur)

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

buffer:a buffer
cur:the node being read
Returns:0 in case of success and -1 in case of error.

Function: xmlNodeDump

int	xmlNodeDump			(xmlBufferPtr buf, 
xmlDocPtr doc,
xmlNodePtr cur,
int level,
int format)
-

Dump an XML node, recursive behaviour,children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called

+

Dump an XML node, recursive behaviour,children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called Since this is using xmlBuffer structures it is limited to 2GB and somehow deprecated, use xmlBufNodeDump() instead.

buf:the XML buffer output
doc:the document
cur:the current node
level:the imbrication level for indenting
format:is formatting allowed
Returns:the number of bytes written to the buffer or -1 in case of error

Function: xmlNodeDumpOutput

void	xmlNodeDumpOutput		(xmlOutputBufferPtr buf, 
xmlDocPtr doc,
xmlNodePtr cur,
int level,
int format,
const char * encoding)

Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called

buf:the XML buffer output
doc:the document
cur:the current node
level:the imbrication level for indenting
format:is formatting allowed
encoding:an optional encoding string

Function: xmlNodeGetBase

xmlChar *	xmlNodeGetBase		(xmlDocPtr doc, 
xmlNodePtr cur)
@@ -938,7 +965,7 @@ A:link, A:visited, A:active { text-decoration: underline }

parse an XML qualified name string [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName

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

Function: xmlSplitQName3

const xmlChar *	xmlSplitQName3		(const xmlChar * name, 
int * len)

parse an XML qualified name string,i

-
name:the full QName
len:an int *
Returns:NULL if it is not a Qualified Name, otherwise, update len with the lenght in byte of the prefix and return a pointer to the start of the name without the prefix

Function: xmlStringGetNodeList

xmlNodePtr	xmlStringGetNodeList	(xmlDocPtr doc, 
const xmlChar * value)
+
name:the full QName
len:an int *
Returns:NULL if it is not a Qualified Name, otherwise, update len with the length in byte of the prefix and return a pointer to the start of the name without the prefix

Function: xmlStringGetNodeList

xmlNodePtr	xmlStringGetNodeList	(xmlDocPtr doc, 
const xmlChar * value)

Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.

doc:the document
value:the value of the attribute
Returns:a pointer to the first child

Function: xmlStringLenGetNodeList

xmlNodePtr	xmlStringLenGetNodeList	(xmlDocPtr doc, 
const xmlChar * value,
int len)

Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.

@@ -947,7 +974,7 @@ A:link, A:visited, A:active { text-decoration: underline }
node:the node
content:the content
len:@content length
Returns:-1 in case of error, 0 otherwise

Function: xmlTextMerge

xmlNodePtr	xmlTextMerge		(xmlNodePtr first, 
xmlNodePtr second)

Merge two text nodes into one

first:the first text node
second:the second text node being merged
Returns:the first text node augmented

Function: xmlUnlinkNode

void	xmlUnlinkNode			(xmlNodePtr cur)
-

Unlink a node from it's current context, the node is not freed If one need to free the node, use xmlFreeNode() routine after the unlink to discard it.

+

Unlink a node from it's current context, the node is not freed If one need to free the node, use xmlFreeNode() routine after the unlink to discard it. Note that namespace nodes can't be unlinked as they do not have pointer to their parent.

cur:the node

Function: xmlUnsetNsProp

int	xmlUnsetNsProp			(xmlNodePtr node, 
xmlNsPtr ns,
const xmlChar * name)

Remove an attribute carried by a node.

node:the node
ns:the namespace definition
name:the attribute name
Returns:0 if successful, -1 if not found

Function: xmlUnsetProp

int	xmlUnsetProp			(xmlNodePtr node, 
const xmlChar * name)