allows to compile and test pattern expressions for nodes either in a tree or based on a parser state. Table of ContentsStructure xmlPattern struct _xmlPattern
The content of this structure is not made public by the API.
Typedef xmlPattern * xmlPatternPtr
Structure xmlStreamCtxt struct _xmlStreamCtxt
The content of this structure is not made public by the API.
Typedef xmlStreamCtxt * xmlStreamCtxtPtr
void xmlFreePattern (xmlPatternPtr comp)
void xmlFreePatternList (xmlPatternPtr comp)
void xmlFreeStreamCtxt (xmlStreamCtxtPtr stream)
xmlStreamCtxtPtr xmlPatternGetStreamCtxt (xmlPatternPtr comp)
int xmlPatternMatch (xmlPatternPtr comp, xmlNodePtr node)
xmlPatternPtr xmlPatterncompile (const xmlChar * pattern, xmlDict * dict, int flags, const xmlChar ** namespaces)
int xmlStreamPop (xmlStreamCtxtPtr stream)
int xmlStreamPush (xmlStreamCtxtPtr stream, const xmlChar * name, const xmlChar * ns)
Description
Structure xmlPattern struct _xmlPattern {
The content of this structure is not made public by the API.
} Structure xmlStreamCtxt struct _xmlStreamCtxt {
The content of this structure is not made public by the API.
} Function: xmlFreePatternvoid xmlFreePattern (xmlPatternPtr comp)
Free up the memory allocated by @comp
Function: xmlFreePatternListvoid xmlFreePatternList (xmlPatternPtr comp)
Free up the memory allocated by all the elements of @comp
Function: xmlFreeStreamCtxtvoid xmlFreeStreamCtxt (xmlStreamCtxtPtr stream)
Free the stream context
stream: | the stream context |
Function: xmlPatternGetStreamCtxtxmlStreamCtxtPtr xmlPatternGetStreamCtxt (xmlPatternPtr comp)
Get a streaming context for that pattern Use xmlFreeStreamCtxt to free the context.
comp: | the precompiled pattern | Returns: | a pointer to the context or NULL in case of failure |
Function: xmlPatternMatchint xmlPatternMatch (xmlPatternPtr comp, xmlNodePtr node)
Test wether the node matches the pattern
comp: | the precompiled pattern | node: | a node | Returns: | 1 if it matches, 0 if it doesn't and -1 in case of failure |
Function: xmlPatterncompilexmlPatternPtr xmlPatterncompile (const xmlChar * pattern, xmlDict * dict, int flags, const xmlChar ** namespaces)
Compile a pattern.
pattern: | the pattern to compile | dict: | an optional dictionnary for interned strings | flags: | compilation flags, undefined yet | namespaces: | the prefix definitions, array of [URI, prefix] or NULL | Returns: | the compiled for of the pattern or NULL in case of error |
Function: xmlStreamPopint xmlStreamPop (xmlStreamCtxtPtr stream)
push one level from the stream.
stream: | the stream context | Returns: | -1 in case of error, 0 otherwise. |
Function: xmlStreamPushint xmlStreamPush (xmlStreamCtxtPtr stream, const xmlChar * name, const xmlChar * ns)
push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionnary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.
stream: | the stream context | name: | the current name | ns: | the namespace name | Returns: | -1 in case of error, 1 if the current state in the stream is a match and 0 otherwise. |
Daniel Veillard |