libxml2

Loading...
Searching...
No Matches
Data Fields
_xmlNode Struct Reference

Generic node type in an XML or HTML tree. More...

`#include <tree.h>`

## Data Fields
void * | _private
| Application data.
xmlElementType | type
| Type enum, an xmlElementType value.
const xmlChar * | name
| Name of the node.
struct _xmlNode * | children
| First child.
struct _xmlNode * | last
| Last child.
struct _xmlNode * | parent
| Parent node.
struct _xmlNode * | next
| Next sibling.
struct _xmlNode * | prev
| Previous sibling.
struct _xmlDoc * | doc
| Associated document.
xmlNs * | ns
| Namespace of element if any.
xmlChar * | content
| Content of text, comment, PI nodes.
struct _xmlAttr * | properties
| First attribute of element.
xmlNs * | nsDef
| First namespace definition of element.
void * | psvi
| For type/PSVI information.
unsigned short | line
| Line number.
unsigned short | extra
| Extra data for XPath/XSLT.

## Detailed Description

Generic node type in an XML or HTML tree.

This is used for

- XML_ELEMENT_NODE
- XML_TEXT_NODE
- XML_CDATA_SECTION_NODE
- XML_ENTITY_REF_NODE
- XML_PI_NODE
- XML_COMMENT_NODE
- XML_DOCUMENT_FRAG_NODE
- XML_XINCLUDE_START_NODE
- XML_XINCLUDE_END_NODE

Other node types have a different struct layout than xmlNode, see xmlElementType. Except for XML_NAMESPACE_DECL all nodes share the following members at the same offset:

- _private
- type (also for XML_NAMESPACE_DECL)
- name
- children
- last
- parent
- next
- prev
- doc

xmlNode and xmlAttr also share the ns member.

## Field Documentation

## ◆ _private

void* _private

Application data.

Often used by language bindings.

## ◆ children

struct _xmlNode* children

First child.

Entity declaration of entity references.

## ◆ content

xmlChar* content

Content of text, comment, PI nodes.

Sort index for elements after calling xmlXPathOrderDocElems. Content of internal entities for entity references.

## ◆ doc

struct _xmlDoc* doc

Associated document.

Used to access DTDs, entities, ID tables, dictionary or other document properties. All children of a node share the same document.

## ◆ name

const xmlChar* name

Name of the node.

- Local name of elements or attributes. As a corner case, this can also contain Names which are invalid QNames in non-namespace-wellformed documents.
- Name of entity references
- Target of processing instructions
- Fixed string for text and comments
- Unused otherwise

## ◆ parent

struct _xmlNode* parent

Parent node.

NULL for documents or unlinked root nodes.

## ◆ properties

struct _xmlAttr* properties

First attribute of element.

Also used to store small strings with XML_PARSE_COMPACT.

The documentation for this struct was generated from the following file:

- tree.h