Details
struct xmlParserInputBuffer
struct xmlParserInputBuffer {
void* context;
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 */
}; |
xmlParserInputBufferPtr
typedef xmlParserInputBuffer *xmlParserInputBufferPtr; |
struct xmlOutputBuffer
struct xmlOutputBuffer {
void* context;
xmlOutputWriteCallback writecallback;
xmlOutputCloseCallback closecallback;
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
xmlBufferPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */
}; |
xmlOutputBufferPtr
typedef xmlOutputBuffer *xmlOutputBufferPtr; |
struct xmlParserInput
struct xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
const char *directory; /* the directory/base of the file */
const xmlChar *base; /* Base of the array to parse */
const xmlChar *cur; /* Current char being parsed */
const xmlChar *end; /* end of the array to parse */
int length; /* length if known */
int line; /* Current line */
int col; /* Current column */
int consumed; /* How many xmlChars already consumed */
xmlParserInputDeallocate free; /* function to deallocate the base */
const xmlChar *encoding; /* the encoding string for entity */
const xmlChar *version; /* the version string for entity */
int standalone; /* Was that entity marked standalone */
}; |
An xmlParserInput is an input flow for the XML processor.
Each entity parsed is associated an xmlParserInput (except the
few predefined ones). This is the case both for internal entities
- in which case the flow is already completely in memory - or
external entities - in which case we use the buf structure for
progressive reading and I18N conversions to the internal UTF-8 format.
xmlParserInputPtr
typedef xmlParserInput *xmlParserInputPtr; |
struct xmlParserCtxt
struct xmlParserCtxt {
struct _xmlSAXHandler *sax; /* The SAX handler */
void *userData; /* For SAX interface only, used by DOM build */
xmlDocPtr myDoc; /* the document being built */
int wellFormed; /* is the document well formed */
int replaceEntities; /* shall we replace entities ? */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* the declared encoding, if any */
int standalone; /* standalone document */
int html; /* an HTML(1)/Docbook(2) document */
/* Input stream stack */
xmlParserInputPtr input; /* Current input stream */
int inputNr; /* Number of current input streams */
int inputMax; /* Max number of input streams */
xmlParserInputPtr *inputTab; /* stack of inputs */
/* Node analysis stack only used for DOM building */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
int record_info; /* Whether node info should be kept */
xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
int errNo; /* error code */
int hasExternalSubset; /* reference and external subset */
int hasPErefs; /* the internal subset has PE refs */
int external; /* are we parsing an external entity */
int valid; /* is the document valid */
int validate; /* shall we try to validate ? */
xmlValidCtxt vctxt; /* The validity context */
xmlParserInputState instate; /* current type of input */
int token; /* next char look-ahead */
char *directory; /* the data directory */
/* Node name stack */
xmlChar *name; /* Current parsed Node */
int nameNr; /* Depth of the parsing stack */
int nameMax; /* Max depth of the parsing stack */
xmlChar * *nameTab; /* array of nodes */
long nbChars; /* number of xmlChar processed */
long checkIndex; /* used by progressive parsing lookup */
int keepBlanks; /* ugly but ... */
int disableSAX; /* SAX callbacks are disabled */
int inSubset; /* Parsing is in int 1/ext 2 subset */
xmlChar * intSubName; /* name of subset */
xmlChar * extSubURI; /* URI of external subset */
xmlChar * extSubSystem; /* SYSTEM ID of external subset */
/* xml:space values */
int * space; /* Should the parser preserve spaces */
int spaceNr; /* Depth of the parsing stack */
int spaceMax; /* Max depth of the parsing stack */
int * spaceTab; /* array of space infos */
int depth; /* to prevent entity substitution loops */
xmlParserInputPtr entity; /* used to check entities boundaries */
int charset; /* encoding of the in-memory content
actually an xmlCharEncoding */
int nodelen; /* Those two fields are there to */
int nodemem; /* Speed up large node parsing */
int pedantic; /* signal pedantic warnings */
void *_private; /* For user data, libxml won't touch it */
int loadsubset; /* should the external subset be loaded */
int linenumbers; /* set line number in element content */
void *catalogs; /* document's own catalog */
}; |
The parser context.
NOTE This doesn't completely define the parser state, the (current ?)
design of the parser uses recursive function calls since this allow
and easy mapping from the production rules of the specification
to the actual code. The drawback is that the actual function call
also reflect the parser state. However most of the parsing routines
takes as the only argument the parser context pointer, so migrating
to a state based parser for progressive parsing shouldn't be too hard.
xmlParserCtxtPtr
typedef xmlParserCtxt *xmlParserCtxtPtr; |
struct xmlSAXLocator
struct xmlSAXLocator {
const xmlChar *(*getPublicId)(void *ctx);
const xmlChar *(*getSystemId)(void *ctx);
int (*getLineNumber)(void *ctx);
int (*getColumnNumber)(void *ctx);
}; |
A SAX Locator.
xmlSAXLocatorPtr
typedef xmlSAXLocator *xmlSAXLocatorPtr; |
struct xmlSAXHandler
struct xmlSAXHandler {
internalSubsetSAXFunc internalSubset;
isStandaloneSAXFunc isStandalone;
hasInternalSubsetSAXFunc hasInternalSubset;
hasExternalSubsetSAXFunc hasExternalSubset;
resolveEntitySAXFunc resolveEntity;
getEntitySAXFunc getEntity;
entityDeclSAXFunc entityDecl;
notationDeclSAXFunc notationDecl;
attributeDeclSAXFunc attributeDecl;
elementDeclSAXFunc elementDecl;
unparsedEntityDeclSAXFunc unparsedEntityDecl;
setDocumentLocatorSAXFunc setDocumentLocator;
startDocumentSAXFunc startDocument;
endDocumentSAXFunc endDocument;
startElementSAXFunc startElement;
endElementSAXFunc endElement;
referenceSAXFunc reference;
charactersSAXFunc characters;
ignorableWhitespaceSAXFunc ignorableWhitespace;
processingInstructionSAXFunc processingInstruction;
commentSAXFunc comment;
warningSAXFunc warning;
errorSAXFunc error;
fatalErrorSAXFunc fatalError;
getParameterEntitySAXFunc getParameterEntity;
cdataBlockSAXFunc cdataBlock;
externalSubsetSAXFunc externalSubset;
int initialized;
}; |
A SAX handler is bunch of callbacks called by the parser when processing
of the input generate data or structure informations.
xmlSAXHandlerPtr
typedef xmlSAXHandler *xmlSAXHandlerPtr; |
struct xmlEntity
struct xmlEntity {
void *_private; /* application data */
xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
const xmlChar *name; /* Entity name */
struct _xmlNode *children; /* First child link */
struct _xmlNode *last; /* Last child link */
struct _xmlDtd *parent; /* -> DTD */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlChar *orig; /* content without ref substitution */
xmlChar *content; /* content or ndata if unparsed */
int length; /* the content length */
xmlEntityType etype; /* The entity type */
const xmlChar *ExternalID; /* External identifier for PUBLIC */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
struct _xmlEntity *nexte; /* unused */
const xmlChar *URI; /* the full URI as computed */
}; |
xmlEntityPtr
typedef xmlEntity *xmlEntityPtr; |
BASE_BUFFER_SIZE
#define BASE_BUFFER_SIZE 4000 |
default buffer size 4000.
XML_XML_NAMESPACE
#define XML_XML_NAMESPACE |
This is the namespace for the special xml: prefix predefined in the
XML Namespace specification.
enum xmlElementType
typedef enum {
XML_ELEMENT_NODE= 1,
XML_ATTRIBUTE_NODE= 2,
XML_TEXT_NODE= 3,
XML_CDATA_SECTION_NODE= 4,
XML_ENTITY_REF_NODE= 5,
XML_ENTITY_NODE= 6,
XML_PI_NODE= 7,
XML_COMMENT_NODE= 8,
XML_DOCUMENT_NODE= 9,
XML_DOCUMENT_TYPE_NODE= 10,
XML_DOCUMENT_FRAG_NODE= 11,
XML_NOTATION_NODE= 12,
XML_HTML_DOCUMENT_NODE= 13,
XML_DTD_NODE= 14,
XML_ELEMENT_DECL= 15,
XML_ATTRIBUTE_DECL= 16,
XML_ENTITY_DECL= 17,
XML_NAMESPACE_DECL= 18,
XML_XINCLUDE_START= 19,
XML_XINCLUDE_END= 20
#ifdef LIBXML_DOCB_ENABLED
,XML_DOCB_DOCUMENT_NODE= 21
#endif
} xmlElementType; |
xmlChar
typedef unsigned char xmlChar; |
This is a basic byte in an UTF-8 encoded string.
It's unsigned allowing to pinpoint case where char * are assigned
to xmlChar * (possibly making serialization back impossible).
BAD_CAST
#define BAD_CAST (xmlChar *) |
Macro to cast a string to an xmlChar * when one know its safe.
struct xmlNotation
struct xmlNotation {
const xmlChar *name; /* Notation name */
const xmlChar *PublicID; /* Public identifier, if any */
const xmlChar *SystemID; /* System identifier, if any */
}; |
A DTD Notation definition.
xmlNotationPtr
typedef xmlNotation *xmlNotationPtr; |
enum xmlAttributeType
typedef enum {
XML_ATTRIBUTE_CDATA = 1,
XML_ATTRIBUTE_ID,
XML_ATTRIBUTE_IDREF ,
XML_ATTRIBUTE_IDREFS,
XML_ATTRIBUTE_ENTITY,
XML_ATTRIBUTE_ENTITIES,
XML_ATTRIBUTE_NMTOKEN,
XML_ATTRIBUTE_NMTOKENS,
XML_ATTRIBUTE_ENUMERATION,
XML_ATTRIBUTE_NOTATION
} xmlAttributeType; |
A DTD Attribute type definition.
enum xmlAttributeDefault
typedef enum {
XML_ATTRIBUTE_NONE = 1,
XML_ATTRIBUTE_REQUIRED,
XML_ATTRIBUTE_IMPLIED,
XML_ATTRIBUTE_FIXED
} xmlAttributeDefault; |
A DTD Attribute default definition.
struct xmlEnumeration
struct xmlEnumeration {
struct _xmlEnumeration *next; /* next one */
const xmlChar *name; /* Enumeration name */
}; |
List structure used when there is an enumeration in DTDs.
xmlEnumerationPtr
typedef xmlEnumeration *xmlEnumerationPtr; |
struct xmlAttribute
struct xmlAttribute {
void *_private; /* application data */
xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */
const xmlChar *name; /* Attribute name */
struct _xmlNode *children; /* NULL */
struct _xmlNode *last; /* NULL */
struct _xmlDtd *parent; /* -> DTD */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
struct _xmlAttribute *nexth; /* next in hash table */
xmlAttributeType atype; /* The attribute type */
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue; /* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
const xmlChar *prefix; /* the namespace prefix if any */
const xmlChar *elem; /* Element holding the attribute */
}; |
An Attribute declaration in a DTD.
xmlAttributePtr
typedef xmlAttribute *xmlAttributePtr; |
enum xmlElementContentType
typedef enum {
XML_ELEMENT_CONTENT_PCDATA = 1,
XML_ELEMENT_CONTENT_ELEMENT,
XML_ELEMENT_CONTENT_SEQ,
XML_ELEMENT_CONTENT_OR
} xmlElementContentType; |
Possible definitions of element content types.
enum xmlElementContentOccur
typedef enum {
XML_ELEMENT_CONTENT_ONCE = 1,
XML_ELEMENT_CONTENT_OPT,
XML_ELEMENT_CONTENT_MULT,
XML_ELEMENT_CONTENT_PLUS
} xmlElementContentOccur; |
Possible definitions of element content occurrences.
struct xmlElementContent
struct xmlElementContent {
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
const xmlChar *name; /* Element name */
struct _xmlElementContent *c1; /* first child */
struct _xmlElementContent *c2; /* second child */
struct _xmlElementContent *parent; /* parent */
const xmlChar *prefix; /* Element name */
}; |
An XML Element content as stored after parsing an element definition
in a DTD.
xmlElementContentPtr
typedef xmlElementContent *xmlElementContentPtr; |
enum xmlElementTypeVal
typedef enum {
XML_ELEMENT_TYPE_UNDEFINED = 0,
XML_ELEMENT_TYPE_EMPTY = 1,
XML_ELEMENT_TYPE_ANY,
XML_ELEMENT_TYPE_MIXED,
XML_ELEMENT_TYPE_ELEMENT
} xmlElementTypeVal; |
The different possibilities for an element content type.
struct xmlElement
struct xmlElement {
void *_private; /* application data */
xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */
const xmlChar *name; /* Element name */
struct _xmlNode *children; /* NULL */
struct _xmlNode *last; /* NULL */
struct _xmlDtd *parent; /* -> DTD */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlElementTypeVal etype; /* The type */
xmlElementContentPtr content; /* the allowed element content */
xmlAttributePtr attributes; /* List of the declared attributes */
const xmlChar *prefix; /* the namespace prefix if any */
}; |
An XML Element declaration from a DTD.
xmlElementPtr
typedef xmlElement *xmlElementPtr; |
XML_LOCAL_NAMESPACE
#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL |
A namespace declaration node.
xmlNsType
typedef xmlElementType xmlNsType; |
struct xmlNs
struct xmlNs {
struct _xmlNs *next; /* next Ns link for this node */
xmlNsType type; /* global or local */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
}; |
An XML namespace.
Note that prefix == NULL is valid, it defines the default namespace
within the subtree (until overridden).
xmlNsType is unified with xmlElementType.
struct xmlDtd
struct xmlDtd {
void *_private; /* application data */
xmlElementType type; /* XML_DTD_NODE, must be second ! */
const xmlChar *name; /* Name of the DTD */
struct _xmlNode *children; /* the value of the property link */
struct _xmlNode *last; /* last child link */
struct _xmlDoc *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
/* End of common part */
void *notations; /* Hash table for notations if any */
void *elements; /* Hash table for elements if any */
void *attributes; /* Hash table for attributes if any */
void *entities; /* Hash table for entities if any */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
void *pentities; /* Hash table for param entities if any */
}; |
An XML DTD, as defined by <!DOCTYPE ... There is actually one for
the internal subset and for the external subset.
xmlDtdPtr
typedef xmlDtd *xmlDtdPtr; |
struct xmlAttr
struct xmlAttr {
void *_private; /* application data */
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */
const xmlChar *name; /* the name of the property */
struct _xmlNode *children; /* the value of the property */
struct _xmlNode *last; /* NULL */
struct _xmlNode *parent; /* child->parent link */
struct _xmlAttr *next; /* next sibling link */
struct _xmlAttr *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlNs *ns; /* pointer to the associated namespace */
xmlAttributeType atype; /* the attribute type if validating */
}; |
An attribute on an XML node.
xmlAttrPtr
typedef xmlAttr *xmlAttrPtr; |
struct xmlID
struct xmlID {
struct _xmlID *next; /* next ID */
const xmlChar *value; /* The ID name */
xmlAttrPtr attr; /* The attribute holding it */
}; |
An XML ID instance.
struct xmlRef
struct xmlRef {
struct _xmlRef *next; /* next Ref */
const xmlChar *value; /* The Ref name */
xmlAttrPtr attr; /* The attribute holding it */
}; |
An XML IDREF instance.
xmlRefPtr
typedef xmlRef *xmlRefPtr; |
enum xmlBufferAllocationScheme
typedef enum {
XML_BUFFER_ALLOC_DOUBLEIT,
XML_BUFFER_ALLOC_EXACT
} 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.
struct xmlBuffer
struct xmlBuffer {
xmlChar *content; /* The buffer content UTF8 */
unsigned int use; /* The buffer size used */
unsigned int size; /* The buffer size */
xmlBufferAllocationScheme alloc; /* The realloc method */
}; |
A buffer structure.
xmlBufferPtr
typedef xmlBuffer *xmlBufferPtr; |
struct xmlNode
struct xmlNode {
void *_private; /* application data */
xmlElementType type; /* type number, must be second ! */
const xmlChar *name; /* the name of the node, or the entity */
struct _xmlNode *children; /* parent->childs link */
struct _xmlNode *last; /* last child link */
struct _xmlNode *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
/* End of common part */
xmlNs *ns; /* pointer to the associated namespace */
xmlChar *content; /* the content */
struct _xmlAttr *properties;/* properties list */
xmlNs *nsDef; /* namespace definitions on this node */
}; |
A node in an XML tree.
xmlNodePtr
typedef xmlNode *xmlNodePtr; |
XML_GET_CONTENT()
#define XML_GET_CONTENT(n) |
Macro to extract the content pointer of a node.
XML_GET_LINE()
Macro to extract the line number of an element node.
This will work only if line numbering is activated by
calling xmlLineNumbersDefault(1) before parsing.
struct xmlDoc
struct xmlDoc {
void *_private; /* application data */
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
struct _xmlNode *children; /* the document tree */
struct _xmlNode *last; /* last child link */
struct _xmlNode *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* autoreference to itself */
/* End of common part */
int compression;/* level of zlib compression */
int standalone; /* standalone document (no external refs) */
struct _xmlDtd *intSubset; /* the document internal subset */
struct _xmlDtd *extSubset; /* the document external subset */
struct _xmlNs *oldNs; /* Global namespace, the old way */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* external initial encoding, if any */
void *ids; /* Hash table for ID attributes if any */
void *refs; /* Hash table for IDREFs attributes if any */
const xmlChar *URL; /* The URI for that document */
int charset; /* encoding of the in-memory content
actually an xmlCharEncoding */
}; |
An XML document.
xmlDocPtr
typedef xmlDoc *xmlDocPtr; |
xmlChildrenNode
#define xmlChildrenNode children |
Macro for compatibility naming layer with libxml1.
xmlRootNode
#define xmlRootNode children |
Macro for compatibility naming layer with libxml1.
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
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
xmlBufferCreate ()
routine to create an XML buffer.
xmlBufferCreateSize ()
routine to create an XML buffer.
xmlBufferResize ()
Resize a buffer to accommodate minimum size of size.
xmlBufferFree ()
Frees an XML buffer. It frees both the content and the structure which
encapsulate it.
xmlBufferDump ()
Dumps an XML buffer to a FILE *.
xmlBufferAdd ()
Add a string range to an XML buffer. if len == -1, the length of
str is recomputed.
xmlBufferAddHead ()
Add a string range to the beginning of an XML buffer.
if len == -1, the length of str is recomputed.
xmlBufferCat ()
Append a zero terminated string to an XML buffer.
xmlBufferCCat ()
Append a zero terminated C string to an XML buffer.
xmlBufferShrink ()
Remove the beginning of an XML buffer.
xmlBufferGrow ()
Grow the available space of an XML buffer.
xmlBufferEmpty ()
empty a buffer.
xmlBufferContent ()
Function to extract the content of a buffer
xmlBufferSetAllocationScheme ()
Sets the allocation scheme for this buffer
xmlBufferLength ()
Function to get the length of a buffer
xmlCreateIntSubset ()
Create the internal subset of a document
xmlNewDtd ()
Creation of a new DTD for the external subset. To create an
internal subset, use xmlCreateIntSubset().
xmlGetIntSubset ()
Get the internal subset of a document
xmlFreeDtd ()
Free a DTD structure.
xmlNewGlobalNs ()
Creation of a Namespace, the old way using PI and without scoping
DEPRECATED !!!
It now create a namespace on the root element of the document if found.
xmlNewNs ()
Creation of a new Namespace. This function will refuse to create
a namespace with a similar prefix than an existing one present on this
node.
We use href==NULL in the case of an element creation where the namespace
was not defined.
xmlFreeNs ()
Free up the structures associated to a namespace
xmlFreeNsList ()
Free up all the structures associated to the chained namespaces.
xmlNewDoc ()
Creates a new XML document
xmlFreeDoc ()
Free up all the structures used by a document, tree included.
xmlNewDocProp ()
Create a new property carried by a document.
xmlNewProp ()
Create a new property carried by a node.
xmlNewNsProp ()
Create a new property tagged with a namespace and carried by a node.
xmlFreePropList ()
Free a property and all its siblings, all the children are freed too.
xmlFreeProp ()
Free one attribute, all the content is freed too
xmlCopyProp ()
Do a copy of the attribute.
xmlCopyPropList ()
Do a copy of an attribute list.
xmlCopyDtd ()
Do a copy of the dtd.
xmlCopyDoc ()
Do a copy of the document info. If recursive, the content tree will
be copied too as well as DTD, namespaces and entities.
xmlNewDocNode ()
Creation of a new node element within a document. ns and content
are 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.
xmlNewDocRawNode ()
Creation of a new node element within a document. ns and content
are optional (NULL).
xmlNewNode ()
Creation of a new node element. ns is optional (NULL).
xmlNewChild ()
Creation of a new child element, added at the end of parent children list.
ns and content parameters are optional (NULL). If content is non NULL,
a child list containing the TEXTs and ENTITY_REFs node will be created.
NOTE: content is supposed to be a piece of XML CDATA, so it allow entities
references, but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant(). Use xmlNewTextChild() if entities
support is not needed.
xmlNewTextChild ()
Creation of a new child element, added at the end of parent children list.
ns and content parameters are optional (NULL). If content is non NULL,
a child TEXT node will be created containing the string content.
xmlNewDocText ()
Creation of a new text node within a document.
xmlNewText ()
Creation of a new text node.
xmlNewPI ()
Creation of a processing instruction element.
xmlNewDocTextLen ()
Creation of a new text node with an extra content length parameter. The
text node pertain to a given document.
xmlNewTextLen ()
Creation of a new text node with an extra parameter for the content's length
xmlNewDocComment ()
Creation of a new node containing a comment within a document.
xmlNewComment ()
Creation of a new node containing a comment.
xmlNewCDataBlock ()
Creation of a new node containing a CDATA block.
xmlNewCharRef ()
Creation of a new character reference node.
xmlNewReference ()
Creation of a new reference node.
xmlCopyNode ()
Do a copy of the node.
xmlDocCopyNode ()
Do a copy of the node to a given document.
xmlCopyNodeList ()
Do a recursive copy of the node list.
xmlNewDocFragment ()
Creation of a new Fragment node.
xmlGetLineNo ()
Get line number of node. this requires activation of this option
before invoking the parser by calling xmlLineNumbersDefault(1)
xmlGetNodePath ()
Build a structure based Path for the given node
xmlDocGetRootElement ()
Get the root element of the document (doc->children is a list
containing possibly comments, PIs, etc ...).
xmlGetLastChild ()
Search the last child of a node.
xmlNodeIsText ()
Is this node a Text node ?
xmlIsBlankNode ()
Checks whether this node is an empty or whitespace only
(and possibly ignorable) text-node.
xmlDocSetRootElement ()
Set the root element of the document (doc->children is a list
containing possibly comments, PIs, etc ...).
xmlNodeSetName ()
Set (or reset) the name of a node.
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 was already inserted in a document it is
first unlinked from its existing context.
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.
xmlAddChildList ()
Add a list of node at the end of the child list of the parent
merging adjacent TEXT nodes (cur may be freed)
xmlReplaceNode ()
Unlink the old node from it's current context, prune the new one
at the same place. If cur was already inserted in a document it is
first unlinked from its existing context.
xmlAddSibling ()
Add a new element elem to the list of siblings of cur
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.
xmlAddPrevSibling ()
Add a new node elem as the previous sibling of cur
merging adjacent TEXT nodes (elem may be freed)
If the new node was already inserted in a document it is
first unlinked from its existing context.
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.
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.
xmlUnlinkNode ()
Unlink a node from it's current context, the node is not freed
xmlTextMerge ()
Merge two text nodes into one
xmlTextConcat ()
Concat the given string at the end of the existing node content
xmlFreeNodeList ()
Free a node and all its siblings, this is a recursive behaviour, all
the children are freed too.
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.
xmlSetTreeDoc ()
update all nodes under the tree to point to the right document
xmlSetListDoc ()
update all nodes in the list to point to the right document
xmlSearchNs ()
Search a Ns registered under a given name space for a document.
recurse on the parents until it finds the defined namespace
or return NULL otherwise.
nameSpace can be NULL, this is a search for the default namespace.
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.
xmlSearchNsByHref ()
Search a Ns aliasing a given URI. Recurse on the parents until it finds
the defined namespace or return NULL otherwise.
xmlGetNsList ()
Search all the namespace applying to a given element.
xmlSetNs ()
Associate a namespace to a node, a posteriori.
xmlCopyNamespace ()
Do a copy of the namespace.
xmlCopyNamespaceList ()
Do a copy of an namespace list.
xmlSetProp ()
Set (or reset) an attribute carried by a node.
xmlGetProp ()
Search and get the value of an attribute associated to a node
This does the entity substitution.
This function looks in DTD attribute declaration for FIXED or
default declaration values unless DTD use has been turned off.
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.
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.
xmlSetNsProp ()
Set (or reset) an attribute carried by a node.
The ns structure must be in scope, this is not checked.
xmlGetNsProp ()
Search and get the value of an attribute associated to a node
This attribute has to be anchored in the namespace specified.
This does the entity substitution.
This function looks in DTD attribute declaration for FIXED or
default declaration values unless DTD use has been turned off.
xmlStringGetNodeList ()
Parse the value string and build the node list associated. Should
produce a flat tree with only TEXTs and ENTITY_REFs.
xmlStringLenGetNodeList ()
Parse the value string and build the node list associated. Should
produce a flat tree with only TEXTs and ENTITY_REFs.
xmlNodeListGetString ()
Returns the string equivalent to the text contained in the Node list
made of TEXTs and ENTITY_REFs
xmlNodeListGetRawString ()
Returns the string equivalent to the text contained in the Node list
made of TEXTs and ENTITY_REFs, contrary to xmlNodeListGetString()
this function doesn't do any character encoding handling.
xmlNodeSetContent ()
Replace the content of a node.
xmlNodeSetContentLen ()
Replace the content of a node.
xmlNodeAddContent ()
Append the extra substring to the node content.
xmlNodeAddContentLen ()
Append the extra substring to the node content.
xmlNodeGetContent ()
Read the value of a node, this can be either the text carried
directly by this node if it's a TEXT node or the aggregate string
of the values carried by this node child's (TEXT and ENTITY_REF).
Entity references are substituted.
xmlNodeGetLang ()
Searches the language of a node, i.e. the values of the xml:lang
attribute or the one carried by the nearest ancestor.
xmlNodeSetLang ()
Set the language of a node, i.e. the values of the xml:lang
attribute.
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.
xmlNodeSetSpacePreserve ()
void xmlNodeSetSpacePreserve (xmlNodePtr cur,
int val); |
Set (or reset) the space preserving behaviour of a node, i.e. the
value of the xml:space attribute.
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
xmlNodeSetBase ()
Set (or reset) the base URI of a node, i.e. the value of the
xml:base attribute.
xmlRemoveProp ()
Unlink and free one attribute, all the content is freed too
Note this doesn't work for namespace definition attributes
xmlUnsetProp ()
Remove an attribute carried by a node.
xmlUnsetNsProp ()
Remove an attribute carried by a node.
xmlBufferWriteXmlCHAR ()
For VMS only.
routine which manages and grows an output buffer. This one adds
xmlChars at the end of the buffer.
xmlBufferWriteCHAR ()
routine which manages and grows an output buffer. This one adds
xmlChars at the end of the buffer.
xmlBufferWriteChar ()
void xmlBufferWriteChar (xmlBufferPtr buf,
const char *string); |
routine which manage and grows an output buffer. This one add
C chars at the end of the array.
xmlBufferWriteQuotedString ()
routine which manage and grows an output buffer. This one writes
a quoted or double quoted xmlChar string, checking first if it holds
quote or double-quotes internally
xmlReconciliateNs ()
This function checks that all the namespaces declared within the given
tree are properly declared. This is needed for example after Copy or Cut
and then paste operations. The subtree may still hold pointers to
namespace declarations outside the subtree or invalid/masked. As much
as possible the function try to reuse the existing namespaces found in
the new environment. If not possible the new namespaces are redeclared
on tree at the top of the given subtree.
xmlDocDumpFormatMemory ()
void xmlDocDumpFormatMemory (xmlDocPtr cur,
xmlChar **mem,
int *size,
int format); |
Dump an XML document in memory and return the xmlChar * and it's size.
It's up to the caller to free the memory.
Note that format = 1 provide node indenting only if xmlIndentTreeOutput = 1
or xmlKeepBlanksDefault(0) was called
xmlDocDumpMemory ()
Dump an XML document in memory and return the xmlChar * and it's size.
It's up to the caller to free the memory.
xmlDocDumpMemoryEnc ()
void xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
xmlChar **doc_txt_ptr,
int *doc_txt_len,
const char *txt_encoding); |
Dump the current DOM tree into memory using the character encoding specified
by the caller. Note it is up to the caller of this function to free the
allocated memory.
xmlDocDumpFormatMemoryEnc ()
void xmlDocDumpFormatMemoryEnc (xmlDocPtr out_doc,
xmlChar **doc_txt_ptr,
int *doc_txt_len,
const char *txt_encoding,
int format); |
Dump the current DOM tree into memory using the character encoding specified
by the caller. Note it is up to the caller of this function to free the
allocated memory.
Note that format = 1 provide node indenting only if xmlIndentTreeOutput = 1
or xmlKeepBlanksDefault(0) was called
xmlDocDump ()
Dump an XML document to an open FILE.
xmlElemDump ()
Dump an XML/HTML node, recursive behaviour, children are printed too.
xmlSaveFile ()
int xmlSaveFile (const char *filename,
xmlDocPtr cur); |
Dump an XML document to a file. Will use compression if
compiled in and enabled. If filename is "-" the stdout file is
used.
xmlSaveFormatFile ()
int xmlSaveFormatFile (const char *filename,
xmlDocPtr cur,
int format); |
Dump an XML document to a file. Will use compression if
compiled in and enabled. If filename is "-" the stdout file is
used. If format is set then the document will be indented on output.
xmlNodeDump ()
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
xmlSaveFileTo ()
Dump an XML document to an I/O buffer.
xmlSaveFormatFileTo ()
Dump an XML document to an I/O buffer.
xmlNodeDumpOutput ()
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
xmlSaveFormatFileEnc ()
int xmlSaveFormatFileEnc (const char *filename,
xmlDocPtr cur,
const char *encoding,
int format); |
xmlSaveFileEnc ()
int xmlSaveFileEnc (const char *filename,
xmlDocPtr cur,
const char *encoding); |
Dump an XML document, converting it to the given encoding
xmlGetDocCompressMode ()
get the compression ratio for a document, ZLIB based
xmlSetDocCompressMode ()
void xmlSetDocCompressMode (xmlDocPtr doc,
int mode); |
set the compression ratio for a document, ZLIB based
Correct values: 0 (uncompressed) to 9 (max compression)
xmlGetCompressMode ()
int xmlGetCompressMode (void); |
get the default compression mode used, ZLIB based.
xmlSetCompressMode ()
void xmlSetCompressMode (int mode); |
set the default compression mode used, ZLIB based
Correct values: 0 (uncompressed) to 9 (max compression)