| libxml2 Reference Manual |
|---|
SAX - Old SAX version 1 handler, deprecated
DEPRECATED set of SAX version 1 interfaces used to build the DOM tree.
WARNING: this module is deprecated !
Author(s): Daniel Veillard
void attribute (void * ctx,
const xmlChar * fullname,
const xmlChar * value); void attributeDecl (void * ctx,
const xmlChar * elem,
const xmlChar * fullname,
int type,
int def,
const xmlChar * defaultValue,
xmlEnumerationPtr tree); void cdataBlock (void * ctx,
const xmlChar * value,
int len); void characters (void * ctx,
const xmlChar * ch,
int len); int checkNamespace (void * ctx,
xmlChar * namespace); void comment (void * ctx,
const xmlChar * value); void elementDecl (void * ctx,
const xmlChar * name,
int type,
xmlElementContentPtr content); void endDocument (void * ctx); void endElement (void * ctx,
const xmlChar * name); void entityDecl (void * ctx,
const xmlChar * name,
int type,
const xmlChar * publicId,
const xmlChar * systemId,
xmlChar * content); void externalSubset (void * ctx,
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID); int getColumnNumber (void * ctx); xmlEntityPtr getEntity (void * ctx,
const xmlChar * name); int getLineNumber (void * ctx); xmlNsPtr getNamespace (void * ctx); xmlEntityPtr getParameterEntity (void * ctx,
const xmlChar * name); const xmlChar * getPublicId (void * ctx); const xmlChar * getSystemId (void * ctx); void globalNamespace (void * ctx,
const xmlChar * href,
const xmlChar * prefix); int hasExternalSubset (void * ctx); int hasInternalSubset (void * ctx); void ignorableWhitespace (void * ctx,
const xmlChar * ch,
int len); void inithtmlDefaultSAXHandler (xmlSAXHandlerV1 * hdlr); void initxmlDefaultSAXHandler (xmlSAXHandlerV1 * hdlr,
int warning); void internalSubset (void * ctx,
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID); int isStandalone (void * ctx); void namespaceDecl (void * ctx,
const xmlChar * href,
const xmlChar * prefix); void notationDecl (void * ctx,
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId); void processingInstruction (void * ctx,
const xmlChar * target,
const xmlChar * data); void reference (void * ctx,
const xmlChar * name); xmlParserInputPtr resolveEntity (void * ctx,
const xmlChar * publicId,
const xmlChar * systemId); void setDocumentLocator (void * ctx,
xmlSAXLocatorPtr loc); void setNamespace (void * ctx,
const xmlChar * name); void startDocument (void * ctx); void startElement (void * ctx,
const xmlChar * fullname,
const xmlChar ** atts); void unparsedEntityDecl (void * ctx,
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId,
const xmlChar * notationName);
void attribute (void * ctx,
const xmlChar * fullname,
const xmlChar * value)
Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element. DEPRECATED: use xmlSAX2Attribute()
void attributeDecl (void * ctx,
const xmlChar * elem,
const xmlChar * fullname,
int type,
int def,
const xmlChar * defaultValue,
xmlEnumerationPtr tree)
An attribute definition has been parsed DEPRECATED: use xmlSAX2AttributeDecl()
void cdataBlock (void * ctx,
const xmlChar * value,
int len)
called when a pcdata block has been parsed DEPRECATED: use xmlSAX2CDataBlock()
| ctx: | the user data (XML parser context) |
| value: | The pcdata content |
| len: | the block length |
void characters (void * ctx,
const xmlChar * ch,
int len)
receiving some chars from the parser. DEPRECATED: use xmlSAX2Characters()
int checkNamespace (void * ctx,
xmlChar * namespace)
Check that the current element namespace is the same as the one read upon parsing. DEPRECATED
| ctx: | the user data (XML parser context) |
| namespace: | the namespace to check against |
| Returns: | 1 if true 0 otherwise |
void comment (void * ctx,
const xmlChar * value)
A comment has been parsed. DEPRECATED: use xmlSAX2Comment()
| ctx: | the user data (XML parser context) |
| value: | the comment content |
void elementDecl (void * ctx,
const xmlChar * name,
int type,
xmlElementContentPtr content)
An element definition has been parsed DEPRECATED: use xmlSAX2ElementDecl()
| ctx: | the user data (XML parser context) |
| name: | the element name |
| type: | the element type |
| content: | the element value tree |
void endDocument (void * ctx)
called when the document end has been detected. DEPRECATED: use xmlSAX2EndDocument()
| ctx: | the user data (XML parser context) |
void endElement (void * ctx,
const xmlChar * name)
called when the end of an element has been detected. DEPRECATED: use xmlSAX2EndElement()
| ctx: | the user data (XML parser context) |
| name: | The element name |
void entityDecl (void * ctx,
const xmlChar * name,
int type,
const xmlChar * publicId,
const xmlChar * systemId,
xmlChar * content)
An entity definition has been parsed DEPRECATED: use xmlSAX2EntityDecl()
| ctx: | the user data (XML parser context) |
| name: | the entity name |
| type: | the entity type |
| publicId: | The public ID of the entity |
| systemId: | The system ID of the entity |
| content: | the entity value (without processing). |
void externalSubset (void * ctx,
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Callback on external subset declaration. DEPRECATED: use xmlSAX2ExternalSubset()
| ctx: | the user data (XML parser context) |
| name: | the root element name |
| ExternalID: | the external ID |
| SystemID: | the SYSTEM ID (e.g. filename or URL) |
int getColumnNumber (void * ctx)
Provide the column number of the current parsing point. DEPRECATED: use xmlSAX2GetColumnNumber()
| ctx: | the user data (XML parser context) |
| Returns: | an int |
xmlEntityPtr getEntity (void * ctx,
const xmlChar * name)
Get an entity by name DEPRECATED: use xmlSAX2GetEntity()
| ctx: | the user data (XML parser context) |
| name: | The entity name |
| Returns: | the xmlEntityPtr if found. |
int getLineNumber (void * ctx)
Provide the line number of the current parsing point. DEPRECATED: use xmlSAX2GetLineNumber()
| ctx: | the user data (XML parser context) |
| Returns: | an int |
xmlNsPtr getNamespace (void * ctx)
Get the current element namespace. DEPRECATED
| ctx: | the user data (XML parser context) |
| Returns: | the xmlNsPtr or NULL if none |
xmlEntityPtr getParameterEntity (void * ctx,
const xmlChar * name)
Get a parameter entity by name DEPRECATED: use xmlSAX2GetParameterEntity()
| ctx: | the user data (XML parser context) |
| name: | The entity name |
| Returns: | the xmlEntityPtr if found. |
const xmlChar * getPublicId (void * ctx)
Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN" DEPRECATED: use xmlSAX2GetPublicId()
| ctx: | the user data (XML parser context) |
| Returns: | a xmlChar * |
const xmlChar * getSystemId (void * ctx)
Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd DEPRECATED: use xmlSAX2GetSystemId()
| ctx: | the user data (XML parser context) |
| Returns: | a xmlChar * |
void globalNamespace (void * ctx,
const xmlChar * href,
const xmlChar * prefix)
An old global namespace has been parsed. DEPRECATED
| ctx: | the user data (XML parser context) |
| href: | the namespace associated URN |
| prefix: | the namespace prefix |
int hasExternalSubset (void * ctx)
Does this document has an external subset DEPRECATED: use xmlSAX2HasExternalSubset()
| ctx: | the user data (XML parser context) |
| Returns: | 1 if true |
int hasInternalSubset (void * ctx)
Does this document has an internal subset DEPRECATED: use xmlSAX2HasInternalSubset()
| ctx: | the user data (XML parser context) |
| Returns: | 1 if true |
void ignorableWhitespace (void * ctx,
const xmlChar * ch,
int len)
receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters DEPRECATED: use xmlSAX2IgnorableWhitespace()
void inithtmlDefaultSAXHandler (xmlSAXHandlerV1 * hdlr)
Initialize the default HTML SAX version 1 handler DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks
| hdlr: | the SAX handler |
void initxmlDefaultSAXHandler (xmlSAXHandlerV1 * hdlr,
int warning)
Initialize the default XML SAX version 1 handler DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks
| hdlr: | the SAX handler |
| warning: | flag if non-zero sets the handler warning procedure |
void internalSubset (void * ctx,
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Callback on internal subset declaration. DEPRECATED: use xmlSAX2InternalSubset()
| ctx: | the user data (XML parser context) |
| name: | the root element name |
| ExternalID: | the external ID |
| SystemID: | the SYSTEM ID (e.g. filename or URL) |
int isStandalone (void * ctx)
Is this document tagged standalone ? DEPRECATED: use xmlSAX2IsStandalone()
| ctx: | the user data (XML parser context) |
| Returns: | 1 if true |
void namespaceDecl (void * ctx,
const xmlChar * href,
const xmlChar * prefix)
A namespace has been parsed. DEPRECATED
| ctx: | the user data (XML parser context) |
| href: | the namespace associated URN |
| prefix: | the namespace prefix |
void notationDecl (void * ctx,
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId)
What to do when a notation declaration has been parsed. DEPRECATED: use xmlSAX2NotationDecl()
| ctx: | the user data (XML parser context) |
| name: | The name of the notation |
| publicId: | The public ID of the entity |
| systemId: | The system ID of the entity |
void processingInstruction (void * ctx,
const xmlChar * target,
const xmlChar * data)
A processing instruction has been parsed. DEPRECATED: use xmlSAX2ProcessingInstruction()
| ctx: | the user data (XML parser context) |
| target: | the target name |
| data: | the PI data's |
void reference (void * ctx,
const xmlChar * name)
called when an entity reference is detected. DEPRECATED: use xmlSAX2Reference()
| ctx: | the user data (XML parser context) |
| name: | The entity name |
xmlParserInputPtr resolveEntity (void * ctx,
const xmlChar * publicId,
const xmlChar * systemId)
The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine DEPRECATED: use xmlSAX2ResolveEntity()
| ctx: | the user data (XML parser context) |
| publicId: | The public ID of the entity |
| systemId: | The system ID of the entity |
| Returns: | the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
void setDocumentLocator (void * ctx,
xmlSAXLocatorPtr loc)
Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case. DEPRECATED
| ctx: | the user data (XML parser context) |
| loc: | A SAX Locator |
void setNamespace (void * ctx,
const xmlChar * name)
Set the current element namespace. DEPRECATED
| ctx: | the user data (XML parser context) |
| name: | the namespace prefix |
void startDocument (void * ctx)
called when the document start being processed. DEPRECATED: use xmlSAX2StartDocument()
| ctx: | the user data (XML parser context) |
void startElement (void * ctx,
const xmlChar * fullname,
const xmlChar ** atts)
called when an opening tag has been processed. DEPRECATED: use xmlSAX2StartElement()
| ctx: | the user data (XML parser context) |
| fullname: | The element name, including namespace prefix |
| atts: | An array of name/value attributes pairs, NULL terminated |
void unparsedEntityDecl (void * ctx,
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId,
const xmlChar * notationName)
What to do when an unparsed entity declaration is parsed DEPRECATED: use xmlSAX2UnparsedEntityDecl()
| ctx: | the user data (XML parser context) |
| name: | The name of the entity |
| publicId: | The public ID of the entity |
| systemId: | The system ID of the entity |
| notationName: | the name of the notation |
| libxml2 Reference Manual |
|---|
HTMLtree - specific APIs to process HTML tree, especially serialization
this module implements a few function needed to process tree in an HTML specific way.
Author(s): Daniel Veillard
#define HTML_COMMENT_NODE; #define HTML_ENTITY_REF_NODE; #define HTML_PI_NODE; #define HTML_PRESERVE_NODE; #define HTML_TEXT_NODE; void htmlDocContentDumpFormatOutput (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding,
int format); void htmlDocContentDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding); int htmlDocDump (FILE * f,
xmlDocPtr cur); void htmlDocDumpMemory (xmlDocPtr cur,
xmlChar ** mem,
int * size); void htmlDocDumpMemoryFormat (xmlDocPtr cur,
xmlChar ** mem,
int * size,
int format); const xmlChar * htmlGetMetaEncoding (htmlDocPtr doc); int htmlIsBooleanAttr (const xmlChar * name); htmlDocPtr htmlNewDoc (const xmlChar * URI,
const xmlChar * ExternalID); htmlDocPtr htmlNewDocNoDtD (const xmlChar * URI,
const xmlChar * ExternalID); int htmlNodeDump (xmlBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur); void htmlNodeDumpFile (FILE * out,
xmlDocPtr doc,
xmlNodePtr cur); int htmlNodeDumpFileFormat (FILE * out,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding,
int format); void htmlNodeDumpFormatOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding,
int format); void htmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding); int htmlSaveFile (const char * filename,
xmlDocPtr cur); int htmlSaveFileEnc (const char * filename,
xmlDocPtr cur,
const char * encoding); int htmlSaveFileFormat (const char * filename,
xmlDocPtr cur,
const char * encoding,
int format); int htmlSetMetaEncoding (htmlDocPtr doc,
const xmlChar * encoding);
#define HTML_COMMENT_NODE;
Macro. A comment in a HTML document is really implemented the same way as a comment in an XML document.
#define HTML_ENTITY_REF_NODE;
Macro. An entity reference in a HTML document is really implemented the same way as an entity reference in an XML document.
#define HTML_PI_NODE;
Macro. A processing instruction in a HTML document is really implemented the same way as a processing instruction in an XML document.
#define HTML_PRESERVE_NODE;
Macro. A preserved node in a HTML document is really implemented the same way as a CDATA section in an XML document.
#define HTML_TEXT_NODE;
Macro. A text node in a HTML document is really implemented the same way as a text node in an XML document.
void htmlDocContentDumpFormatOutput (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding,
int format)
Dump an HTML document.
| buf: | the HTML buffer output |
| cur: | the document |
| encoding: | the encoding string (unused) |
| format: | should formatting spaces been added |
void htmlDocContentDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding)
Dump an HTML document. Formatting return/spaces are added.
| buf: | the HTML buffer output |
| cur: | the document |
| encoding: | the encoding string (unused) |
int htmlDocDump (FILE * f,
xmlDocPtr cur)
Dump an HTML document to an open FILE.
| f: | the FILE* |
| cur: | the document |
| Returns: | the number of byte written or -1 in case of failure. |
void htmlDocDumpMemory (xmlDocPtr cur,
xmlChar ** mem,
int * size)
Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.
| cur: | the document |
| mem: | OUT: the memory pointer |
| size: | OUT: the memory length |
void htmlDocDumpMemoryFormat (xmlDocPtr cur,
xmlChar ** mem,
int * size,
int format)
Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.
| cur: | the document |
| mem: | OUT: the memory pointer |
| size: | OUT: the memory length |
| format: | should formatting spaces been added |
const xmlChar * htmlGetMetaEncoding (htmlDocPtr doc)
Encoding definition lookup in the Meta tags
| doc: | the document |
| Returns: | the current encoding as flagged in the HTML source |
int htmlIsBooleanAttr (const xmlChar * name)
Determine if a given attribute is a boolean attribute.
htmlDocPtr htmlNewDoc (const xmlChar * URI,
const xmlChar * ExternalID)
Creates a new HTML document
| URI: | URI for the dtd, or NULL |
| ExternalID: | the external ID of the DTD, or NULL |
| Returns: | a new document |
htmlDocPtr htmlNewDocNoDtD (const xmlChar * URI,
const xmlChar * ExternalID)
Creates a new HTML document without a DTD node if @URI and @ExternalID are NULL
| URI: | URI for the dtd, or NULL |
| ExternalID: | the external ID of the DTD, or NULL |
| Returns: | a new document, do not initialize the DTD if not provided |
int htmlNodeDump (xmlBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur)
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added.
| buf: | the HTML buffer output |
| doc: | the document |
| cur: | the current node |
| Returns: | the number of byte written or -1 in case of error |
void htmlNodeDumpFile (FILE * out,
xmlDocPtr doc,
xmlNodePtr cur)
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added.
| out: | the FILE pointer |
| doc: | the document |
| cur: | the current node |
int htmlNodeDumpFileFormat (FILE * out,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding,
int format)
Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == NULL try to save in the doc encoding
| out: | the FILE pointer |
| doc: | the document |
| cur: | the current node |
| encoding: | the document encoding |
| format: | should formatting spaces been added |
| Returns: | the number of byte written or -1 in case of failure. |
void htmlNodeDumpFormatOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding,
int format)
Dump an HTML node, recursive behaviour,children are printed too.
| buf: | the HTML buffer output |
| doc: | the document |
| cur: | the current node |
| encoding: | the encoding string (unused) |
| format: | should formatting spaces been added |
void htmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
const char * encoding)
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.
| buf: | the HTML buffer output |
| doc: | the document |
| cur: | the current node |
| encoding: | the encoding string (unused) |
int htmlSaveFile (const char * filename,
xmlDocPtr cur)
Dump an HTML document to a file. If @filename is "-" the stdout file is used.
| filename: | the filename (or URL) |
| cur: | the document |
| Returns: | the number of byte written or -1 in case of failure. |
int htmlSaveFileEnc (const char * filename,
xmlDocPtr cur,
const char * encoding)
Dump an HTML document to a file using a given encoding and formatting returns/spaces are added.
| filename: | the filename |
| cur: | the document |
| encoding: | the document encoding |
| Returns: | the number of byte written or -1 in case of failure. |
int htmlSaveFileFormat (const char * filename,
xmlDocPtr cur,
const char * encoding,
int format)
Dump an HTML document to a file using a given encoding.
| filename: | the filename |
| cur: | the document |
| encoding: | the document encoding |
| format: | should formatting spaces been added |
| Returns: | the number of byte written or -1 in case of failure. |
int htmlSetMetaEncoding (htmlDocPtr doc,
const xmlChar * encoding)
Sets the current encoding in the Meta tags NOTE: this will not change the document content encoding, just the META flag associated.
| doc: | the document |
| encoding: | the encoding string |
| Returns: | 0 in case of success and -1 in case of error |
| libxml2 Reference Manual |
|---|
xmlautomata - API to build regexp automata
the API to build regexp automata
Author(s): Daniel Veillard
typedef struct _xmlAutomata xmlAutomata; typedef xmlAutomata * xmlAutomataPtr; typedef struct _xmlAutomataState xmlAutomataState; typedef xmlAutomataState * xmlAutomataStatePtr; xmlRegexpPtr xmlAutomataCompile (xmlAutomataPtr am); xmlAutomataStatePtr xmlAutomataGetInitState (xmlAutomataPtr am); int xmlAutomataIsDeterminist (xmlAutomataPtr am); xmlAutomataStatePtr xmlAutomataNewAllTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int lax); xmlAutomataStatePtr xmlAutomataNewCountTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewCountedTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter); int xmlAutomataNewCounter (xmlAutomataPtr am,
int min,
int max); xmlAutomataStatePtr xmlAutomataNewCounterTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter); xmlAutomataStatePtr xmlAutomataNewEpsilon (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to); xmlAutomataStatePtr xmlAutomataNewNegTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data); xmlAutomataStatePtr xmlAutomataNewOnceTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewState (xmlAutomataPtr am); xmlAutomataStatePtr xmlAutomataNewTransition (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
void * data); xmlAutomataStatePtr xmlAutomataNewTransition2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data); int xmlAutomataSetFinalState (xmlAutomataPtr am,
xmlAutomataStatePtr state); void xmlFreeAutomata (xmlAutomataPtr am); xmlAutomataPtr xmlNewAutomata (void);
struct _xmlAutomata {
The content of this structure is not made public by the API.
} xmlAutomata;
xmlAutomata * xmlAutomataPtr;
A libxml automata description, It can be compiled into a regexp
struct _xmlAutomataState {
The content of this structure is not made public by the API.
} xmlAutomataState;
xmlAutomataState * xmlAutomataStatePtr;
A state int the automata description,
xmlRegexpPtr xmlAutomataCompile (xmlAutomataPtr am)
Compile the automata into a Reg Exp ready for being executed. The automata should be free after this point.
| am: | an automata |
| Returns: | the compiled regexp or NULL in case of error |
xmlAutomataStatePtr xmlAutomataGetInitState (xmlAutomataPtr am)
Initial state lookup
| am: | an automata |
| Returns: | the initial state of the automata |
int xmlAutomataIsDeterminist (xmlAutomataPtr am)
Checks if an automata is determinist.
| am: | an automata |
| Returns: | 1 if true, 0 if not, and -1 in case of error |
xmlAutomataStatePtr xmlAutomataNewAllTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int lax)
If @to is NULL, this creates first a new target state in the automata and then adds a an ALL transition from the @from state to the target state. That transition is an epsilon transition allowed only when all transitions from the @from node have been activated.
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| lax: | allow to transition if not all all transitions have been activated |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewCountTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and whose number is between @min and @max
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the input string associated to that transition |
| min: | the minimum successive occurrences of token |
| max: | the maximum successive occurrences of token |
| data: | data associated to the transition |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and @token2 and whose number is between @min and @max
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the input string associated to that transition |
| token2: | the second input string associated to that transition |
| min: | the minimum successive occurrences of token |
| max: | the maximum successive occurrences of token |
| data: | data associated to the transition |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewCountedTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter)
If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state which will increment the counter provided
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| counter: | the counter associated to that transition |
| Returns: | the target state or NULL in case of error |
int xmlAutomataNewCounter (xmlAutomataPtr am,
int min,
int max)
Create a new counter
| am: | an automata |
| min: | the minimal value on the counter |
| max: | the maximal value on the counter |
| Returns: | the counter number or -1 in case of error |
xmlAutomataStatePtr xmlAutomataNewCounterTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter)
If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state which will be allowed only if the counter is within the right range.
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| counter: | the counter associated to that transition |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewEpsilon (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to)
If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewNegTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by any value except (@token,@token2) Note that if @token2 is not NULL, then (X, NULL) won't match to follow # the semantic of XSD ##other
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the first input string associated to that transition |
| token2: | the second input string associated to that transition |
| data: | data passed to the callback function if the transition is activated |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewOnceTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and whose number is between @min and @max, moreover that transition can only be crossed once.
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the input string associated to that transition |
| min: | the minimum successive occurrences of token |
| max: | the maximum successive occurrences of token |
| data: | data associated to the transition |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and @token2 and whose number is between @min and @max, moreover that transition can only be crossed once.
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the input string associated to that transition |
| token2: | the second input string associated to that transition |
| min: | the minimum successive occurrences of token |
| max: | the maximum successive occurrences of token |
| data: | data associated to the transition |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewState (xmlAutomataPtr am)
Create a new disconnected state in the automata
| am: | an automata |
| Returns: | the new state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewTransition (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by the value of @token
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the input string associated to that transition |
| data: | data passed to the callback function if the transition is activated |
| Returns: | the target state or NULL in case of error |
xmlAutomataStatePtr xmlAutomataNewTransition2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data)
If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by the value of @token
| am: | an automata |
| from: | the starting point of the transition |
| to: | the target point of the transition or NULL |
| token: | the first input string associated to that transition |
| token2: | the second input string associated to that transition |
| data: | data passed to the callback function if the transition is activated |
| Returns: | the target state or NULL in case of error |
int xmlAutomataSetFinalState (xmlAutomataPtr am,
xmlAutomataStatePtr state)
Makes that state a final state
| am: | an automata |
| state: | a state in this automata |
| Returns: | 0 or -1 in case of error |
xmlAutomataPtr xmlNewAutomata (void)
Create a new automata
| Returns: | the new object or NULL in case of failure |
| libxml2 Reference Manual |
|---|
xmlmodule - dynamic module loading
basic API for dynamic module loading, used by libexslt added in 2.6.17
Author(s): Joel W. Reed
typedef struct _xmlModule xmlModule; typedef enum xmlModuleOption; typedef xmlModule * xmlModulePtr; int xmlModuleClose (xmlModulePtr module); int xmlModuleFree (xmlModulePtr module); xmlModulePtr xmlModuleOpen (const char * name,
int options); int xmlModuleSymbol (xmlModulePtr module,
const char * name,
void ** symbol);
struct _xmlModule {
The content of this structure is not made public by the API.
} xmlModule;
enum xmlModuleOption { XML_MODULE_LAZY = 1 /* lazy binding */ XML_MODULE_LOCAL = 2 /* local binding */ };
int xmlModuleClose (xmlModulePtr module)
The close operations unload the associated module and free the data associated to the module.
| module: | the module handle |
| Returns: | 0 in case of success, -1 in case of argument error and -2 if the module could not be closed/unloaded. |
int xmlModuleFree (xmlModulePtr module)
The free operations free the data associated to the module but does not unload the associated shared library which may still be in use.
| module: | the module handle |
| Returns: | 0 in case of success, -1 in case of argument error |
xmlModulePtr xmlModuleOpen (const char * name,
int options)
Opens a module/shared library given its name or path NOTE: that due to portability issues, behaviour can only be guaranteed with @name using ASCII. We cannot guarantee that an UTF-8 string would work, which is why name is a const char * and not a const xmlChar * . TODO: options are not yet implemented.
| name: | the module name |
| options: | a set of xmlModuleOption |
| Returns: | a handle for the module or NULL in case of error |
int xmlModuleSymbol (xmlModulePtr module,
const char * name,
void ** symbol)
Lookup for a symbol address in the given module NOTE: that due to portability issues, behaviour can only be guaranteed with @name using ASCII. We cannot guarantee that an UTF-8 string would work, which is why name is a const char * and not a const xmlChar * .
| module: | the module |
| name: | the name of the symbol |
| symbol: | the resulting symbol address |
| Returns: | 0 if the symbol was found, or -1 in case of error |
| libxml2 Reference Manual |
|---|
encoding - interface for the encoding conversion functions
interface for the encoding conversion functions needed for XML basic encoding and iconv() support. Related specs are rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies [ISO-10646] UTF-8 and UTF-16 in Annexes [ISO-8859-1] ISO Latin-1 characters codes. [UNICODE] The Unicode Consortium, "The Unicode Standard -- Worldwide Character Encoding -- Version 1.0", Addison- Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is described in Unicode Technical Report #4. [US-ASCII] Coded Character Set--7-bit American Standard Code for Information Interchange, ANSI X3.4-1986.
Author(s): Daniel Veillard
typedef enum xmlCharEncoding; typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; typedef xmlCharEncodingHandler * xmlCharEncodingHandlerPtr; int UTF8Toisolat1 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen); int isolat1ToUTF8 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen); int xmlAddEncodingAlias (const char * name,
const char * alias); int xmlCharEncCloseFunc (xmlCharEncodingHandler * handler); int xmlCharEncFirstLine (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in); int xmlCharEncInFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in); int xmlCharEncOutFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in); typedef int xmlCharEncodingInputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen); typedef int xmlCharEncodingOutputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen); void xmlCleanupCharEncodingHandlers (void); void xmlCleanupEncodingAliases (void); int xmlDelEncodingAlias (const char * alias); xmlCharEncoding xmlDetectCharEncoding (const unsigned char * in,
int len); xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler (const char * name); xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler (xmlCharEncoding enc); const char * xmlGetCharEncodingName (xmlCharEncoding enc); const char * xmlGetEncodingAlias (const char * alias); void xmlInitCharEncodingHandlers (void); xmlCharEncodingHandlerPtr xmlNewCharEncodingHandler (const char * name,
xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output); xmlCharEncoding xmlParseCharEncoding (const char * name); void xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
enum xmlCharEncoding { XML_CHAR_ENCODING_ERROR = -1 /* No char encoding detected */ XML_CHAR_ENCODING_NONE = 0 /* No char encoding detected */ XML_CHAR_ENCODING_UTF8 = 1 /* UTF-8 */ XML_CHAR_ENCODING_UTF16LE = 2 /* UTF-16 little endian */ XML_CHAR_ENCODING_UTF16BE = 3 /* UTF-16 big endian */ XML_CHAR_ENCODING_UCS4LE = 4 /* UCS-4 little endian */ XML_CHAR_ENCODING_UCS4BE = 5 /* UCS-4 big endian */ XML_CHAR_ENCODING_EBCDIC = 6 /* EBCDIC uh! */ XML_CHAR_ENCODING_UCS4_2143 = 7 /* UCS-4 unusual ordering */ XML_CHAR_ENCODING_UCS4_3412 = 8 /* UCS-4 unusual ordering */ XML_CHAR_ENCODING_UCS2 = 9 /* UCS-2 */ XML_CHAR_ENCODING_8859_1 = 10 /* ISO-8859-1 ISO Latin 1 */ XML_CHAR_ENCODING_8859_2 = 11 /* ISO-8859-2 ISO Latin 2 */ XML_CHAR_ENCODING_8859_3 = 12 /* ISO-8859-3 */ XML_CHAR_ENCODING_8859_4 = 13 /* ISO-8859-4 */ XML_CHAR_ENCODING_8859_5 = 14 /* ISO-8859-5 */ XML_CHAR_ENCODING_8859_6 = 15 /* ISO-8859-6 */ XML_CHAR_ENCODING_8859_7 = 16 /* ISO-8859-7 */ XML_CHAR_ENCODING_8859_8 = 17 /* ISO-8859-8 */ XML_CHAR_ENCODING_8859_9 = 18 /* ISO-8859-9 */ XML_CHAR_ENCODING_2022_JP = 19 /* ISO-2022-JP */ XML_CHAR_ENCODING_SHIFT_JIS = 20 /* Shift_JIS */ XML_CHAR_ENCODING_EUC_JP = 21 /* EUC-JP */ XML_CHAR_ENCODING_ASCII = 22 /* pure ASCII */ };
struct _xmlCharEncodingHandler {
char * name
xmlCharEncodingInputFunc input
xmlCharEncodingOutputFunc output
iconv_t iconv_in
iconv_t iconv_out
struct _uconv_t * uconv_in
struct _uconv_t * uconv_out
} xmlCharEncodingHandler;
xmlCharEncodingHandler * xmlCharEncodingHandlerPtr;
int xmlCharEncodingInputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.
| out: | a pointer to an array of bytes to store the UTF-8 result |
| outlen: | the length of @out |
| in: | a pointer to an array of chars in the original encoding |
| inlen: | the length of @in |
| Returns: | the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets consumed. |
int xmlCharEncodingOutputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.
| out: | a pointer to an array of bytes to store the result |
| outlen: | the length of @out |
| in: | a pointer to an array of UTF-8 chars |
| inlen: | the length of @in |
| Returns: | the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced. |
int UTF8Toisolat1 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.
| out: | a pointer to an array of bytes to store the result |
| outlen: | the length of @out |
| in: | a pointer to an array of UTF-8 chars |
| inlen: | the length of @in |
| Returns: | the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced. |
int isolat1ToUTF8 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.
| out: | a pointer to an array of bytes to store the result |
| outlen: | the length of @out |
| in: | a pointer to an array of ISO Latin 1 chars |
| inlen: | the length of @in |
| Returns: | the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced. |
int xmlAddEncodingAlias (const char * name,
const char * alias)
Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.
| name: | the encoding name as parsed, in UTF-8 format (ASCII actually) |
| alias: | the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: | 0 in case of success, -1 in case of error |
int xmlCharEncCloseFunc (xmlCharEncodingHandler * handler)
Generic front-end for encoding handler close function
| handler: | char encoding transformation data structure |
| Returns: | 0 if success, or -1 in case of error |
int xmlCharEncFirstLine (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in)
Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.
| handler: | char encoding transformation data structure |
| out: | an xmlBuffer for the output. |
| in: | an xmlBuffer for the input |
| Returns: | the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or |
int xmlCharEncInFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in)
Generic front-end for the encoding handler input function
| handler: | char encoding transformation data structure |
| out: | an xmlBuffer for the output. |
| in: | an xmlBuffer for the input |
| Returns: | the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or |
int xmlCharEncOutFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in)
Generic front-end for the encoding handler output function a first call with @in == NULL has to be made firs to initiate the output in case of non-stateless encoding needing to initiate their state or the output (like the BOM in UTF16). In case of UTF8 sequence conversion errors for the given encoder, the content will be automatically remapped to a CharRef sequence.
| handler: | char encoding transformation data structure |
| out: | an xmlBuffer for the output. |
| in: | an xmlBuffer for the input |
| Returns: | the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or |
void xmlCleanupCharEncodingHandlers (void)
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.
int xmlDelEncodingAlias (const char * alias)
Unregisters an encoding alias @alias
| alias: | the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: | 0 in case of success, -1 in case of error |
xmlCharEncoding xmlDetectCharEncoding (const unsigned char * in,
int len)
Guess the encoding of the entity using the first bytes of the entity content according to the non-normative appendix F of the XML-1.0 recommendation.
| in: | a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). |
| len: | pointer to the length of the buffer |
| Returns: | one of the XML_CHAR_ENCODING_... values. |
xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler (const char * name)
Search in the registered set the handler able to read/write that encoding.
| name: | a string describing the char encoding. |
| Returns: | the handler or NULL if not found |
xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler (xmlCharEncoding enc)
Search in the registered set the handler able to read/write that encoding.
| enc: | an xmlCharEncoding value. |
| Returns: | the handler or NULL if not found |
const char * xmlGetCharEncodingName (xmlCharEncoding enc)
The "canonical" name for XML encoding. C.f. http://www.w3.org/TR/REC-xml#charencoding Section 4.3.3 Character Encoding in Entities
| enc: | the encoding |
| Returns: | the canonical name for the given encoding |
const char * xmlGetEncodingAlias (const char * alias)
Lookup an encoding name for the given alias.
| alias: | the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: | NULL if not found, otherwise the original name |
void xmlInitCharEncodingHandlers (void)
DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library. Initialize the char encoding support, it registers the default encoding supported. NOTE: while public, this function usually doesn't need to be called in normal processing.
xmlCharEncodingHandlerPtr xmlNewCharEncodingHandler (const char * name,
xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output)
Create and registers an xmlCharEncodingHandler.
| name: | the encoding name, in UTF-8 format (ASCII actually) |
| input: | the xmlCharEncodingInputFunc to read that encoding |
| output: | the xmlCharEncodingOutputFunc to write that encoding |
| Returns: | the xmlCharEncodingHandlerPtr created (or NULL in case of error). |
xmlCharEncoding xmlParseCharEncoding (const char * name)
Compare the string to the encoding schemes already known. Note that the comparison is case insensitive accordingly to the section [XML] 4.3.3 Character Encoding in Entities.
| name: | the encoding name as parsed, in UTF-8 format (ASCII actually) |
| Returns: | one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE if not recognized. |
void xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler)
Register the char encoding handler, surprising, isn't it ?
| handler: | the xmlCharEncodingHandlerPtr handler block |
| libxml2 Reference Manual |
|---|
globals - interface for all global variables of the library
all the global variables and thread handling for those variables is handled by this module. The bottom of this file is automatically generated by build_glob.py based on the description file global.data
Author(s): Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard
typedef struct _xmlGlobalState xmlGlobalState; typedef xmlGlobalState * xmlGlobalStatePtr; void xmlCleanupGlobals (void); xmlDeregisterNodeFunc xmlDeregisterNodeDefault (xmlDeregisterNodeFunc func); typedef void xmlDeregisterNodeFunc (xmlNodePtr node); void xmlInitGlobals (void); void xmlInitializeGlobalState (xmlGlobalStatePtr gs); xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); typedef xmlOutputBufferPtr xmlOutputBufferCreateFilenameFunc (const char * URI,
xmlCharEncodingHandlerPtr encoder,
int compression); xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); typedef xmlParserInputBufferPtr xmlParserInputBufferCreateFilenameFunc (const char * URI,
xmlCharEncoding enc); xmlRegisterNodeFunc xmlRegisterNodeDefault (xmlRegisterNodeFunc func); typedef void xmlRegisterNodeFunc (xmlNodePtr node); xmlBufferAllocationScheme xmlThrDefBufferAllocScheme (xmlBufferAllocationScheme v); int xmlThrDefDefaultBufferSize (int v); xmlDeregisterNodeFunc xmlThrDefDeregisterNodeDefault (xmlDeregisterNodeFunc func); int xmlThrDefDoValidityCheckingDefaultValue (int v); int xmlThrDefGetWarningsDefaultValue (int v); int xmlThrDefIndentTreeOutput (int v); int xmlThrDefKeepBlanksDefaultValue (int v); int xmlThrDefLineNumbersDefaultValue (int v); int xmlThrDefLoadExtDtdDefaultValue (int v); xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); int xmlThrDefParserDebugEntities (int v); xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); int xmlThrDefPedanticParserDefaultValue (int v); xmlRegisterNodeFunc xmlThrDefRegisterNodeDefault (xmlRegisterNodeFunc func); int xmlThrDefSaveNoEmptyTags (int v); void xmlThrDefSetGenericErrorFunc (void * ctx,
xmlGenericErrorFunc handler); void xmlThrDefSetStructuredErrorFunc (void * ctx,
xmlStructuredErrorFunc handler); int xmlThrDefSubstituteEntitiesDefaultValue (int v); const char * xmlThrDefTreeIndentString (const char * v);
struct _xmlGlobalState {
const char * xmlParserVersion
xmlSAXLocator xmlDefaultSAXLocator
xmlSAXHandlerV1 xmlDefaultSAXHandler
xmlSAXHandlerV1 docbDefaultSAXHandler : unused
xmlSAXHandlerV1 htmlDefaultSAXHandler
xmlFreeFunc xmlFree
xmlMallocFunc xmlMalloc
xmlStrdupFunc xmlMemStrdup
xmlReallocFunc xmlRealloc
xmlGenericErrorFunc xmlGenericError
xmlStructuredErrorFunc xmlStructuredError
void * xmlGenericErrorContext
int oldXMLWDcompatibility
xmlBufferAllocationScheme xmlBufferAllocScheme
int xmlDefaultBufferSize
int xmlSubstituteEntitiesDefaultValue
int xmlDoValidityCheckingDefaultValue
int xmlGetWarningsDefaultValue
int xmlKeepBlanksDefaultValue
int xmlLineNumbersDefaultValue
int xmlLoadExtDtdDefaultValue
int xmlParserDebugEntities
int xmlPedanticParserDefaultValue
int xmlSaveNoEmptyTags
int xmlIndentTreeOutput
const char * xmlTreeIndentString
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
xmlMallocFunc xmlMallocAtomic
xmlError xmlLastError
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
void * xmlStructuredErrorContext
} xmlGlobalState;
xmlGlobalState * xmlGlobalStatePtr;
void xmlDeregisterNodeFunc (xmlNodePtr node)
Signature for the deregistration callback of a discarded node
| node: | the current node |
xmlOutputBufferPtr xmlOutputBufferCreateFilenameFunc (const char * URI,
xmlCharEncodingHandlerPtr encoder,
int compression)
Signature for the function doing the lookup for a suitable output method corresponding to an URI.
| URI: | the URI to write to |
| encoder: | |
| compression: | |
| Returns: | the new xmlOutputBufferPtr in case of success or NULL if no method was found. |
xmlParserInputBufferPtr xmlParserInputBufferCreateFilenameFunc (const char * URI,
xmlCharEncoding enc)
Signature for the function doing the lookup for a suitable input method corresponding to an URI.
| URI: | the URI to read from |
| enc: | the requested source encoding |
| Returns: | the new xmlParserInputBufferPtr in case of success or NULL if no method was found. |
void xmlRegisterNodeFunc (xmlNodePtr node)
Signature for the registration callback of a created node
| node: | the current node |
xmlSAXHandlerV1 htmlDefaultSAXHandler;
int oldXMLWDcompatibility;
xmlBufferAllocationScheme xmlBufferAllocScheme;
int xmlDefaultBufferSize;
xmlSAXHandlerV1 xmlDefaultSAXHandler;
xmlSAXLocator xmlDefaultSAXLocator;
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
int xmlDoValidityCheckingDefaultValue;
xmlFreeFunc xmlFree;
xmlGenericErrorFunc xmlGenericError;
void * xmlGenericErrorContext;
int xmlGetWarningsDefaultValue;
int xmlIndentTreeOutput;
int xmlKeepBlanksDefaultValue;
int xmlLineNumbersDefaultValue;
int xmlLoadExtDtdDefaultValue;
xmlMallocFunc xmlMalloc;
xmlMallocFunc xmlMallocAtomic;
xmlStrdupFunc xmlMemStrdup;
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
int xmlParserDebugEntities;
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
const char * xmlParserVersion;
int xmlPedanticParserDefaultValue;
xmlReallocFunc xmlRealloc;
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
int xmlSaveNoEmptyTags;
xmlStructuredErrorFunc xmlStructuredError;
void * xmlStructuredErrorContext;
int xmlSubstituteEntitiesDefaultValue;
const char * xmlTreeIndentString;
void xmlCleanupGlobals (void)
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Additional cleanup for multi-threading
xmlDeregisterNodeFunc xmlDeregisterNodeDefault (xmlDeregisterNodeFunc func)
Registers a callback for node destruction
| func: | function pointer to the new DeregisterNodeFunc |
| Returns: | the previous value of the deregistration function |
void xmlInitGlobals (void)
DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library. Additional initialisation for multi-threading
void xmlInitializeGlobalState (xmlGlobalStatePtr gs)
xmlInitializeGlobalState() initialize a global state with all the default values of the library.
| gs: | a pointer to a newly allocated global state |
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func)
Registers a callback for URI output file handling
| func: | function pointer to the new OutputBufferCreateFilenameFunc |
| Returns: | the old value of the registration function |
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func)
Registers a callback for URI input file handling
| func: | function pointer to the new ParserInputBufferCreateFilenameFunc |
| Returns: | the old value of the registration function |
xmlRegisterNodeFunc xmlRegisterNodeDefault (xmlRegisterNodeFunc func)
Registers a callback for node creation
| func: | function pointer to the new RegisterNodeFunc |
| Returns: | the old value of the registration function |
xmlBufferAllocationScheme xmlThrDefBufferAllocScheme (xmlBufferAllocationScheme v)
| v: | |
| Returns: |
xmlDeregisterNodeFunc xmlThrDefDeregisterNodeDefault (xmlDeregisterNodeFunc func)
| func: | |
| Returns: |
int xmlThrDefDoValidityCheckingDefaultValue (int v)
| v: | |
| Returns: |
xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func)
| func: | |
| Returns: |
xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func)
| func: | |
| Returns: |
xmlRegisterNodeFunc xmlThrDefRegisterNodeDefault (xmlRegisterNodeFunc func)
| func: | |
| Returns: |
void xmlThrDefSetGenericErrorFunc (void * ctx,
xmlGenericErrorFunc handler)
| ctx: | |
| handler: |
void xmlThrDefSetStructuredErrorFunc (void * ctx,
xmlStructuredErrorFunc handler)
| ctx: | |
| handler: |
int xmlThrDefSubstituteEntitiesDefaultValue (int v)
| v: | |
| Returns: |
| libxml2 Reference Manual |
|---|
xpath - XML Path Language implementation
API for the XML Path Language implementation XML Path Language implementation XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer
Author(s): Daniel Veillard
#define XML_XPATH_CHECKNS; #define XML_XPATH_NOVAR; #define xmlXPathNodeSetGetLength(ns); #define xmlXPathNodeSetIsEmpty(ns); #define xmlXPathNodeSetItem(ns, index); typedef struct _xmlNodeSet xmlNodeSet; typedef xmlNodeSet * xmlNodeSetPtr; typedef struct _xmlXPathAxis xmlXPathAxis; typedef xmlXPathAxis * xmlXPathAxisPtr; typedef struct _xmlXPathCompExpr xmlXPathCompExpr; typedef xmlXPathCompExpr * xmlXPathCompExprPtr; typedef struct _xmlXPathContext xmlXPathContext; typedef xmlXPathContext * xmlXPathContextPtr; typedef enum xmlXPathError; typedef xmlXPathFunct * xmlXPathFuncPtr; typedef struct _xmlXPathFunct xmlXPathFunct; typedef struct _xmlXPathObject xmlXPathObject; typedef xmlXPathObject * xmlXPathObjectPtr; typedef enum xmlXPathObjectType; typedef struct _xmlXPathParserContext xmlXPathParserContext; typedef xmlXPathParserContext * xmlXPathParserContextPtr; typedef struct _xmlXPathType xmlXPathType; typedef xmlXPathType * xmlXPathTypePtr; typedef struct _xmlXPathVariable xmlXPathVariable; typedef xmlXPathVariable * xmlXPathVariablePtr; typedef xmlXPathObjectPtr xmlXPathAxisFunc (xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr cur); double xmlXPathCastBooleanToNumber (int val); xmlChar * xmlXPathCastBooleanToString (int val); int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns); double xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); xmlChar * xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); double xmlXPathCastNodeToNumber (xmlNodePtr node); xmlChar * xmlXPathCastNodeToString (xmlNodePtr node); int xmlXPathCastNumberToBoolean (double val); xmlChar * xmlXPathCastNumberToString (double val); int xmlXPathCastStringToBoolean (const xmlChar * val); double xmlXPathCastStringToNumber (const xmlChar * val); int xmlXPathCastToBoolean (xmlXPathObjectPtr val); double xmlXPathCastToNumber (xmlXPathObjectPtr val); xmlChar * xmlXPathCastToString (xmlXPathObjectPtr val); int xmlXPathCmpNodes (xmlNodePtr node1,
xmlNodePtr node2); xmlXPathCompExprPtr xmlXPathCompile (const xmlChar * str); xmlXPathObjectPtr xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctx); int xmlXPathCompiledEvalToBoolean (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctxt); int xmlXPathContextSetCache (xmlXPathContextPtr ctxt,
int active,
int value,
int options); xmlXPathObjectPtr xmlXPathConvertBoolean (xmlXPathObjectPtr val); typedef int xmlXPathConvertFunc (xmlXPathObjectPtr obj,
int type); xmlXPathObjectPtr xmlXPathConvertNumber (xmlXPathObjectPtr val); xmlXPathObjectPtr xmlXPathConvertString (xmlXPathObjectPtr val); xmlXPathCompExprPtr xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
const xmlChar * str); xmlXPathObjectPtr xmlXPathEval (const xmlChar * str,
xmlXPathContextPtr ctx); xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar * str,
xmlXPathContextPtr ctxt); typedef void xmlXPathEvalFunc (xmlXPathParserContextPtr ctxt,
int nargs); int xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
xmlXPathObjectPtr res); void xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); void xmlXPathFreeContext (xmlXPathContextPtr ctxt); void xmlXPathFreeNodeSet (xmlNodeSetPtr obj); void xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); void xmlXPathFreeObject (xmlXPathObjectPtr obj); typedef xmlXPathFunction xmlXPathFuncLookupFunc (void * ctxt,
const xmlChar * name,
const xmlChar * ns_uri); typedef void xmlXPathFunction (xmlXPathParserContextPtr ctxt,
int nargs); void xmlXPathInit (void); int xmlXPathIsInf (double val); int xmlXPathIsNaN (double val); xmlXPathContextPtr xmlXPathNewContext (xmlDocPtr doc); xmlXPathObjectPtr xmlXPathNodeEval (xmlNodePtr node,
const xmlChar * str,
xmlXPathContextPtr ctx); xmlNodeSetPtr xmlXPathNodeSetCreate (xmlNodePtr val); xmlXPathObjectPtr xmlXPathObjectCopy (xmlXPathObjectPtr val); long xmlXPathOrderDocElems (xmlDocPtr doc); int xmlXPathSetContextNode (xmlNodePtr node,
xmlXPathContextPtr ctx); typedef xmlXPathObjectPtr xmlXPathVariableLookupFunc (void * ctxt,
const xmlChar * name,
const xmlChar * ns_uri);
#define XPATH_LOCATIONSET;
#define XPATH_POINT;
#define XPATH_RANGE;
#define xmlXPathNodeSetGetLength(ns);
Implement a functionality similar to the DOM NodeList.length. Returns the number of nodes in the node-set.
| ns: | a node-set |
#define xmlXPathNodeSetIsEmpty(ns);
Checks whether @ns is empty or not. Returns %TRUE if @ns is an empty node-set.
| ns: | a node-set |
#define xmlXPathNodeSetItem(ns, index);
Implements a functionality similar to the DOM NodeList.item(). Returns the xmlNodePtr at the given @index in @ns or NULL if @index is out of range (0 to length-1)
| ns: | a node-set |
| index: | index of a node in the set |
struct _xmlNodeSet {
int nodeNr : number of nodes in the set
int nodeMax : size of the array as allocated
xmlNodePtr * nodeTab : array of nodes in no particular order @@ with_ns to check whether nam
} xmlNodeSet;
xmlNodeSet * xmlNodeSetPtr;
struct _xmlXPathAxis {
const xmlChar * name : the axis name
xmlXPathAxisFunc func : the search function
} xmlXPathAxis;
xmlXPathAxis * xmlXPathAxisPtr;
struct _xmlXPathCompExpr {
The content of this structure is not made public by the API.
} xmlXPathCompExpr;
xmlXPathCompExpr * xmlXPathCompExprPtr;
struct _xmlXPathContext {
xmlDocPtr doc : The current document
xmlNodePtr node : The current node
int nb_variables_unused : unused (hash table)
int max_variables_unused : unused (hash table)
xmlHashTablePtr varHash : Hash table of defined variables
int nb_types : number of defined types
int max_types : max number of types
xmlXPathTypePtr types : Array of defined types
int nb_funcs_unused : unused (hash table)
int max_funcs_unused : unused (hash table)
xmlHashTablePtr funcHash : Hash table of defined funcs
int nb_axis : number of defined axis
int max_axis : max number of axis
xmlXPathAxisPtr axis : Array of defined axis the namespace nodes of the context node
xmlNsPtr * namespaces : Array of namespaces
int nsNr : number of namespace in scope
void * user : function to free extra variables
int contextSize : the context size
int proximityPosition : the proximity position extra stuff for XPointer
int xptr : is this an XPointer context?
xmlNodePtr here : for here()
xmlNodePtr origin : for origin() the set of namespace declarations in scope for the expre
xmlHashTablePtr nsHash : The namespaces hash table
xmlXPathVariableLookupFunc varLookupFunc : variable lookup func
void * varLookupData : variable lookup data Possibility to link in an extra item
void * extra : needed for XSLT The function name and URI when calling a function
const xmlChar * function
const xmlChar * functionURI : function lookup function and data
xmlXPathFuncLookupFunc funcLookupFunc : function lookup func
void * funcLookupData : function lookup data temporary namespace lists kept for walking the n
xmlNsPtr * tmpNsList : Array of namespaces
int tmpNsNr : number of namespaces in scope error reporting mechanism
void * userData : user specific data block
xmlStructuredErrorFunc error : the callback in case of errors
xmlError lastError : the last error
xmlNodePtr debugNode : the source node XSLT dictionary
xmlDictPtr dict : dictionary if any
int flags : flags to control compilation Cache for reusal of XPath objects
void * cache : Resource limits
unsigned long opLimit
unsigned long opCount
int depth
} xmlXPathContext;
xmlXPathContext * xmlXPathContextPtr;
enum xmlXPathError { XPATH_EXPRESSION_OK = 0 XPATH_NUMBER_ERROR = 1 XPATH_UNFINISHED_LITERAL_ERROR = 2 XPATH_START_LITERAL_ERROR = 3 XPATH_VARIABLE_REF_ERROR = 4 XPATH_UNDEF_VARIABLE_ERROR = 5 XPATH_INVALID_PREDICATE_ERROR = 6 XPATH_EXPR_ERROR = 7 XPATH_UNCLOSED_ERROR = 8 XPATH_UNKNOWN_FUNC_ERROR = 9 XPATH_INVALID_OPERAND = 10 XPATH_INVALID_TYPE = 11 XPATH_INVALID_ARITY = 12 XPATH_INVALID_CTXT_SIZE = 13 XPATH_INVALID_CTXT_POSITION = 14 XPATH_MEMORY_ERROR = 15 XPTR_SYNTAX_ERROR = 16 XPTR_RESOURCE_ERROR = 17 XPTR_SUB_RESOURCE_ERROR = 18 XPATH_UNDEF_PREFIX_ERROR = 19 XPATH_ENCODING_ERROR = 20 XPATH_INVALID_CHAR_ERROR = 21 XPATH_INVALID_CTXT = 22 XPATH_STACK_ERROR = 23 XPATH_FORBID_VARIABLE_ERROR = 24 XPATH_OP_LIMIT_EXCEEDED = 25 XPATH_RECURSION_LIMIT_EXCEEDED = 26 };
xmlXPathFunct * xmlXPathFuncPtr;
struct _xmlXPathFunct {
const xmlChar * name : the function name
xmlXPathEvalFunc func : the evaluation function
} xmlXPathFunct;
struct _xmlXPathObject {
xmlXPathObjectType type
xmlNodeSetPtr nodesetval
int boolval
double floatval
xmlChar * stringval
void * user
int index
void * user2
int index2
} xmlXPathObject;
xmlXPathObject * xmlXPathObjectPtr;
enum xmlXPathObjectType { XPATH_UNDEFINED = 0 XPATH_NODESET = 1 XPATH_BOOLEAN = 2 XPATH_NUMBER = 3 XPATH_STRING = 4 XPATH_POINT = 5 XPATH_RANGE = 6 XPATH_LOCATIONSET = 7 XPATH_USERS = 8 XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ };
struct _xmlXPathParserContext {
const xmlChar * cur : the current char being parsed
const xmlChar * base : the full expression
int error : error code
xmlXPathContextPtr context : the evaluation context
xmlXPathObjectPtr value : the current value
int valueNr : number of values stacked
int valueMax : max number of values stacked
xmlXPathObjectPtr * valueTab : stack of values
xmlXPathCompExprPtr comp : the precompiled expression
int xptr : it this an XPointer expression
xmlNodePtr ancestor : used for walking preceding axis
int valueFrame : used to limit Pop on the stack
} xmlXPathParserContext;
xmlXPathParserContext * xmlXPathParserContextPtr;
struct _xmlXPathType {
const xmlChar * name : the type name
xmlXPathConvertFunc func : the conversion function
} xmlXPathType;
xmlXPathType * xmlXPathTypePtr;
struct _xmlXPathVariable {
const xmlChar * name : the variable name
xmlXPathObjectPtr value : the value
} xmlXPathVariable;
xmlXPathVariable * xmlXPathVariablePtr;
xmlXPathObjectPtr xmlXPathAxisFunc (xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr cur)
An axis traversal function. To traverse an axis, the engine calls the first time with cur == NULL and repeat until the function returns NULL indicating the end of the axis traversal.
| ctxt: | the XPath interpreter context |
| cur: | the previous node being explored on that axis |
| Returns: | the next node in that axis or NULL if at the end of the axis. |
int xmlXPathConvertFunc (xmlXPathObjectPtr obj,
int type)
A conversion function is associated to a type and used to cast the new type to primitive values.
| obj: | an XPath object |
| type: | the number of the target type |
| Returns: | -1 in case of error, 0 otherwise |
void xmlXPathEvalFunc (xmlXPathParserContextPtr ctxt,
int nargs)
An XPath evaluation function, the parameters are on the XPath context stack.
| ctxt: | an XPath parser context |
| nargs: | the number of arguments passed to the function |
xmlXPathFunction xmlXPathFuncLookupFunc (void * ctxt,
const xmlChar * name,
const xmlChar * ns_uri)
Prototype for callbacks used to plug function lookup in the XPath engine.
| ctxt: | an XPath context |
| name: | name of the function |
| ns_uri: | the namespace name hosting this function |
| Returns: | the XPath function or NULL if not found. |
void xmlXPathFunction (xmlXPathParserContextPtr ctxt,
int nargs)
An XPath function. The arguments (if any) are popped out from the context stack and the result is pushed on the stack.
| ctxt: | the XPath interprestation context |
| nargs: | the number of arguments |
xmlXPathObjectPtr xmlXPathVariableLookupFunc (void * ctxt,
const xmlChar * name,
const xmlChar * ns_uri)
Prototype for callbacks used to plug variable lookup in the XPath engine.
| ctxt: | an XPath context |
| name: | name of the variable |
| ns_uri: | the namespace name hosting this variable |
| Returns: | the XPath object value or NULL if not found. |
double xmlXPathNAN;
double xmlXPathNINF;
double xmlXPathPINF;
double xmlXPathCastBooleanToNumber (int val)
Converts a boolean to its number value
| val: | a boolean |
| Returns: | the number value |
xmlChar * xmlXPathCastBooleanToString (int val)
Converts a boolean to its string value.
| val: | a boolean |
| Returns: | a newly allocated string. |
int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns)
Converts a node-set to its boolean value
| ns: | a node-set |
| Returns: | the boolean value |
double xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns)
Converts a node-set to its number value
| ns: | a node-set |
| Returns: | the number value |
xmlChar * xmlXPathCastNodeSetToString (xmlNodeSetPtr ns)
Converts a node-set to its string value.
| ns: | a node-set |
| Returns: | a newly allocated string. |
double xmlXPathCastNodeToNumber (xmlNodePtr node)
Converts a node to its number value
| node: | a node |
| Returns: | the number value |
xmlChar * xmlXPathCastNodeToString (xmlNodePtr node)
Converts a node to its string value.
| node: | a node |
| Returns: | a newly allocated string. |
int xmlXPathCastNumberToBoolean (double val)
Converts a number to its boolean value
| val: | a number |
| Returns: | the boolean value |
xmlChar * xmlXPathCastNumberToString (double val)
Converts a number to its string value.
| val: | a number |
| Returns: | a newly allocated string. |
int xmlXPathCastStringToBoolean (const xmlChar * val)
Converts a string to its boolean value
| val: | a string |
| Returns: | the boolean value |
double xmlXPathCastStringToNumber (const xmlChar * val)
Converts a string to its number value
| val: | a string |
| Returns: | the number value |
int xmlXPathCastToBoolean (xmlXPathObjectPtr val)
Converts an XPath object to its boolean value
| val: | an XPath object |
| Returns: | the boolean value |
double xmlXPathCastToNumber (xmlXPathObjectPtr val)
Converts an XPath object to its number value
| val: | an XPath object |
| Returns: | the number value |
xmlChar * xmlXPathCastToString (xmlXPathObjectPtr val)
Converts an existing object to its string() equivalent
| val: | an XPath object |
| Returns: | the allocated string value of the object, NULL in case of error. It's up to the caller to free the string memory with xmlFree(). |
int xmlXPathCmpNodes (xmlNodePtr node1,
xmlNodePtr node2)
Compare two nodes w.r.t document order
| node1: | the first node |
| node2: | the second node |
| Returns: | -2 in case of error 1 if first point < second point, 0 if it's the same node, -1 otherwise |
xmlXPathCompExprPtr xmlXPathCompile (const xmlChar * str)
Compile an XPath expression
| str: | the XPath expression |
| Returns: | the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object. |
xmlXPathObjectPtr xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctx)
Evaluate the Precompiled XPath expression in the given context.
| comp: | the compiled XPath expression |
| ctx: | the XPath context |
| Returns: | the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object. |
int xmlXPathCompiledEvalToBoolean (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctxt)
Applies the XPath boolean() function on the result of the given compiled expression.
| comp: | the compiled XPath expression |
| ctxt: | the XPath context |
| Returns: | 1 if the expression evaluated to true, 0 if to false and -1 in API and internal errors. |
int xmlXPathContextSetCache (xmlXPathContextPtr ctxt,
int active,
int value,
int options)
Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect.
| ctxt: | the XPath context |
| active: | enables/disables (creates/frees) the cache |
| value: | a value with semantics dependent on @options |
| options: | options (currently only the value 0 is used) |
| Returns: | 0 if the setting succeeded, and -1 on API or internal errors. |
xmlXPathObjectPtr xmlXPathConvertBoolean (xmlXPathObjectPtr val)
Converts an existing object to its boolean() equivalent
| val: | an XPath object |
| Returns: | the new object, the old one is freed (or the operation is done directly on @val) |
xmlXPathObjectPtr xmlXPathConvertNumber (xmlXPathObjectPtr val)
Converts an existing object to its number() equivalent
| val: | an XPath object |
| Returns: | the new object, the old one is freed (or the operation is done directly on @val) |
xmlXPathObjectPtr xmlXPathConvertString (xmlXPathObjectPtr val)
Converts an existing object to its string() equivalent
| val: | an XPath object |
| Returns: | the new object, the old one is freed (or the operation is done directly on @val) |
xmlXPathCompExprPtr xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
const xmlChar * str)
Compile an XPath expression
| ctxt: | an XPath context |
| str: | the XPath expression |
| Returns: | the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object. |
xmlXPathObjectPtr xmlXPathEval (const xmlChar * str,
xmlXPathContextPtr ctx)
Evaluate the XPath Location Path in the given context.
| str: | the XPath expression |
| ctx: | the XPath context |
| Returns: | the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object. |
xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar * str,
xmlXPathContextPtr ctxt)
Alias for xmlXPathEval().
| str: | the XPath expression |
| ctxt: | the XPath context |
| Returns: | the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object. |
int xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
xmlXPathObjectPtr res)
Evaluate a predicate result for the current node. A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the position of the context node in the context node list (as returned by the position function) and will be converted to false otherwise; if the result is not a number, then the result will be converted as if by a call to the boolean function.
| ctxt: | the XPath context |
| res: | the Predicate Expression evaluation result |
| Returns: | 1 if predicate is true, 0 otherwise |
void xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp)
Free up the memory allocated by @comp
| comp: | an XPATH comp |
void xmlXPathFreeContext (xmlXPathContextPtr ctxt)
Free up an xmlXPathContext
| ctxt: | the context to free |
void xmlXPathFreeNodeSet (xmlNodeSetPtr obj)
Free the NodeSet compound (not the actual nodes !).
| obj: | the xmlNodeSetPtr to free |
void xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj)
Free up the xmlXPathObjectPtr @obj but don't deallocate the objects in the list contrary to xmlXPathFreeObject().
| obj: | an existing NodeSetList object |
void xmlXPathFreeObject (xmlXPathObjectPtr obj)
Free up an xmlXPathObjectPtr object.
| obj: | the object to free |
void xmlXPathInit (void)
DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library. Initialize the XPath environment
int xmlXPathIsInf (double val)
| val: | a double value |
| Returns: | 1 if the value is +Infinite, -1 if -Infinite, 0 otherwise |
int xmlXPathIsNaN (double val)
| val: | a double value |
| Returns: | 1 if the value is a NaN, 0 otherwise |
xmlXPathContextPtr xmlXPathNewContext (xmlDocPtr doc)
Create a new xmlXPathContext
| doc: | the XML document |
| Returns: | the xmlXPathContext just allocated. The caller will need to free it. |
xmlXPathObjectPtr xmlXPathNodeEval (xmlNodePtr node,
const xmlChar * str,
xmlXPathContextPtr ctx)
Evaluate the XPath Location Path in the given context. The node 'node' is set as the context node. The context node is not restored.
| node: | the node to to use as the context node |
| str: | the XPath expression |
| ctx: | the XPath context |
| Returns: | the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object. |
xmlNodeSetPtr xmlXPathNodeSetCreate (xmlNodePtr val)
Create a new xmlNodeSetPtr of type double and of value @val
| val: | an initial xmlNodePtr, or NULL |
| Returns: | the newly created object. |
xmlXPathObjectPtr xmlXPathObjectCopy (xmlXPathObjectPtr val)
allocate a new copy of a given object
| val: | the original object |
| Returns: | the newly created object. |
long xmlXPathOrderDocElems (xmlDocPtr doc)
Call this routine to speed up XPath computation on static documents. This stamps all the element nodes with the document order Like for line information, the order is kept in the element->content field, the value stored is actually - the node number (starting at -1) to be able to differentiate from line numbers.
| doc: | an input document |
| Returns: | the number of elements found in the document or -1 in case of error. |
int xmlXPathSetContextNode (xmlNodePtr node,
xmlXPathContextPtr ctx)
Sets 'node' as the context node. The node must be in the same document as that associated with the context.
| node: | the node to to use as the context node |
| ctx: | the XPath context |
| Returns: | -1 in case of error or 0 if successful |
| libxml2 Reference Manual |
|---|
Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), it is free software available under the MIT License. XML itself is a metalanguage to design markup languages, i.e. text language where semantic and structure are added to the content using extra "markup" information enclosed between angle brackets. HTML is the most well-known markup language. Though the library is written in C, a variety of language bindings make it available in other environments.
Libxml2 implements a number of existing standards related to markup languages:
| libxml2 Reference Manual |
|---|
schematron - XML Schematron implementation
interface to the XML Schematron validity checking.
Author(s): Daniel Veillard
typedef struct _xmlSchematron xmlSchematron; typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt; typedef xmlSchematronParserCtxt * xmlSchematronParserCtxtPtr; typedef xmlSchematron * xmlSchematronPtr; typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt; typedef xmlSchematronValidCtxt * xmlSchematronValidCtxtPtr; typedef enum xmlSchematronValidOptions; void xmlSchematronFree (xmlSchematronPtr schema); void xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); void xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); xmlSchematronParserCtxtPtr xmlSchematronNewDocParserCtxt (xmlDocPtr doc); xmlSchematronParserCtxtPtr xmlSchematronNewMemParserCtxt (const char * buffer,
int size); xmlSchematronParserCtxtPtr xmlSchematronNewParserCtxt (const char * URL); xmlSchematronValidCtxtPtr xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
int options); xmlSchematronPtr xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); void xmlSchematronSetValidStructuredErrors (xmlSchematronValidCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx); int xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
xmlDocPtr instance); typedef void xmlSchematronValidityErrorFunc (void * ctx,
const char * msg,
... ...); typedef void xmlSchematronValidityWarningFunc (void * ctx,
const char * msg,
... ...);
struct _xmlSchematron {
The content of this structure is not made public by the API.
} xmlSchematron;
struct _xmlSchematronParserCtxt {
The content of this structure is not made public by the API.
} xmlSchematronParserCtxt;
xmlSchematronParserCtxt * xmlSchematronParserCtxtPtr;
xmlSchematron * xmlSchematronPtr;
struct _xmlSchematronValidCtxt {
The content of this structure is not made public by the API.
} xmlSchematronValidCtxt;
xmlSchematronValidCtxt * xmlSchematronValidCtxtPtr;
enum xmlSchematronValidOptions { XML_SCHEMATRON_OUT_QUIET = 1 /* quiet no report */ XML_SCHEMATRON_OUT_TEXT = 2 /* build a textual report */ XML_SCHEMATRON_OUT_XML = 4 /* output SVRL */ XML_SCHEMATRON_OUT_ERROR = 8 /* output via xmlStructuredErrorFunc */ XML_SCHEMATRON_OUT_FILE = 256 /* output to a file descriptor */ XML_SCHEMATRON_OUT_BUFFER = 512 /* output to a buffer */ XML_SCHEMATRON_OUT_IO = 1024 /* output to I/O mechanism */ };
void xmlSchematronValidityErrorFunc (void * ctx,
const char * msg,
... ...)
Signature of an error callback from a Schematron validation
| ctx: | the validation context |
| msg: | the message |
| ...: | extra arguments |
void xmlSchematronValidityWarningFunc (void * ctx,
const char * msg,
... ...)
Signature of a warning callback from a Schematron validation
| ctx: | the validation context |
| msg: | the message |
| ...: | extra arguments |
void xmlSchematronFree (xmlSchematronPtr schema)
Deallocate a Schematron structure.
| schema: | a schema structure |
void xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt)
Free the resources associated to the schema parser context
| ctxt: | the schema parser context |
void xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt)
Free the resources associated to the schema validation context
| ctxt: | the schema validation context |
xmlSchematronParserCtxtPtr xmlSchematronNewDocParserCtxt (xmlDocPtr doc)
Create an XML Schematrons parse context for that document. NB. The document may be modified during the parsing process.
| doc: | a preparsed document tree |
| Returns: | the parser context or NULL in case of error |
xmlSchematronParserCtxtPtr xmlSchematronNewMemParserCtxt (const char * buffer,
int size)
Create an XML Schematrons parse context for that memory buffer expected to contain an XML Schematrons file.
| buffer: | a pointer to a char array containing the schemas |
| size: | the size of the array |
| Returns: | the parser context or NULL in case of error |
xmlSchematronParserCtxtPtr xmlSchematronNewParserCtxt (const char * URL)
Create an XML Schematrons parse context for that file/resource expected to contain an XML Schematrons file.
| URL: | the location of the schema |
| Returns: | the parser context or NULL in case of error |
xmlSchematronValidCtxtPtr xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
int options)
Create an XML Schematrons validation context based on the given schema.
| schema: | a precompiled XML Schematrons |
| options: | a set of xmlSchematronValidOptions |
| Returns: | the validation context or NULL in case of error |
xmlSchematronPtr xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt)
parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.
| ctxt: | a schema validation context |
| Returns: | the internal XML Schematron structure built from the resource or NULL in case of error |
void xmlSchematronSetValidStructuredErrors (xmlSchematronValidCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx)
Set the structured error callback
| ctxt: | a Schematron validation context |
| serror: | the structured error function |
| ctx: | the functions context |
int xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
xmlDocPtr instance)
Validate a tree instance against the schematron
| ctxt: | the schema validation context |
| instance: | the document instance tree |
| Returns: | 0 in case of success, -1 in case of internal error and an error count otherwise. |
| libxml2 Reference Manual |
|---|
debugXML - Tree debugging APIs
Interfaces to a set of routines used for debugging the tree produced by the XML parser.
Author(s): Daniel Veillard
typedef struct _xmlShellCtxt xmlShellCtxt; typedef xmlShellCtxt * xmlShellCtxtPtr; const char * xmlBoolToText (int boolval); int xmlDebugCheckDocument (FILE * output,
xmlDocPtr doc); void xmlDebugDumpAttr (FILE * output,
xmlAttrPtr attr,
int depth); void xmlDebugDumpAttrList (FILE * output,
xmlAttrPtr attr,
int depth); void xmlDebugDumpDTD (FILE * output,
xmlDtdPtr dtd); void xmlDebugDumpDocument (FILE * output,
xmlDocPtr doc); void xmlDebugDumpDocumentHead (FILE * output,
xmlDocPtr doc); void xmlDebugDumpEntities (FILE * output,
xmlDocPtr doc); void xmlDebugDumpNode (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpNodeList (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpOneNode (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpString (FILE * output,
const xmlChar * str); int xmlLsCountNode (xmlNodePtr node); void xmlLsOneNode (FILE * output,
xmlNodePtr node); void xmlShell (xmlDocPtr doc,
char * filename,
xmlShellReadlineFunc input,
FILE * output); int xmlShellBase (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellCat (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); typedef int xmlShellCmd (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellDir (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellDu (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr tree,
xmlNodePtr node2); int xmlShellList (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellLoad (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2); void xmlShellPrintNode (xmlNodePtr node); void xmlShellPrintXPathError (int errorType,
const char * arg); void xmlShellPrintXPathResult (xmlXPathObjectPtr list); int xmlShellPwd (xmlShellCtxtPtr ctxt,
char * buffer,
xmlNodePtr node,
xmlNodePtr node2); typedef char * xmlShellReadlineFunc (char * prompt); int xmlShellSave (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellValidate (xmlShellCtxtPtr ctxt,
char * dtd,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellWrite (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2);
struct _xmlShellCtxt {
char * filename
xmlDocPtr doc
xmlNodePtr node
xmlXPathContextPtr pctxt
int loaded
FILE * output
xmlShellReadlineFunc input
} xmlShellCtxt;
xmlShellCtxt * xmlShellCtxtPtr;
int xmlShellCmd (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2)
This is a generic signature for the XML shell functions.
| ctxt: | a shell context |
| arg: | a string argument |
| node: | a first node |
| node2: | a second node |
| Returns: | an int, negative returns indicating errors. |
char * xmlShellReadlineFunc (char * prompt)
This is a generic signature for the XML shell input function.
| prompt: | a string prompt |
| Returns: | a string which will be freed by the Shell. |
const char * xmlBoolToText (int boolval)
Convenient way to turn bool into text
| boolval: | a bool to turn into text |
| Returns: | a pointer to either "True" or "False" |
int xmlDebugCheckDocument (FILE * output,
xmlDocPtr doc)
Check the document for potential content problems, and output the errors to @output
| output: | the FILE * for the output |
| doc: | the document |
| Returns: | the number of errors found |
void xmlDebugDumpAttr (FILE * output,
xmlAttrPtr attr,
int depth)
Dumps debug information for the attribute
| output: | the FILE * for the output |
| attr: | the attribute |
| depth: | the indentation level. |
void xmlDebugDumpAttrList (FILE * output,
xmlAttrPtr attr,
int depth)
Dumps debug information for the attribute list
| output: | the FILE * for the output |
| attr: | the attribute list |
| depth: | the indentation level. |
void xmlDebugDumpDTD (FILE * output,
xmlDtdPtr dtd)
Dumps debug information for the DTD
| output: | the FILE * for the output |
| dtd: | the DTD |
void xmlDebugDumpDocument (FILE * output,
xmlDocPtr doc)
Dumps debug information for the document, it's recursive
| output: | the FILE * for the output |
| doc: | the document |
void xmlDebugDumpDocumentHead (FILE * output,
xmlDocPtr doc)
Dumps debug information concerning the document, not recursive
| output: | the FILE * for the output |
| doc: | the document |
void xmlDebugDumpEntities (FILE * output,
xmlDocPtr doc)
Dumps debug information for all the entities in use by the document
| output: | the FILE * for the output |
| doc: | the document |
void xmlDebugDumpNode (FILE * output,
xmlNodePtr node,
int depth)
Dumps debug information for the element node, it is recursive
| output: | the FILE * for the output |
| node: | the node |
| depth: | the indentation level. |
void xmlDebugDumpNodeList (FILE * output,
xmlNodePtr node,
int depth)
Dumps debug information for the list of element node, it is recursive
| output: | the FILE * for the output |
| node: | the node list |
| depth: | the indentation level. |
void xmlDebugDumpOneNode (FILE * output,
xmlNodePtr node,
int depth)
Dumps debug information for the element node, it is not recursive
| output: | the FILE * for the output |
| node: | the node |
| depth: | the indentation level. |
void xmlDebugDumpString (FILE * output,
const xmlChar * str)
Dumps information about the string, shorten it if necessary
| output: | the FILE * for the output |
| str: | the string |
int xmlLsCountNode (xmlNodePtr node)
Count the children of @node.
| node: | the node to count |
| Returns: | the number of children of @node. |
void xmlLsOneNode (FILE * output,
xmlNodePtr node)
Dump to @output the type and name of @node.
| output: | the FILE * for the output |
| node: | the node to dump |
void xmlShell (xmlDocPtr doc,
char * filename,
xmlShellReadlineFunc input,
FILE * output)
Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.
| doc: | the initial document |
| filename: | the output buffer |
| input: | the line reading function |
| output: | the output FILE*, defaults to stdout if NULL |
int xmlShellBase (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "base" dumps the current XML base of the node
| ctxt: | the shell context |
| arg: | unused |
| node: | a node |
| node2: | unused |
| Returns: | 0 |
int xmlShellCat (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "cat" dumps the serialization node content (XML or HTML).
| ctxt: | the shell context |
| arg: | unused |
| node: | a node |
| node2: | unused |
| Returns: | 0 |
int xmlShellDir (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).
| ctxt: | the shell context |
| arg: | unused |
| node: | a node |
| node2: | unused |
| Returns: | 0 |
int xmlShellDu (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr tree,
xmlNodePtr node2)
Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.
| ctxt: | the shell context |
| arg: | unused |
| tree: | a node defining a subtree |
| node2: | unused |
| Returns: | 0 or -1 in case of error |
int xmlShellList (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "ls" Does an Unix like listing of the given node (like a directory)
| ctxt: | the shell context |
| arg: | unused |
| node: | a node |
| node2: | unused |
| Returns: | 0 |
int xmlShellLoad (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "load" loads a new document specified by the filename
| ctxt: | the shell context |
| filename: | the file name |
| node: | unused |
| node2: | unused |
| Returns: | 0 or -1 if loading failed |
void xmlShellPrintNode (xmlNodePtr node)
Print node to the output FILE
| node: | a non-null node to print to the output FILE |
void xmlShellPrintXPathError (int errorType,
const char * arg)
Print the xpath error to libxml default error channel
| errorType: | valid xpath error id |
| arg: | the argument that cause xpath to fail |
void xmlShellPrintXPathResult (xmlXPathObjectPtr list)
Prints result to the output FILE
| list: | a valid result generated by an xpath evaluation |
int xmlShellPwd (xmlShellCtxtPtr ctxt,
char * buffer,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "pwd" Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.
| ctxt: | the shell context |
| buffer: | the output buffer |
| node: | a node |
| node2: | unused |
| Returns: | 0 or -1 in case of error |
int xmlShellSave (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "save" Write the current document to the filename, or it's original name
| ctxt: | the shell context |
| filename: | the file name (optional) |
| node: | unused |
| node2: | unused |
| Returns: | 0 or -1 in case of error |
int xmlShellValidate (xmlShellCtxtPtr ctxt,
char * dtd,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "validate" Validate the document, if a DTD path is provided, then the validation is done against the given DTD.
| ctxt: | the shell context |
| dtd: | the DTD URI (optional) |
| node: | unused |
| node2: | unused |
| Returns: | 0 or -1 in case of error |
int xmlShellWrite (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2)
Implements the XML shell function "write" Write the current node to the filename, it saves the serialization of the subtree under the @node specified
| ctxt: | the shell context |
| filename: | the file name |
| node: | a node in the tree |
| node2: | unused |
| Returns: | 0 or -1 in case of error |
| libxml2 Reference Manual |
|---|
xmlstring - set of routines to process strings
type and interfaces needed for the internal string handling of the library, especially UTF8 processing.
Author(s): Daniel Veillard
#define BAD_CAST; typedef unsigned char xmlChar; xmlChar * xmlCharStrdup (const char * cur); xmlChar * xmlCharStrndup (const char * cur,
int len); int xmlCheckUTF8 (const unsigned char * utf); int xmlGetUTF8Char (const unsigned char * utf,
int * len); int xmlStrEqual (const xmlChar * str1,
const xmlChar * str2); int xmlStrPrintf (xmlChar * buf,
int len,
const char * msg,
... ...); int xmlStrQEqual (const xmlChar * pref,
const xmlChar * name,
const xmlChar * str); int xmlStrVPrintf (xmlChar * buf,
int len,
const char * msg,
va_list ap); int xmlStrcasecmp (const xmlChar * str1,
const xmlChar * str2); const xmlChar * xmlStrcasestr (const xmlChar * str,
const xmlChar * val); xmlChar * xmlStrcat (xmlChar * cur,
const xmlChar * add); const xmlChar * xmlStrchr (const xmlChar * str,
xmlChar val); int xmlStrcmp (const xmlChar * str1,
const xmlChar * str2); xmlChar * xmlStrdup (const xmlChar * cur); int xmlStrlen (const xmlChar * str); int xmlStrncasecmp (const xmlChar * str1,
const xmlChar * str2,
int len); xmlChar * xmlStrncat (xmlChar * cur,
const xmlChar * add,
int len); xmlChar * xmlStrncatNew (const xmlChar * str1,
const xmlChar * str2,
int len); int xmlStrncmp (const xmlChar * str1,
const xmlChar * str2,
int len); xmlChar * xmlStrndup (const xmlChar * cur,
int len); const xmlChar * xmlStrstr (const xmlChar * str,
const xmlChar * val); xmlChar * xmlStrsub (const xmlChar * str,
int start,
int len); int xmlUTF8Charcmp (const xmlChar * utf1,
const xmlChar * utf2); int xmlUTF8Size (const xmlChar * utf); int xmlUTF8Strlen (const xmlChar * utf); int xmlUTF8Strloc (const xmlChar * utf,
const xmlChar * utfchar); xmlChar * xmlUTF8Strndup (const xmlChar * utf,
int len); const xmlChar * xmlUTF8Strpos (const xmlChar * utf,
int pos); int xmlUTF8Strsize (const xmlChar * utf,
int len); xmlChar * xmlUTF8Strsub (const xmlChar * utf,
int start,
int len);
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).
xmlChar * xmlCharStrdup (const char * cur)
a strdup for char's to xmlChar's
| cur: | the input char * |
| Returns: | a new xmlChar * or NULL |
xmlChar * xmlCharStrndup (const char * cur,
int len)
a strndup for char's to xmlChar's
| cur: | the input char * |
| len: | the len of @cur |
| Returns: | a new xmlChar * or NULL |
int xmlCheckUTF8 (const unsigned char * utf)
Checks @utf for being valid UTF-8. @utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer UTF-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value.
| utf: | Pointer to putative UTF-8 encoded string. |
| Returns: | value: true if @utf is valid. |
int xmlGetUTF8Char (const unsigned char * utf,
int * len)
Read the first UTF8 character from @utf
| utf: | a sequence of UTF-8 encoded bytes |
| len: | a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. |
| Returns: | the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error) |
int xmlStrEqual (const xmlChar * str1,
const xmlChar * str2)
Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp()
int xmlStrPrintf (xmlChar * buf,
int len,
const char * msg,
... ...)
Formats @msg and places result into @buf.
| buf: | the result buffer. |
| len: | the result buffer length. |
| msg: | the message with printf formatting. |
| ...: | extra parameters for the message. |
| Returns: | the number of characters written to @buf or -1 if an error occurs. |
int xmlStrQEqual (const xmlChar * pref,
const xmlChar * name,
const xmlChar * str)
Check if a QName is Equal to a given string
| pref: | the prefix of the QName |
| name: | the localname of the QName |
| str: | the second xmlChar * |
| Returns: | 1 if they are equal, 0 if they are different |
int xmlStrVPrintf (xmlChar * buf,
int len,
const char * msg,
va_list ap)
Formats @msg and places result into @buf.
| buf: | the result buffer. |
| len: | the result buffer length. |
| msg: | the message with printf formatting. |
| ap: | extra parameters for the message. |
| Returns: | the number of characters written to @buf or -1 if an error occurs. |
int xmlStrcasecmp (const xmlChar * str1,
const xmlChar * str2)
a strcasecmp for xmlChar's
const xmlChar * xmlStrcasestr (const xmlChar * str,
const xmlChar * val)
a case-ignoring strstr for xmlChar's
xmlChar * xmlStrcat (xmlChar * cur,
const xmlChar * add)
a strcat for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
xmlChar * xmlStrdup (const xmlChar * cur)
a strdup for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
int xmlStrncasecmp (const xmlChar * str1,
const xmlChar * str2,
int len)
a strncasecmp for xmlChar's
xmlChar * xmlStrncat (xmlChar * cur,
const xmlChar * add,
int len)
a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned.
xmlChar * xmlStrncatNew (const xmlChar * str1,
const xmlChar * str2,
int len)
same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically.
int xmlStrncmp (const xmlChar * str1,
const xmlChar * str2,
int len)
a strncmp for xmlChar's
const xmlChar * xmlStrstr (const xmlChar * str,
const xmlChar * val)
a strstr for xmlChar's
xmlChar * xmlStrsub (const xmlChar * str,
int start,
int len)
Extract a substring of a given string
int xmlUTF8Charcmp (const xmlChar * utf1,
const xmlChar * utf2)
compares the two UCS4 values
| utf1: | pointer to first UTF8 char |
| utf2: | pointer to second UTF8 char |
| Returns: | result of the compare as with xmlStrncmp |
int xmlUTF8Size (const xmlChar * utf)
calculates the internal size of a UTF8 character
| utf: | pointer to the UTF8 character |
| Returns: | the numbers of bytes in the character, -1 on format error |
int xmlUTF8Strlen (const xmlChar * utf)
compute the length of an UTF8 string, it doesn't do a full UTF8 checking of the content of the string.
| utf: | a sequence of UTF-8 encoded bytes |
| Returns: | the number of characters in the string or -1 in case of error |
int xmlUTF8Strloc (const xmlChar * utf,
const xmlChar * utfchar)
a function to provide the relative location of a UTF8 char
| utf: | the input UTF8 * |
| utfchar: | the UTF8 character to be found |
| Returns: | the relative character position of the desired char or -1 if not found |
xmlChar * xmlUTF8Strndup (const xmlChar * utf,
int len)
a strndup for array of UTF8's
| utf: | the input UTF8 * |
| len: | the len of @utf (in chars) |
| Returns: | a new UTF8 * or NULL |
const xmlChar * xmlUTF8Strpos (const xmlChar * utf,
int pos)
a function to provide the equivalent of fetching a character from a string array
| utf: | the input UTF8 * |
| pos: | the position of the desired UTF8 char (in chars) |
| Returns: | a pointer to the UTF8 character or NULL |
int xmlUTF8Strsize (const xmlChar * utf,
int len)
storage size of an UTF8 string the behaviour is not guaranteed if the input string is not UTF-8
| utf: | a sequence of UTF-8 encoded bytes |
| len: | the number of characters in the array |
| Returns: | the storage size of the first 'len' characters of ARRAY |
xmlChar * xmlUTF8Strsub (const xmlChar * utf,
int start,
int len)
Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars
| utf: | a sequence of UTF-8 encoded bytes |
| start: | relative pos of first char |
| len: | total number to copy |
| Returns: | a pointer to a newly created string or NULL if any problem |
| libxml2 Reference Manual |
|---|
xmlwriter - text writing API for XML
text writing API for XML
Author(s): Alfred Mickautsch <alfred@mickautsch.de>
#define xmlTextWriterWriteDocType; #define xmlTextWriterWriteProcessingInstruction; typedef struct _xmlTextWriter xmlTextWriter; typedef xmlTextWriter * xmlTextWriterPtr; void xmlFreeTextWriter (xmlTextWriterPtr writer); xmlTextWriterPtr xmlNewTextWriter (xmlOutputBufferPtr out); xmlTextWriterPtr xmlNewTextWriterDoc (xmlDocPtr * doc,
int compression); xmlTextWriterPtr xmlNewTextWriterFilename (const char * uri,
int compression); xmlTextWriterPtr xmlNewTextWriterMemory (xmlBufferPtr buf,
int compression); xmlTextWriterPtr xmlNewTextWriterPushParser (xmlParserCtxtPtr ctxt,
int compression); xmlTextWriterPtr xmlNewTextWriterTree (xmlDocPtr doc,
xmlNodePtr node,
int compression); int xmlTextWriterEndAttribute (xmlTextWriterPtr writer); int xmlTextWriterEndCDATA (xmlTextWriterPtr writer); int xmlTextWriterEndComment (xmlTextWriterPtr writer); int xmlTextWriterEndDTD (xmlTextWriterPtr writer); int xmlTextWriterEndDTDAttlist (xmlTextWriterPtr writer); int xmlTextWriterEndDTDElement (xmlTextWriterPtr writer); int xmlTextWriterEndDTDEntity (xmlTextWriterPtr writer); int xmlTextWriterEndDocument (xmlTextWriterPtr writer); int xmlTextWriterEndElement (xmlTextWriterPtr writer); int xmlTextWriterEndPI (xmlTextWriterPtr writer); int xmlTextWriterFlush (xmlTextWriterPtr writer); int xmlTextWriterFullEndElement (xmlTextWriterPtr writer); int xmlTextWriterSetIndent (xmlTextWriterPtr writer,
int indent); int xmlTextWriterSetIndentString (xmlTextWriterPtr writer,
const xmlChar * str); int xmlTextWriterSetQuoteChar (xmlTextWriterPtr writer,
xmlChar quotechar); int xmlTextWriterStartAttribute (xmlTextWriterPtr writer,
const xmlChar * name); int xmlTextWriterStartAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI); int xmlTextWriterStartCDATA (xmlTextWriterPtr writer); int xmlTextWriterStartComment (xmlTextWriterPtr writer); int xmlTextWriterStartDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid); int xmlTextWriterStartDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name); int xmlTextWriterStartDTDElement (xmlTextWriterPtr writer,
const xmlChar * name); int xmlTextWriterStartDTDEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name); int xmlTextWriterStartDocument (xmlTextWriterPtr writer,
const char * version,
const char * encoding,
const char * standalone); int xmlTextWriterStartElement (xmlTextWriterPtr writer,
const xmlChar * name); int xmlTextWriterStartElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI); int xmlTextWriterStartPI (xmlTextWriterPtr writer,
const xmlChar * target); int xmlTextWriterWriteAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content); int xmlTextWriterWriteAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content); int xmlTextWriterWriteBase64 (xmlTextWriterPtr writer,
const char * data,
int start,
int len); int xmlTextWriterWriteBinHex (xmlTextWriterPtr writer,
const char * data,
int start,
int len); int xmlTextWriterWriteCDATA (xmlTextWriterPtr writer,
const xmlChar * content); int xmlTextWriterWriteComment (xmlTextWriterPtr writer,
const xmlChar * content); int xmlTextWriterWriteDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * subset); int xmlTextWriterWriteDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content); int xmlTextWriterWriteDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content); int xmlTextWriterWriteDTDEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid,
const xmlChar * content); int xmlTextWriterWriteDTDExternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid); int xmlTextWriterWriteDTDExternalEntityContents (xmlTextWriterPtr writer,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid); int xmlTextWriterWriteDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * content); int xmlTextWriterWriteDTDNotation (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid); int xmlTextWriterWriteElement (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content); int xmlTextWriterWriteElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content); int xmlTextWriterWriteFormatAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...); int xmlTextWriterWriteFormatAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... ...); int xmlTextWriterWriteFormatCDATA (xmlTextWriterPtr writer,
const char * format,
... ...); int xmlTextWriterWriteFormatComment (xmlTextWriterPtr writer,
const char * format,
... ...); int xmlTextWriterWriteFormatDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
... ...); int xmlTextWriterWriteFormatDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...); int xmlTextWriterWriteFormatDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...); int xmlTextWriterWriteFormatDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const char * format,
... ...); int xmlTextWriterWriteFormatElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...); int xmlTextWriterWriteFormatElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... ...); int xmlTextWriterWriteFormatPI (xmlTextWriterPtr writer,
const xmlChar * target,
const char * format,
... ...); int xmlTextWriterWriteFormatRaw (xmlTextWriterPtr writer,
const char * format,
... ...); int xmlTextWriterWriteFormatString (xmlTextWriterPtr writer,
const char * format,
... ...); int xmlTextWriterWritePI (xmlTextWriterPtr writer,
const xmlChar * target,
const xmlChar * content); int xmlTextWriterWriteRaw (xmlTextWriterPtr writer,
const xmlChar * content); int xmlTextWriterWriteRawLen (xmlTextWriterPtr writer,
const xmlChar * content,
int len); int xmlTextWriterWriteString (xmlTextWriterPtr writer,
const xmlChar * content); int xmlTextWriterWriteVFormatAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatCDATA (xmlTextWriterPtr writer,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatComment (xmlTextWriterPtr writer,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatPI (xmlTextWriterPtr writer,
const xmlChar * target,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatRaw (xmlTextWriterPtr writer,
const char * format,
va_list argptr); int xmlTextWriterWriteVFormatString (xmlTextWriterPtr writer,
const char * format,
va_list argptr);
#define xmlTextWriterWriteDocType;
this macro maps to xmlTextWriterWriteDTD
#define xmlTextWriterWriteProcessingInstruction;
This macro maps to xmlTextWriterWritePI
struct _xmlTextWriter {
The content of this structure is not made public by the API.
} xmlTextWriter;
xmlTextWriter * xmlTextWriterPtr;
void xmlFreeTextWriter (xmlTextWriterPtr writer)
Deallocate all the resources associated to the writer
| writer: | the xmlTextWriterPtr |
xmlTextWriterPtr xmlNewTextWriter (xmlOutputBufferPtr out)
Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr NOTE: the @out parameter will be deallocated when the writer is closed (if the call succeed.)
| out: | an xmlOutputBufferPtr |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
xmlTextWriterPtr xmlNewTextWriterDoc (xmlDocPtr * doc,
int compression)
Create a new xmlNewTextWriter structure with @*doc as output
| doc: | address of a xmlDocPtr to hold the new XML document tree |
| compression: | compress the output? |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
xmlTextWriterPtr xmlNewTextWriterFilename (const char * uri,
int compression)
Create a new xmlNewTextWriter structure with @uri as output
| uri: | the URI of the resource for the output |
| compression: | compress the output? |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
xmlTextWriterPtr xmlNewTextWriterMemory (xmlBufferPtr buf,
int compression)
Create a new xmlNewTextWriter structure with @buf as output TODO: handle compression
| buf: | xmlBufferPtr |
| compression: | compress the output? |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
xmlTextWriterPtr xmlNewTextWriterPushParser (xmlParserCtxtPtr ctxt,
int compression)
Create a new xmlNewTextWriter structure with @ctxt as output NOTE: the @ctxt context will be freed with the resulting writer (if the call succeeds). TODO: handle compression
| ctxt: | xmlParserCtxtPtr to hold the new XML document tree |
| compression: | compress the output? |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
xmlTextWriterPtr xmlNewTextWriterTree (xmlDocPtr doc,
xmlNodePtr node,
int compression)
Create a new xmlNewTextWriter structure with @doc as output starting at @node
| doc: | xmlDocPtr |
| node: | xmlNodePtr or NULL for doc->children |
| compression: | compress the output? |
| Returns: | the new xmlTextWriterPtr or NULL in case of error |
int xmlTextWriterEndAttribute (xmlTextWriterPtr writer)
End the current xml element.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndCDATA (xmlTextWriterPtr writer)
End an xml CDATA section.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndComment (xmlTextWriterPtr writer)
End the current xml comment.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndDTD (xmlTextWriterPtr writer)
End an xml DTD.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndDTDAttlist (xmlTextWriterPtr writer)
End an xml DTD attribute list.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndDTDElement (xmlTextWriterPtr writer)
End an xml DTD element.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndDTDEntity (xmlTextWriterPtr writer)
End an xml DTD entity.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndDocument (xmlTextWriterPtr writer)
End an xml document. All open elements are closed, and the content is flushed to the output.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written or -1 in case of error |
int xmlTextWriterEndElement (xmlTextWriterPtr writer)
End the current xml element.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterEndPI (xmlTextWriterPtr writer)
End the current xml PI.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterFlush (xmlTextWriterPtr writer)
Flush the output buffer.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterFullEndElement (xmlTextWriterPtr writer)
End the current xml element. Writes an end tag even if the element is empty
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterSetIndent (xmlTextWriterPtr writer,
int indent)
Set indentation output. indent = 0 do not indentation. indent > 0 do indentation.
| writer: | the xmlTextWriterPtr |
| indent: | do indentation? |
| Returns: | -1 on error or 0 otherwise. |
int xmlTextWriterSetIndentString (xmlTextWriterPtr writer,
const xmlChar * str)
Set string indentation.
| writer: | the xmlTextWriterPtr |
| str: | the xmlChar string |
| Returns: | -1 on error or 0 otherwise. |
int xmlTextWriterSetQuoteChar (xmlTextWriterPtr writer,
xmlChar quotechar)
Set the character used for quoting attributes.
| writer: | the xmlTextWriterPtr |
| quotechar: | the quote character |
| Returns: | -1 on error or 0 otherwise. |
int xmlTextWriterStartAttribute (xmlTextWriterPtr writer,
const xmlChar * name)
Start an xml attribute.
| writer: | the xmlTextWriterPtr |
| name: | element name |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI)
Start an xml attribute with namespace support.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix or NULL |
| name: | element local name |
| namespaceURI: | namespace URI or NULL |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartCDATA (xmlTextWriterPtr writer)
Start an xml CDATA section.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartComment (xmlTextWriterPtr writer)
Start an xml comment.
| writer: | the xmlTextWriterPtr |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid)
Start an xml DTD.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name)
Start an xml DTD ATTLIST.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD ATTLIST |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartDTDElement (xmlTextWriterPtr writer,
const xmlChar * name)
Start an xml DTD element.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD element |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartDTDEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name)
Start an xml DTD ATTLIST.
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD ATTLIST |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartDocument (xmlTextWriterPtr writer,
const char * version,
const char * encoding,
const char * standalone)
Start a new xml document
| writer: | the xmlTextWriterPtr |
| version: | the xml version ("1.0") or NULL for default ("1.0") |
| encoding: | the encoding or NULL for default |
| standalone: | "yes" or "no" or NULL for default |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartElement (xmlTextWriterPtr writer,
const xmlChar * name)
Start an xml element.
| writer: | the xmlTextWriterPtr |
| name: | element name |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI)
Start an xml element with namespace support.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix or NULL |
| name: | element local name |
| namespaceURI: | namespace URI or NULL |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterStartPI (xmlTextWriterPtr writer,
const xmlChar * target)
Start an xml PI.
| writer: | the xmlTextWriterPtr |
| target: | PI target |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content)
Write an xml attribute.
| writer: | the xmlTextWriterPtr |
| name: | attribute name |
| content: | attribute content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content)
Write an xml attribute.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | attribute local name |
| namespaceURI: | namespace URI |
| content: | attribute content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteBase64 (xmlTextWriterPtr writer,
const char * data,
int start,
int len)
Write an base64 encoded xml text.
| writer: | the xmlTextWriterPtr |
| data: | binary data |
| start: | the position within the data of the first byte to encode |
| len: | the number of bytes to encode |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteBinHex (xmlTextWriterPtr writer,
const char * data,
int start,
int len)
Write a BinHex encoded xml text.
| writer: | the xmlTextWriterPtr |
| data: | binary data |
| start: | the position within the data of the first byte to encode |
| len: | the number of bytes to encode |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteCDATA (xmlTextWriterPtr writer,
const xmlChar * content)
Write an xml CDATA.
| writer: | the xmlTextWriterPtr |
| content: | CDATA content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteComment (xmlTextWriterPtr writer,
const xmlChar * content)
Write an xml comment.
| writer: | the xmlTextWriterPtr |
| content: | comment string |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * subset)
Write a DTD.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| subset: | string content of the DTD |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content)
Write a DTD ATTLIST.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD ATTLIST |
| content: | content of the ATTLIST |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content)
Write a DTD element.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD element |
| content: | content of the element |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid,
const xmlChar * content)
Write a DTD entity.
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD entity |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| ndataid: | the xml notation name. |
| content: | content of the entity |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDExternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid)
Write a DTD external entity. The entity must have been started with xmlTextWriterStartDTDEntity
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD entity |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| ndataid: | the xml notation name. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDExternalEntityContents (xmlTextWriterPtr writer,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid)
Write the contents of a DTD external entity.
| writer: | the xmlTextWriterPtr |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| ndataid: | the xml notation name. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const xmlChar * content)
Write a DTD internal entity.
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD entity |
| content: | content of the entity |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteDTDNotation (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid)
Write a DTD entity.
| writer: | the xmlTextWriterPtr |
| name: | the name of the xml notation |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteElement (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * content)
Write an xml element.
| writer: | the xmlTextWriterPtr |
| name: | element name |
| content: | element content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content)
Write an xml element with namespace support.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | element local name |
| namespaceURI: | namespace URI |
| content: | element content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...)
Write a formatted xml attribute.
| writer: | the xmlTextWriterPtr |
| name: | attribute name |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... ...)
Write a formatted xml attribute.with namespace support
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | attribute local name |
| namespaceURI: | namespace URI |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatCDATA (xmlTextWriterPtr writer,
const char * format,
... ...)
Write a formatted xml CDATA.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatComment (xmlTextWriterPtr writer,
const char * format,
... ...)
Write an xml comment.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
... ...)
Write a DTD with a formatted markup declarations part.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...)
Write a formatted DTD ATTLIST.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD ATTLIST |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...)
Write a formatted DTD element.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD element |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const char * format,
... ...)
Write a formatted DTD internal entity.
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD entity |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
... ...)
Write a formatted xml element.
| writer: | the xmlTextWriterPtr |
| name: | element name |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... ...)
Write a formatted xml element with namespace support.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | element local name |
| namespaceURI: | namespace URI |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatPI (xmlTextWriterPtr writer,
const xmlChar * target,
const char * format,
... ...)
Write a formatted PI.
| writer: | the xmlTextWriterPtr |
| target: | PI target |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatRaw (xmlTextWriterPtr writer,
const char * format,
... ...)
Write a formatted raw xml text.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteFormatString (xmlTextWriterPtr writer,
const char * format,
... ...)
Write a formatted xml text.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| ...: | extra parameters for the format |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWritePI (xmlTextWriterPtr writer,
const xmlChar * target,
const xmlChar * content)
Write an xml PI.
| writer: | the xmlTextWriterPtr |
| target: | PI target |
| content: | PI content |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteRaw (xmlTextWriterPtr writer,
const xmlChar * content)
Write a raw xml text.
| writer: | the xmlTextWriterPtr |
| content: | text string |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteRawLen (xmlTextWriterPtr writer,
const xmlChar * content,
int len)
Write an xml text. TODO: what about entities and special chars??
| writer: | the xmlTextWriterPtr |
| content: | text string |
| len: | length of the text string |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteString (xmlTextWriterPtr writer,
const xmlChar * content)
Write an xml text.
| writer: | the xmlTextWriterPtr |
| content: | text string |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatAttribute (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr)
Write a formatted xml attribute.
| writer: | the xmlTextWriterPtr |
| name: | attribute name |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatAttributeNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr)
Write a formatted xml attribute.with namespace support
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | attribute local name |
| namespaceURI: | namespace URI |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatCDATA (xmlTextWriterPtr writer,
const char * format,
va_list argptr)
Write a formatted xml CDATA.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatComment (xmlTextWriterPtr writer,
const char * format,
va_list argptr)
Write an xml comment.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatDTD (xmlTextWriterPtr writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
va_list argptr)
Write a DTD with a formatted markup declarations part.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD |
| pubid: | the public identifier, which is an alternative to the system identifier |
| sysid: | the system identifier, which is the URI of the DTD |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatDTDAttlist (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr)
Write a formatted DTD ATTLIST.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD ATTLIST |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatDTDElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr)
Write a formatted DTD element.
| writer: | the xmlTextWriterPtr |
| name: | the name of the DTD element |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatDTDInternalEntity (xmlTextWriterPtr writer,
int pe,
const xmlChar * name,
const char * format,
va_list argptr)
Write a formatted DTD internal entity.
| writer: | the xmlTextWriterPtr |
| pe: | TRUE if this is a parameter entity, FALSE if not |
| name: | the name of the DTD entity |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatElement (xmlTextWriterPtr writer,
const xmlChar * name,
const char * format,
va_list argptr)
Write a formatted xml element.
| writer: | the xmlTextWriterPtr |
| name: | element name |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatElementNS (xmlTextWriterPtr writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr)
Write a formatted xml element with namespace support.
| writer: | the xmlTextWriterPtr |
| prefix: | namespace prefix |
| name: | element local name |
| namespaceURI: | namespace URI |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatPI (xmlTextWriterPtr writer,
const xmlChar * target,
const char * format,
va_list argptr)
Write a formatted xml PI.
| writer: | the xmlTextWriterPtr |
| target: | PI target |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatRaw (xmlTextWriterPtr writer,
const char * format,
va_list argptr)
Write a formatted raw xml text.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
int xmlTextWriterWriteVFormatString (xmlTextWriterPtr writer,
const char * format,
va_list argptr)
Write a formatted xml text.
| writer: | the xmlTextWriterPtr |
| format: | format string (see printf) |
| argptr: | pointer to the first member of the variable argument list. |
| Returns: | the bytes written (may be 0 because of buffering) or -1 in case of error |
| libxml2 Reference Manual |
|---|
nanoftp - minimal FTP implementation
minimal FTP implementation allowing to fetch resources like external subset. This module is DEPRECATED, do not use any of its functions.
WARNING: this module is deprecated !
Author(s): Daniel Veillard
#define INVALID_SOCKET; #define SOCKET; typedef void ftpDataCallback (void * userData,
const char * data,
int len); typedef void ftpListCallback (void * userData,
const char * filename,
const char * attrib,
const char * owner,
const char * group,
unsigned long size,
int links,
int year,
const char * month,
int day,
int hour,
int minute); int xmlNanoFTPCheckResponse (void * ctx); void xmlNanoFTPCleanup (void); int xmlNanoFTPClose (void * ctx); int xmlNanoFTPCloseConnection (void * ctx); int xmlNanoFTPConnect (void * ctx); void * xmlNanoFTPConnectTo (const char * server,
int port); int xmlNanoFTPCwd (void * ctx,
const char * directory); int xmlNanoFTPDele (void * ctx,
const char * file); void xmlNanoFTPFreeCtxt (void * ctx); int xmlNanoFTPGet (void * ctx,
ftpDataCallback callback,
void * userData,
const char * filename); SOCKET xmlNanoFTPGetConnection (void * ctx); int xmlNanoFTPGetResponse (void * ctx); SOCKET xmlNanoFTPGetSocket (void * ctx,
const char * filename); void xmlNanoFTPInit (void); int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
const char * filename); void * xmlNanoFTPNewCtxt (const char * URL); void * xmlNanoFTPOpen (const char * URL); void xmlNanoFTPProxy (const char * host,
int port,
const char * user,
const char * passwd,
int type); int xmlNanoFTPQuit (void * ctx); int xmlNanoFTPRead (void * ctx,
void * dest,
int len); void xmlNanoFTPScanProxy (const char * URL); int xmlNanoFTPUpdateURL (void * ctx,
const char * URL);
#define INVALID_SOCKET;
macro used to provide portability of code to windows sockets the value to be used when the socket is not valid
void ftpDataCallback (void * userData,
const char * data,
int len)
A callback for the xmlNanoFTPGet command.
| userData: | the user provided context |
| data: | the data received |
| len: | its size in bytes |
void ftpListCallback (void * userData,
const char * filename,
const char * attrib,
const char * owner,
const char * group,
unsigned long size,
int links,
int year,
const char * month,
int day,
int hour,
int minute)
A callback for the xmlNanoFTPList command. Note that only one of year and day:minute are specified.
| userData: | user provided data for the callback |
| filename: | the file name (including "->" when links are shown) |
| attrib: | the attribute string |
| owner: | the owner string |
| group: | the group string |
| size: | the file size |
| links: | the link count |
| year: | the year |
| month: | the month |
| day: | the day |
| hour: | the hour |
| minute: | the minute |
int xmlNanoFTPCheckResponse (void * ctx)
Check if there is a response from the FTP server after a command.
| ctx: | an FTP context |
| Returns: | the code number, or 0 |
void xmlNanoFTPCleanup (void)
Cleanup the FTP protocol layer. This cleanup proxy information.
int xmlNanoFTPClose (void * ctx)
Close the connection and both control and transport
| ctx: | an FTP context |
| Returns: | -1 in case of error, 0 otherwise |
int xmlNanoFTPCloseConnection (void * ctx)
Close the data connection from the server
| ctx: | an FTP context |
| Returns: | -1 in case of error, 0 otherwise |
int xmlNanoFTPConnect (void * ctx)
Tries to open a control connection
| ctx: | an FTP context |
| Returns: | -1 in case of error, 0 otherwise |
void * xmlNanoFTPConnectTo (const char * server,
int port)
Tries to open a control connection to the given server/port
| server: | an FTP server name |
| port: | the port (use 21 if 0) |
| Returns: | an fTP context or NULL if it failed |
int xmlNanoFTPCwd (void * ctx,
const char * directory)
Tries to change the remote directory
| ctx: | an FTP context |
| directory: | a directory on the server |
| Returns: | -1 in case of error, 1 if CWD worked, 0 if it failed |
int xmlNanoFTPDele (void * ctx,
const char * file)
Tries to delete an item (file or directory) from server
| ctx: | an FTP context |
| file: | a file or directory on the server |
| Returns: | -1 in case of error, 1 if DELE worked, 0 if it failed |
void xmlNanoFTPFreeCtxt (void * ctx)
Frees the context after closing the connection.
| ctx: | an FTP context |
int xmlNanoFTPGet (void * ctx,
ftpDataCallback callback,
void * userData,
const char * filename)
Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.
| ctx: | an FTP context |
| callback: | the user callback |
| userData: | the user callback data |
| filename: | the file to retrieve |
| Returns: | -1 in case of error, 0 otherwise |
SOCKET xmlNanoFTPGetConnection (void * ctx)
Try to open a data connection to the server. Currently only passive mode is supported.
| ctx: | an FTP context |
| Returns: | -1 in case of error, 0 otherwise |
int xmlNanoFTPGetResponse (void * ctx)
Get the response from the FTP server after a command.
| ctx: | an FTP context |
| Returns: | the code number |
SOCKET xmlNanoFTPGetSocket (void * ctx,
const char * filename)
Initiate fetch of the given file from the server.
| ctx: | an FTP context |
| filename: | the file to retrieve (or NULL if path is in context). |
| Returns: | the socket for the data connection, or <0 in case of error |
void xmlNanoFTPInit (void)
Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname
int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
const char * filename)
Do a listing on the server. All files info are passed back in the callbacks.
| ctx: | an FTP context |
| callback: | the user callback |
| userData: | the user callback data |
| filename: | optional files to list |
| Returns: | -1 in case of error, 0 otherwise |
void * xmlNanoFTPNewCtxt (const char * URL)
Allocate and initialize a new FTP context.
| URL: | The URL used to initialize the context |
| Returns: | an FTP context or NULL in case of error. |
void * xmlNanoFTPOpen (const char * URL)
Start to fetch the given ftp:// resource
| URL: | the URL to the resource |
| Returns: | an FTP context, or NULL |
void xmlNanoFTPProxy (const char * host,
int port,
const char * user,
const char * passwd,
int type)
Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.
| host: | the proxy host name |
| port: | the proxy port |
| user: | the proxy user name |
| passwd: | the proxy password |
| type: | the type of proxy 1 for using SITE, 2 for USER a@b |
int xmlNanoFTPQuit (void * ctx)
Send a QUIT command to the server
| ctx: | an FTP context |
| Returns: | -1 in case of error, 0 otherwise |
int xmlNanoFTPRead (void * ctx,
void * dest,
int len)
This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.
| ctx: | the FTP context |
| dest: | a buffer |
| len: | the buffer length |
| Returns: | the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error. |
void xmlNanoFTPScanProxy (const char * URL)
(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.
| URL: | The proxy URL used to initialize the proxy context |
int xmlNanoFTPUpdateURL (void * ctx,
const char * URL)
Update an FTP context by parsing the URL and finding new path it indicates. If there is an error in the protocol, hostname, port or other information, the error is raised. It indicates a new connection has to be established.
| ctx: | an FTP context |
| URL: | The URL used to update the context |
| Returns: | 0 if Ok, -1 in case of error (other host). |
| libxml2 Reference Manual |
|---|
xmlregexp - regular expressions handling
basic API for libxml regular expressions handling used for XML Schemas and validation.
Author(s): Daniel Veillard
typedef struct _xmlExpCtxt xmlExpCtxt; typedef xmlExpCtxt * xmlExpCtxtPtr; typedef struct _xmlExpNode xmlExpNode; typedef xmlExpNode * xmlExpNodePtr; typedef enum xmlExpNodeType; typedef struct _xmlRegExecCtxt xmlRegExecCtxt; typedef xmlRegExecCtxt * xmlRegExecCtxtPtr; typedef struct _xmlRegexp xmlRegexp; typedef xmlRegexp * xmlRegexpPtr; int xmlExpCtxtNbCons (xmlExpCtxtPtr ctxt); int xmlExpCtxtNbNodes (xmlExpCtxtPtr ctxt); void xmlExpDump (xmlBufferPtr buf,
xmlExpNodePtr expr); xmlExpNodePtr xmlExpExpDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
xmlExpNodePtr sub); void xmlExpFree (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp); void xmlExpFreeCtxt (xmlExpCtxtPtr ctxt); int xmlExpGetLanguage (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar ** langList,
int len); int xmlExpGetStart (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar ** tokList,
int len); int xmlExpIsNillable (xmlExpNodePtr exp); int xmlExpMaxToken (xmlExpNodePtr expr); xmlExpNodePtr xmlExpNewAtom (xmlExpCtxtPtr ctxt,
const xmlChar * name,
int len); xmlExpCtxtPtr xmlExpNewCtxt (int maxNodes,
xmlDictPtr dict); xmlExpNodePtr xmlExpNewOr (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right); xmlExpNodePtr xmlExpNewRange (xmlExpCtxtPtr ctxt,
xmlExpNodePtr subset,
int min,
int max); xmlExpNodePtr xmlExpNewSeq (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right); xmlExpNodePtr xmlExpParse (xmlExpCtxtPtr ctxt,
const char * expr); void xmlExpRef (xmlExpNodePtr exp); xmlExpNodePtr xmlExpStringDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar * str,
int len); int xmlExpSubsume (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
xmlExpNodePtr sub); typedef void xmlRegExecCallbacks (xmlRegExecCtxtPtr exec,
const xmlChar * token,
void * transdata,
void * inputdata); int xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
const xmlChar ** string,
int * nbval,
int * nbneg,
xmlChar ** values,
int * terminal); int xmlRegExecNextValues (xmlRegExecCtxtPtr exec,
int * nbval,
int * nbneg,
xmlChar ** values,
int * terminal); int xmlRegExecPushString (xmlRegExecCtxtPtr exec,
const xmlChar * value,
void * data); int xmlRegExecPushString2 (xmlRegExecCtxtPtr exec,
const xmlChar * value,
const xmlChar * value2,
void * data); void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); void xmlRegFreeRegexp (xmlRegexpPtr regexp); xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp,
xmlRegExecCallbacks callback,
void * data); xmlRegexpPtr xmlRegexpCompile (const xmlChar * regexp); int xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar * content); int xmlRegexpIsDeterminist (xmlRegexpPtr comp); void xmlRegexpPrint (FILE * output,
xmlRegexpPtr regexp);
struct _xmlExpCtxt {
The content of this structure is not made public by the API.
} xmlExpCtxt;
xmlExpCtxt * xmlExpCtxtPtr;
struct _xmlExpNode {
The content of this structure is not made public by the API.
} xmlExpNode;
xmlExpNode * xmlExpNodePtr;
enum xmlExpNodeType { XML_EXP_EMPTY = 0 XML_EXP_FORBID = 1 XML_EXP_ATOM = 2 XML_EXP_SEQ = 3 XML_EXP_OR = 4 XML_EXP_COUNT = 5 };
struct _xmlRegExecCtxt {
The content of this structure is not made public by the API.
} xmlRegExecCtxt;
xmlRegExecCtxt * xmlRegExecCtxtPtr;
A libxml progressive regular expression evaluation context
struct _xmlRegexp {
The content of this structure is not made public by the API.
} xmlRegexp;
xmlRegexp * xmlRegexpPtr;
A libxml regular expression, they can actually be far more complex thank the POSIX regex expressions.
void xmlRegExecCallbacks (xmlRegExecCtxtPtr exec,
const xmlChar * token,
void * transdata,
void * inputdata)
Callback function when doing a transition in the automata
| exec: | the regular expression context |
| token: | the current token string |
| transdata: | transition data |
| inputdata: | input data |
xmlExpNodePtr emptyExp;
xmlExpNodePtr forbiddenExp;
int xmlExpCtxtNbCons (xmlExpCtxtPtr ctxt)
Debugging facility provides the number of allocated nodes over lifetime
| ctxt: | an expression context |
| Returns: | the number of nodes ever allocated or -1 in case of error |
int xmlExpCtxtNbNodes (xmlExpCtxtPtr ctxt)
Debugging facility provides the number of allocated nodes at a that point
| ctxt: | an expression context |
| Returns: | the number of nodes in use or -1 in case of error |
void xmlExpDump (xmlBufferPtr buf,
xmlExpNodePtr expr)
Serialize the expression as compiled to the buffer
| buf: | a buffer to receive the output |
| expr: | the compiled expression |
xmlExpNodePtr xmlExpExpDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
xmlExpNodePtr sub)
Evaluates the expression resulting from @exp consuming a sub expression @sub Based on algebraic derivation and sometimes direct Brzozowski derivation it usually takes less than linear time and can handle expressions generating infinite languages.
| ctxt: | the expressions context |
| exp: | the englobing expression |
| sub: | the subexpression |
| Returns: | the resulting expression or NULL in case of internal error, the result must be freed |
void xmlExpFree (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp)
Dereference the expression
| ctxt: | the expression context |
| exp: | the expression |
void xmlExpFreeCtxt (xmlExpCtxtPtr ctxt)
Free an expression context
| ctxt: | an expression context |
int xmlExpGetLanguage (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar ** langList,
int len)
Find all the strings used in @exp and store them in @list
| ctxt: | the expression context |
| exp: | the expression |
| langList: | where to store the tokens |
| len: | the allocated length of @list |
| Returns: | the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings |
int xmlExpGetStart (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar ** tokList,
int len)
Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]
| ctxt: | the expression context |
| exp: | the expression |
| tokList: | where to store the tokens |
| len: | the allocated length of @list |
| Returns: | the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings |
int xmlExpIsNillable (xmlExpNodePtr exp)
Finds if the expression is nillable, i.e. if it accepts the empty sequence
| exp: | the expression |
| Returns: | 1 if nillable, 0 if not and -1 in case of error |
int xmlExpMaxToken (xmlExpNodePtr expr)
Indicate the maximum number of input a expression can accept
| expr: | a compiled expression |
| Returns: | the maximum length or -1 in case of error |
xmlExpNodePtr xmlExpNewAtom (xmlExpCtxtPtr ctxt,
const xmlChar * name,
int len)
Get the atom associated to this name from that context
| ctxt: | the expression context |
| name: | the atom name |
| len: | the atom name length in byte (or -1); |
| Returns: | the node or NULL in case of error |
xmlExpCtxtPtr xmlExpNewCtxt (int maxNodes,
xmlDictPtr dict)
Creates a new context for manipulating expressions
| maxNodes: | the maximum number of nodes |
| dict: | optional dictionary to use internally |
| Returns: | the context or NULL in case of error |
xmlExpNodePtr xmlExpNewOr (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right)
Get the atom associated to the choice @left | @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).
| ctxt: | the expression context |
| left: | left expression |
| right: | right expression |
| Returns: | the node or NULL in case of error |
xmlExpNodePtr xmlExpNewRange (xmlExpCtxtPtr ctxt,
xmlExpNodePtr subset,
int min,
int max)
Get the atom associated to the range (@subset){@min, @max} Note that @subset is consumed in the operation, to keep an handle on it use xmlExpRef() and use xmlExpFree() to release it, this is true even in case of failure (unless ctxt == NULL).
| ctxt: | the expression context |
| subset: | the expression to be repeated |
| min: | the lower bound for the repetition |
| max: | the upper bound for the repetition, -1 means infinite |
| Returns: | the node or NULL in case of error |
xmlExpNodePtr xmlExpNewSeq (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right)
Get the atom associated to the sequence @left , @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).
| ctxt: | the expression context |
| left: | left expression |
| right: | right expression |
| Returns: | the node or NULL in case of error |
xmlExpNodePtr xmlExpParse (xmlExpCtxtPtr ctxt,
const char * expr)
Minimal parser for regexps, it understand the following constructs - string terminals - choice operator | - sequence operator , - subexpressions (...) - usual cardinality operators + * and ? - finite sequences { min, max } - infinite sequences { min, * } There is minimal checkings made especially no checking on strings values
| ctxt: | the expressions context |
| expr: | the 0 terminated string |
| Returns: | a new expression or NULL in case of failure |
void xmlExpRef (xmlExpNodePtr exp)
Increase the reference count of the expression
| exp: | the expression |
xmlExpNodePtr xmlExpStringDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
const xmlChar * str,
int len)
Do one step of Brzozowski derivation of the expression @exp with respect to the input string
| ctxt: | the expression context |
| exp: | the expression |
| str: | the string |
| len: | the string len in bytes if available |
| Returns: | the resulting expression or NULL in case of internal error |
int xmlExpSubsume (xmlExpCtxtPtr ctxt,
xmlExpNodePtr exp,
xmlExpNodePtr sub)
Check whether @exp accepts all the languages accepted by @sub the input being a subexpression.
| ctxt: | the expressions context |
| exp: | the englobing expression |
| sub: | the subexpression |
| Returns: | 1 if true 0 if false and -1 in case of failure. |
int xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
const xmlChar ** string,
int * nbval,
int * nbneg,
xmlChar ** values,
int * terminal)
Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values
| exec: | a regexp execution context generating an error |
| string: | return value for the error string |
| nbval: | pointer to the number of accepted values IN/OUT |
| nbneg: | return number of negative transitions |
| values: | pointer to the array of acceptable values |
| terminal: | return value if this was a terminal state |
| Returns: | will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error. |
int xmlRegExecNextValues (xmlRegExecCtxtPtr exec,
int * nbval,
int * nbneg,
xmlChar ** values,
int * terminal)
Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values
| exec: | a regexp execution context |
| nbval: | pointer to the number of accepted values IN/OUT |
| nbneg: | return number of negative transitions |
| values: | pointer to the array of acceptable values |
| terminal: | return value if this was a terminal state |
| Returns: | will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error. |
int xmlRegExecPushString (xmlRegExecCtxtPtr exec,
const xmlChar * value,
void * data)
Push one input token in the execution context
| exec: | a regexp execution context or NULL to indicate the end |
| value: | a string token input |
| data: | data associated to the token to reuse in callbacks |
| Returns: | 1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error. |
int xmlRegExecPushString2 (xmlRegExecCtxtPtr exec,
const xmlChar * value,
const xmlChar * value2,
void * data)
Push one input token in the execution context
| exec: | a regexp execution context or NULL to indicate the end |
| value: | the first string token input |
| value2: | the second string token input |
| data: | data associated to the token to reuse in callbacks |
| Returns: | 1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error. |
void xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec)
Free the structures associated to a regular expression evaluation context.
| exec: | a regular expression evaluation context |
xmlRegExecCtxtPtr xmlRegNewExecCtxt (xmlRegexpPtr comp,
xmlRegExecCallbacks callback,
void * data)
Build a context used for progressive evaluation of a regexp.
| comp: | a precompiled regular expression |
| callback: | a callback function used for handling progresses in the automata matching phase |
| data: | the context data associated to the callback in this context |
| Returns: | the new context |
xmlRegexpPtr xmlRegexpCompile (const xmlChar * regexp)
Parses a regular expression conforming to XML Schemas Part 2 Datatype Appendix F and builds an automata suitable for testing strings against that regular expression
| regexp: | a regular expression string |
| Returns: | the compiled expression or NULL in case of error |
int xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar * content)
Check if the regular expression generates the value
| comp: | the compiled regular expression |
| content: | the value to check against the regular expression |
| Returns: | 1 if it matches, 0 if not and a negative value in case of error |
int xmlRegexpIsDeterminist (xmlRegexpPtr comp)
Check if the regular expression is determinist
| comp: | the compiled regular expression |
| Returns: | 1 if it yes, 0 if not and a negative value in case of error |
void xmlRegexpPrint (FILE * output,
xmlRegexpPtr regexp)
Print the content of the compiled regular expression
| output: | the file for the output debug |
| regexp: | the compiled regexp |
| libxml2 Reference Manual |
|---|
nanohttp - minimal HTTP implementation
minimal HTTP implementation allowing to fetch resources like external subset.
Author(s): Daniel Veillard
const char * xmlNanoHTTPAuthHeader (void * ctx); void xmlNanoHTTPCleanup (void); void xmlNanoHTTPClose (void * ctx); int xmlNanoHTTPContentLength (void * ctx); const char * xmlNanoHTTPEncoding (void * ctx); int xmlNanoHTTPFetch (const char * URL,
const char * filename,
char ** contentType); void xmlNanoHTTPInit (void); void * xmlNanoHTTPMethod (const char * URL,
const char * method,
const char * input,
char ** contentType,
const char * headers,
int ilen); void * xmlNanoHTTPMethodRedir (const char * URL,
const char * method,
const char * input,
char ** contentType,
char ** redir,
const char * headers,
int ilen); const char * xmlNanoHTTPMimeType (void * ctx); void * xmlNanoHTTPOpen (const char * URL,
char ** contentType); void * xmlNanoHTTPOpenRedir (const char * URL,
char ** contentType,
char ** redir); int xmlNanoHTTPRead (void * ctx,
void * dest,
int len); const char * xmlNanoHTTPRedir (void * ctx); int xmlNanoHTTPReturnCode (void * ctx); int xmlNanoHTTPSave (void * ctxt,
const char * filename); void xmlNanoHTTPScanProxy (const char * URL);
const char * xmlNanoHTTPAuthHeader (void * ctx)
Get the authentication header of an HTTP context
| ctx: | the HTTP context |
| Returns: | the stashed value of the WWW-Authenticate or Proxy-Authenticate header. |
void xmlNanoHTTPClose (void * ctx)
This function closes an HTTP context, it ends up the connection and free all data related to it.
| ctx: | the HTTP context |
int xmlNanoHTTPContentLength (void * ctx)
Provides the specified content length from the HTTP header.
| ctx: | the HTTP context |
| Returns: | the specified content length from the HTTP header. Note that a value of -1 indicates that the content length element was not included in the response header. |
const char * xmlNanoHTTPEncoding (void * ctx)
Provides the specified encoding if specified in the HTTP headers.
| ctx: | the HTTP context |
| Returns: | the specified encoding or NULL if not available |
int xmlNanoHTTPFetch (const char * URL,
const char * filename,
char ** contentType)
This function try to fetch the indicated resource via HTTP GET and save it's content in the file.
| URL: | The URL to load |
| filename: | the filename where the content should be saved |
| contentType: | if available the Content-Type information will be returned at that location |
| Returns: | -1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller |
void xmlNanoHTTPInit (void)
Initialize the HTTP protocol layer. Currently it just checks for proxy information
void * xmlNanoHTTPMethod (const char * URL,
const char * method,
const char * input,
char ** contentType,
const char * headers,
int ilen)
This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.
| URL: | The URL to load |
| method: | the HTTP method to use |
| input: | the input string if any |
| contentType: | the Content-Type information IN and OUT |
| headers: | the extra headers |
| ilen: | input length |
| Returns: | NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller |
void * xmlNanoHTTPMethodRedir (const char * URL,
const char * method,
const char * input,
char ** contentType,
char ** redir,
const char * headers,
int ilen)
This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.
| URL: | The URL to load |
| method: | the HTTP method to use |
| input: | the input string if any |
| contentType: | the Content-Type information IN and OUT |
| redir: | the redirected URL OUT |
| headers: | the extra headers |
| ilen: | input length |
| Returns: | NULL in case of failure, otherwise a request handler. The contentType, or redir, if provided must be freed by the caller |
const char * xmlNanoHTTPMimeType (void * ctx)
Provides the specified Mime-Type if specified in the HTTP headers.
| ctx: | the HTTP context |
| Returns: | the specified Mime-Type or NULL if not available |
void * xmlNanoHTTPOpen (const char * URL,
char ** contentType)
This function try to open a connection to the indicated resource via HTTP GET.
| URL: | The URL to load |
| contentType: | if available the Content-Type information will be returned at that location |
| Returns: | NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller |
void * xmlNanoHTTPOpenRedir (const char * URL,
char ** contentType,
char ** redir)
This function try to open a connection to the indicated resource via HTTP GET.
| URL: | The URL to load |
| contentType: | if available the Content-Type information will be returned at that location |
| redir: | if available the redirected URL will be returned |
| Returns: | NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller |
int xmlNanoHTTPRead (void * ctx,
void * dest,
int len)
This function tries to read @len bytes from the existing HTTP connection and saves them in @dest. This is a blocking call.
| ctx: | the HTTP context |
| dest: | a buffer |
| len: | the buffer length |
| Returns: | the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error. |
const char * xmlNanoHTTPRedir (void * ctx)
Provides the specified redirection URL if available from the HTTP header.
| ctx: | the HTTP context |
| Returns: | the specified redirection URL or NULL if not redirected. |
int xmlNanoHTTPReturnCode (void * ctx)
Get the latest HTTP return code received
| ctx: | the HTTP context |
| Returns: | the HTTP return code for the request. |
int xmlNanoHTTPSave (void * ctxt,
const char * filename)
This function saves the output of the HTTP transaction to a file It closes and free the context at the end
| ctxt: | the HTTP context |
| filename: | the filename where the content should be saved |
| Returns: | -1 in case of failure, 0 in case of success. |
void xmlNanoHTTPScanProxy (const char * URL)
(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.
| URL: | The proxy URL used to initialize the proxy context |
| libxml2 Reference Manual |
|---|
c14n - Provide Canonical XML and Exclusive XML Canonicalization
the c14n modules provides a "Canonical XML" implementation
Author(s): Aleksey Sanin <aleksey@aleksey.com>
typedef enum xmlC14NMode; int xmlC14NDocDumpMemory (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlChar ** doc_txt_ptr); int xmlC14NDocSave (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
const char * filename,
int compression); int xmlC14NDocSaveTo (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf); int xmlC14NExecute (xmlDocPtr doc,
xmlC14NIsVisibleCallback is_visible_callback,
void * user_data,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf); typedef int xmlC14NIsVisibleCallback (void * user_data,
xmlNodePtr node,
xmlNodePtr parent);
enum xmlC14NMode { XML_C14N_1_0 = 0 /* Original C14N 1.0 spec */ XML_C14N_EXCLUSIVE_1_0 = 1 /* Exclusive C14N 1.0 spec */ XML_C14N_1_1 = 2 /* C14N 1.1 spec */ };
int xmlC14NIsVisibleCallback (void * user_data,
xmlNodePtr node,
xmlNodePtr parent)
Signature for a C14N callback on visible nodes
| user_data: | user data |
| node: | the current node |
| parent: | the parent node |
| Returns: | 1 if the node should be included |
int xmlC14NDocDumpMemory (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlChar ** doc_txt_ptr)
Dumps the canonized image of given XML document into memory. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
| doc: | the XML document for canonization |
| nodes: | the nodes set to be included in the canonized image or NULL if all document nodes should be included |
| mode: | the c14n mode (see @xmlC14NMode) |
| inclusive_ns_prefixes: | the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) |
| with_comments: | include comments in the result (!=0) or not (==0) |
| doc_txt_ptr: | the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory |
| Returns: | the number of bytes written on success or a negative value on fail |
int xmlC14NDocSave (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
const char * filename,
int compression)
Dumps the canonized image of given XML document into the file. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
| doc: | the XML document for canonization |
| nodes: | the nodes set to be included in the canonized image or NULL if all document nodes should be included |
| mode: | the c14n mode (see @xmlC14NMode) |
| inclusive_ns_prefixes: | the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) |
| with_comments: | include comments in the result (!=0) or not (==0) |
| filename: | the filename to store canonical XML image |
| compression: | the compression level (zlib required): -1 - libxml default, 0 - uncompressed, >0 - compression level |
| Returns: | the number of bytes written success or a negative value on fail |
int xmlC14NDocSaveTo (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf)
Dumps the canonized image of given XML document into the provided buffer. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
| doc: | the XML document for canonization |
| nodes: | the nodes set to be included in the canonized image or NULL if all document nodes should be included |
| mode: | the c14n mode (see @xmlC14NMode) |
| inclusive_ns_prefixes: | the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) |
| with_comments: | include comments in the result (!=0) or not (==0) |
| buf: | the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output |
| Returns: | non-negative value on success or a negative value on fail |
int xmlC14NExecute (xmlDocPtr doc,
xmlC14NIsVisibleCallback is_visible_callback,
void * user_data,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf)
Dumps the canonized image of given XML document into the provided buffer. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
| doc: | the XML document for canonization |
| is_visible_callback: | the function to use to determine is node visible or not |
| user_data: | the first parameter for @is_visible_callback function (in most cases, it is nodes set) |
| mode: | the c14n mode (see @xmlC14NMode) |
| inclusive_ns_prefixes: | the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) |
| with_comments: | include comments in the result (!=0) or not (==0) |
| buf: | the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output |
| Returns: | non-negative value on success or a negative value on fail |
| libxml2 Reference Manual |
|---|
xmlmemory - interface for the memory allocator
provides interfaces for the memory allocator, including debugging capabilities.
Author(s): Daniel Veillard
#define DEBUG_MEMORY; #define xmlMalloc; #define xmlMallocAtomic; #define xmlMemStrdup; #define xmlRealloc; void xmlCleanupMemory (void); typedef void xmlFreeFunc (void * mem); int xmlGcMemGet (xmlFreeFunc * freeFunc,
xmlMallocFunc * mallocFunc,
xmlMallocFunc * mallocAtomicFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc); int xmlGcMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlMallocFunc mallocAtomicFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc); int xmlInitMemory (void); void * xmlMallocAtomicLoc (size_t size,
const char * file,
int line); typedef void * xmlMallocFunc (size_t size); void * xmlMallocLoc (size_t size,
const char * file,
int line); int xmlMemBlocks (void); void xmlMemDisplay (FILE * fp); void xmlMemDisplayLast (FILE * fp,
long nbBytes); void xmlMemFree (void * ptr); int xmlMemGet (xmlFreeFunc * freeFunc,
xmlMallocFunc * mallocFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc); void * xmlMemMalloc (size_t size); void * xmlMemRealloc (void * ptr,
size_t size); int xmlMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc); void xmlMemShow (FILE * fp,
int nr); char * xmlMemStrdupLoc (const char * str,
const char * file,
int line); int xmlMemUsed (void); void xmlMemoryDump (void); char * xmlMemoryStrdup (const char * str); typedef void * xmlReallocFunc (void * mem,
size_t size); void * xmlReallocLoc (void * ptr,
size_t size,
const char * file,
int line); typedef char * xmlStrdupFunc (const char * str);
#define DEBUG_MEMORY;
DEBUG_MEMORY replaces the allocator with a collect and debug shell to the libc allocator. DEBUG_MEMORY should only be activated when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. #define DEBUG_MEMORY_FREED #define DEBUG_MEMORY_LOCATION
void xmlFreeFunc (void * mem)
Signature for a free() implementation.
| mem: | an already allocated block of memory |
void * xmlMallocFunc (size_t size)
Signature for a malloc() implementation.
| size: | the size requested in bytes |
| Returns: | a pointer to the newly allocated block or NULL in case of error. |
void * xmlReallocFunc (void * mem,
size_t size)
Signature for a realloc() implementation.
| mem: | an already allocated block of memory |
| size: | the new size requested in bytes |
| Returns: | a pointer to the newly reallocated block or NULL in case of error. |
char * xmlStrdupFunc (const char * str)
Signature for an strdup() implementation.
| str: | a zero terminated string |
| Returns: | the copy of the string or NULL in case of error. |
void xmlCleanupMemory (void)
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Free up all the memory allocated by the library for its own use. This should not be called by user level code.
int xmlGcMemGet (xmlFreeFunc * freeFunc,
xmlMallocFunc * mallocFunc,
xmlMallocFunc * mallocAtomicFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc)
Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators
| freeFunc: | place to save the free() function in use |
| mallocFunc: | place to save the malloc() function in use |
| mallocAtomicFunc: | place to save the atomic malloc() function in use |
| reallocFunc: | place to save the realloc() function in use |
| strdupFunc: | place to save the strdup() function in use |
| Returns: | 0 on success |
int xmlGcMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlMallocFunc mallocAtomicFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc)
Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators Should this be blocked if there was already some allocations done ?
| freeFunc: | the free() function to use |
| mallocFunc: | the malloc() function to use |
| mallocAtomicFunc: | the malloc() function to use for atomic allocations |
| reallocFunc: | the realloc() function to use |
| strdupFunc: | the strdup() function to use |
| Returns: | 0 on success |
int xmlInitMemory (void)
DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library. Initialize the memory layer.
| Returns: | 0 on success |
void * xmlMallocAtomicLoc (size_t size,
const char * file,
int line)
a malloc() equivalent, with logging of the allocation info.
| size: | an unsigned int specifying the size in byte to allocate. |
| file: | the file name or NULL |
| line: | the line number |
| Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
void * xmlMallocLoc (size_t size,
const char * file,
int line)
a malloc() equivalent, with logging of the allocation info.
| size: | an int specifying the size in byte to allocate. |
| file: | the file name or NULL |
| line: | the line number |
| Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
int xmlMemBlocks (void)
Provides the number of memory areas currently allocated
| Returns: | an int representing the number of blocks |
void xmlMemDisplay (FILE * fp)
show in-extenso the memory blocks allocated
| fp: | a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist |
void xmlMemDisplayLast (FILE * fp,
long nbBytes)
the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.
| fp: | a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist |
| nbBytes: | the amount of memory to dump |
void xmlMemFree (void * ptr)
a free() equivalent, with error checking.
| ptr: | the memory block pointer |
int xmlMemGet (xmlFreeFunc * freeFunc,
xmlMallocFunc * mallocFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc)
Provides the memory access functions set currently in use
| freeFunc: | place to save the free() function in use |
| mallocFunc: | place to save the malloc() function in use |
| reallocFunc: | place to save the realloc() function in use |
| strdupFunc: | place to save the strdup() function in use |
| Returns: | 0 on success |
void * xmlMemMalloc (size_t size)
a malloc() equivalent, with logging of the allocation info.
| size: | an int specifying the size in byte to allocate. |
| Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
void * xmlMemRealloc (void * ptr,
size_t size)
a realloc() equivalent, with logging of the allocation info.
| ptr: | the initial memory block pointer |
| size: | an int specifying the size in byte to allocate. |
| Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
int xmlMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc)
Override the default memory access functions with a new set This has to be called before any other libxml routines ! Should this be blocked if there was already some allocations done ?
| freeFunc: | the free() function to use |
| mallocFunc: | the malloc() function to use |
| reallocFunc: | the realloc() function to use |
| strdupFunc: | the strdup() function to use |
| Returns: | 0 on success |
void xmlMemShow (FILE * fp,
int nr)
show a show display of the memory allocated, and dump the @nr last allocated areas which were not freed
| fp: | a FILE descriptor used as the output file |
| nr: | number of entries to dump |
char * xmlMemStrdupLoc (const char * str,
const char * file,
int line)
a strdup() equivalent, with logging of the allocation info.
| str: | the initial string pointer |
| file: | the file name or NULL |
| line: | the line number |
| Returns: | a pointer to the new string or NULL if allocation error occurred. |
int xmlMemUsed (void)
Provides the amount of memory currently allocated
| Returns: | an int representing the amount of memory allocated. |
void xmlMemoryDump (void)
Dump in-extenso the memory blocks allocated to the file .memorylist
char * xmlMemoryStrdup (const char * str)
a strdup() equivalent, with logging of the allocation info.
| str: | the initial string pointer |
| Returns: | a pointer to the new string or NULL if allocation error occurred. |
void * xmlReallocLoc (void * ptr,
size_t size,
const char * file,
int line)
a realloc() equivalent, with logging of the allocation info.
| ptr: | the initial memory block pointer |
| size: | an int specifying the size in byte to allocate. |
| file: | the file name or NULL |
| line: | the line number |
| Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
| libxml2 Reference Manual |
|---|
xlink - unfinished XLink detection module
unfinished XLink detection module
Author(s): Daniel Veillard
typedef enum xlinkActuate; typedef xmlChar * xlinkHRef; typedef struct _xlinkHandler xlinkHandler; typedef xlinkHandler * xlinkHandlerPtr; typedef xmlChar * xlinkRole; typedef enum xlinkShow; typedef xmlChar * xlinkTitle; typedef enum xlinkType; typedef void xlinkExtendedLinkFunk (void * ctx,
xmlNodePtr node,
int nbLocators,
const xlinkHRef * hrefs,
const xlinkRole * roles,
int nbArcs,
const xlinkRole * from,
const xlinkRole * to,
xlinkShow * show,
xlinkActuate * actuate,
int nbTitles,
const xlinkTitle * titles,
const xmlChar ** langs); typedef void xlinkExtendedLinkSetFunk (void * ctx,
xmlNodePtr node,
int nbLocators,
const xlinkHRef * hrefs,
const xlinkRole * roles,
int nbTitles,
const xlinkTitle * titles,
const xmlChar ** langs); xlinkNodeDetectFunc xlinkGetDefaultDetect (void); xlinkHandlerPtr xlinkGetDefaultHandler (void); xlinkType xlinkIsLink (xmlDocPtr doc,
xmlNodePtr node); typedef void xlinkNodeDetectFunc (void * ctx,
xmlNodePtr node); void xlinkSetDefaultDetect (xlinkNodeDetectFunc func); void xlinkSetDefaultHandler (xlinkHandlerPtr handler); typedef void xlinkSimpleLinkFunk (void * ctx,
xmlNodePtr node,
const xlinkHRef href,
const xlinkRole role,
const xlinkTitle title);
enum xlinkActuate { XLINK_ACTUATE_NONE = 0 XLINK_ACTUATE_AUTO = 1 XLINK_ACTUATE_ONREQUEST = 2 };
struct _xlinkHandler {
xlinkSimpleLinkFunk simple
xlinkExtendedLinkFunk extended
xlinkExtendedLinkSetFunk set
} xlinkHandler;
xlinkHandler * xlinkHandlerPtr;
enum xlinkShow { XLINK_SHOW_NONE = 0 XLINK_SHOW_NEW = 1 XLINK_SHOW_EMBED = 2 XLINK_SHOW_REPLACE = 3 };
enum xlinkType { XLINK_TYPE_NONE = 0 XLINK_TYPE_SIMPLE = 1 XLINK_TYPE_EXTENDED = 2 XLINK_TYPE_EXTENDED_SET = 3 };
void xlinkExtendedLinkFunk (void * ctx,
xmlNodePtr node,
int nbLocators,
const xlinkHRef * hrefs,
const xlinkRole * roles,
int nbArcs,
const xlinkRole * from,
const xlinkRole * to,
xlinkShow * show,
xlinkActuate * actuate,
int nbTitles,
const xlinkTitle * titles,
const xmlChar ** langs)
This is the prototype for a extended link detection callback.
| ctx: | user data pointer |
| node: | the node carrying the link |
| nbLocators: | the number of locators detected on the link |
| hrefs: | pointer to the array of locator hrefs |
| roles: | pointer to the array of locator roles |
| nbArcs: | the number of arcs detected on the link |
| from: | pointer to the array of source roles found on the arcs |
| to: | pointer to the array of target roles found on the arcs |
| show: | array of values for the show attributes found on the arcs |
| actuate: | array of values for the actuate attributes found on the arcs |
| nbTitles: | the number of titles detected on the link |
| titles: | |
| langs: | array of xml:lang values for the titles |
void xlinkExtendedLinkSetFunk (void * ctx,
xmlNodePtr node,
int nbLocators,
const xlinkHRef * hrefs,
const xlinkRole * roles,
int nbTitles,
const xlinkTitle * titles,
const xmlChar ** langs)
This is the prototype for a extended link set detection callback.
| ctx: | user data pointer |
| node: | the node carrying the link |
| nbLocators: | the number of locators detected on the link |
| hrefs: | pointer to the array of locator hrefs |
| roles: | pointer to the array of locator roles |
| nbTitles: | the number of titles detected on the link |
| titles: | |
| langs: | array of xml:lang values for the titles |
void xlinkNodeDetectFunc (void * ctx,
xmlNodePtr node)
This is the prototype for the link detection routine. It calls the default link detection callbacks upon link detection.
| ctx: | user data pointer |
| node: | the node to check |
void xlinkSimpleLinkFunk (void * ctx,
xmlNodePtr node,
const xlinkHRef href,
const xlinkRole role,
const xlinkTitle title)
This is the prototype for a simple link detection callback.
| ctx: | user data pointer |
| node: | the node carrying the link |
| href: | the target of the link |
| role: | the role string |
| title: | the link title |
xlinkNodeDetectFunc xlinkGetDefaultDetect (void)
Get the default xlink detection routine
| Returns: | the current function or NULL; |
xlinkHandlerPtr xlinkGetDefaultHandler (void)
Get the default xlink handler.
| Returns: | the current xlinkHandlerPtr value. |
xlinkType xlinkIsLink (xmlDocPtr doc,
xmlNodePtr node)
Check whether the given node carries the attributes needed to be a link element (or is one of the linking elements issued from the (X)HTML DtDs). This routine don't try to do full checking of the link validity but tries to detect and return the appropriate link type.
| doc: | the document containing the node |
| node: | the node pointer itself |
| Returns: | the xlinkType of the node (XLINK_TYPE_NONE if there is no link detected. |
void xlinkSetDefaultDetect (xlinkNodeDetectFunc func)
Set the default xlink detection routine
| func: | pointer to the new detection routine. |
void xlinkSetDefaultHandler (xlinkHandlerPtr handler)
Set the default xlink handlers
| handler: | the new value for the xlink handler block |