libxml2
|
pattern expression handling More...
Typedefs | |
typedef struct _xmlPattern | xmlPattern |
A compiled (XPath based) pattern to select nodes. | |
Enumerations | |
enum | xmlPatternFlags |
Internal type. More... | |
Functions | |
void | xmlFreePattern (xmlPattern *comp) |
Free up the memory allocated by comp | |
void | xmlFreePatternList (xmlPattern *comp) |
Free up the memory allocated by all the elements of comp | |
xmlPattern * | xmlPatterncompile (const xmlChar *pattern, xmlDict *dict, int flags, const xmlChar **namespaces) |
Compile a pattern. | |
int | xmlPatternCompileSafe (const xmlChar *pattern, xmlDict *dict, int flags, const xmlChar **namespaces, xmlPattern **patternOut) |
Compile a pattern. | |
int | xmlPatternMatch (xmlPattern *comp, xmlNode *node) |
Test whether the node matches the pattern. | |
int | xmlPatternStreamable (xmlPattern *comp) |
Check if the pattern is streamable i.e. | |
int | xmlPatternMaxDepth (xmlPattern *comp) |
Check the maximum depth reachable by a pattern. | |
int | xmlPatternMinDepth (xmlPattern *comp) |
Check the minimum depth reachable by a pattern, 0 mean the / or . | |
int | xmlPatternFromRoot (xmlPattern *comp) |
Check if the pattern must be looked at from the root. | |
xmlStreamCtxt * | xmlPatternGetStreamCtxt (xmlPattern *comp) |
Get a streaming context for that pattern Use xmlFreeStreamCtxt to free the context. | |
void | xmlFreeStreamCtxt (xmlStreamCtxt *stream) |
Free the stream context. | |
int | xmlStreamPushNode (xmlStreamCtxt *stream, const xmlChar *name, const xmlChar *ns, int nodeType) |
Push new data onto the stream. | |
int | xmlStreamPush (xmlStreamCtxt *stream, const xmlChar *name, const xmlChar *ns) |
Push new data onto the stream. | |
int | xmlStreamPushAttr (xmlStreamCtxt *stream, const xmlChar *name, const xmlChar *ns) |
Push new attribute data onto the stream. | |
int | xmlStreamPop (xmlStreamCtxt *stream) |
push one level from the stream. | |
int | xmlStreamWantsAnyNode (xmlStreamCtxt *stream) |
Query if the streaming pattern additionally needs to be fed with text-, cdata-section-, comment- and processing-instruction-nodes. | |
pattern expression handling
allows to compile and test pattern expressions for nodes either in a tree or based on a parser state.
enum xmlPatternFlags |
Internal type.
This is the set of options affecting the behaviour of pattern matching with this module.
void xmlFreePattern | ( | xmlPattern * | comp | ) |
Free up the memory allocated by comp
comp | an XSLT comp |
void xmlFreePatternList | ( | xmlPattern * | comp | ) |
Free up the memory allocated by all the elements of comp
comp | an XSLT comp list |
void xmlFreeStreamCtxt | ( | xmlStreamCtxt * | stream | ) |
Free the stream context.
stream | the stream context |
xmlPattern * xmlPatterncompile | ( | const xmlChar * | pattern, |
xmlDict * | dict, | ||
int | flags, | ||
const xmlChar ** | namespaces | ||
) |
Compile a pattern.
pattern | the pattern to compile |
dict | an optional dictionary for interned strings |
flags | compilation flags, see xmlPatternFlags |
namespaces | the prefix definitions, array of [URI, prefix] or NULL |
int xmlPatternCompileSafe | ( | const xmlChar * | pattern, |
xmlDict * | dict, | ||
int | flags, | ||
const xmlChar ** | namespaces, | ||
xmlPattern ** | patternOut | ||
) |
Compile a pattern.
pattern | the pattern to compile |
dict | an optional dictionary for interned strings |
flags | compilation flags, see xmlPatternFlags |
namespaces | the prefix definitions, array of [URI, prefix] or NULL |
patternOut | output pattern |
int xmlPatternFromRoot | ( | xmlPattern * | comp | ) |
Check if the pattern must be looked at from the root.
comp | the precompiled pattern |
xmlStreamCtxt * xmlPatternGetStreamCtxt | ( | xmlPattern * | comp | ) |
Get a streaming context for that pattern Use xmlFreeStreamCtxt to free the context.
comp | the precompiled pattern |
int xmlPatternMatch | ( | xmlPattern * | comp, |
xmlNode * | node | ||
) |
Test whether the node matches the pattern.
comp | the precompiled pattern |
node | a node |
int xmlPatternMaxDepth | ( | xmlPattern * | comp | ) |
Check the maximum depth reachable by a pattern.
comp | the precompiled pattern |
int xmlPatternMinDepth | ( | xmlPattern * | comp | ) |
Check the minimum depth reachable by a pattern, 0 mean the / or .
are part of the set.
comp | the precompiled pattern |
int xmlPatternStreamable | ( | xmlPattern * | comp | ) |
Check if the pattern is streamable i.e.
xmlPatternGetStreamCtxt should work.
comp | the precompiled pattern |
int xmlStreamPop | ( | xmlStreamCtxt * | stream | ) |
push one level from the stream.
stream | the stream context |
Push new data onto the stream.
NOTE: if the call xmlPatterncompile indicated a dictionary, 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. Otherwise the function will act as if it has been given an element-node.
stream | the stream context |
name | the current name |
ns | the namespace name |
Push new attribute data onto the stream.
NOTE: If the call to xmlPatterncompile indicated a dictionary, then strings for name
and ns
will be expected to come from the dictionary.
Both name
and ns
being NULL means the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node.
stream | the stream context |
name | the current name |
ns | the namespace name |
int xmlStreamPushNode | ( | xmlStreamCtxt * | stream, |
const xmlChar * | name, | ||
const xmlChar * | ns, | ||
int | nodeType | ||
) |
Push new data onto the stream.
NOTE: if the call xmlPatterncompile indicated a dictionary, 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. Different from xmlStreamPush this function can be fed with nodes of type: element-, attribute-, text-, cdata-section-, comment- and processing-instruction-node.
stream | the stream context |
name | the current name |
ns | the namespace name |
nodeType | the type of the node being pushed |
int xmlStreamWantsAnyNode | ( | xmlStreamCtxt * | streamCtxt | ) |
Query if the streaming pattern additionally needs to be fed with text-, cdata-section-, comment- and processing-instruction-nodes.
If the result is 0 then only element-nodes and attribute-nodes need to be pushed.
streamCtxt | the stream context |