Blame doc/html/libxml-pattern.html

Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
Packit Service a31ea6
TD {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
Packit Service a31ea6
H1 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
H2 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
H3 {font-family: Verdana,Arial,Helvetica}
Packit Service a31ea6
A:link, A:visited, A:active { text-decoration: underline }
Packit Service a31ea6
</style><style type="text/css">
Packit Service a31ea6
      div.deprecated pre.programlisting {border-style: double;border-color:red}
Packit Service a31ea6
      pre.programlisting {border-style: double;background: #EECFA1}
Packit Service a31ea6
    </style><title>Module pattern from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module pattern from libxml2

<center>API Menu</center>
<form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form>
<center>API Indexes</center>
<center>Related links</center>

allows to compile and test pattern expressions for nodes either in a tree or based on a parser state.

Table of Contents

Structure xmlPattern
struct _xmlPattern
Packit Service a31ea6
The content of this structure is not made public by the API.
Packit Service a31ea6
Enum xmlPatternFlags
Packit Service a31ea6
Typedef xmlPattern * xmlPatternPtr
Packit Service a31ea6
Structure xmlStreamCtxt
struct _xmlStreamCtxt
Packit Service a31ea6
The content of this structure is not made public by the API.
Packit Service a31ea6
Typedef xmlStreamCtxt * xmlStreamCtxtPtr
Packit Service a31ea6
void	xmlFreePattern			(xmlPatternPtr comp)
Packit Service a31ea6
void	xmlFreePatternList		(xmlPatternPtr comp)
Packit Service a31ea6
void	xmlFreeStreamCtxt		(xmlStreamCtxtPtr stream)
Packit Service a31ea6
int	xmlPatternFromRoot		(xmlPatternPtr comp)
Packit Service a31ea6
xmlStreamCtxtPtr	xmlPatternGetStreamCtxt	(xmlPatternPtr comp)
Packit Service a31ea6
int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)
Packit Service a31ea6
int	xmlPatternMaxDepth		(xmlPatternPtr comp)
Packit Service a31ea6
int	xmlPatternMinDepth		(xmlPatternPtr comp)
Packit Service a31ea6
int	xmlPatternStreamable		(xmlPatternPtr comp)
Packit Service a31ea6
xmlPatternPtr	xmlPatterncompile	(const xmlChar * pattern, 
xmlDict * dict,
int flags,
const xmlChar ** namespaces)
Packit Service a31ea6
int	xmlStreamPop			(xmlStreamCtxtPtr stream)
Packit Service a31ea6
int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
Packit Service a31ea6
int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
Packit Service a31ea6
int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns,
int nodeType)
Packit Service a31ea6
int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)
Packit Service a31ea6

Description

Packit Service a31ea6

Structure xmlPattern

Structure xmlPattern
struct _xmlPattern {
Packit Service a31ea6
The content of this structure is not made public by the API.
Packit Service a31ea6
}

Enum xmlPatternFlags

Enum xmlPatternFlags {
Packit Service a31ea6
    XML_PATTERN_DEFAULT = 0 : simple pattern match
Packit Service a31ea6
    XML_PATTERN_XPATH = 1 : standard XPath pattern
Packit Service a31ea6
    XML_PATTERN_XSSEL = 2 : XPath subset for schema selector
Packit Service a31ea6
    XML_PATTERN_XSFIELD = 4 : XPath subset for schema field
Packit Service a31ea6
}
Packit Service a31ea6

Structure xmlStreamCtxt

Structure xmlStreamCtxt
struct _xmlStreamCtxt {
Packit Service a31ea6
The content of this structure is not made public by the API.
Packit Service a31ea6
}

Function: xmlFreePattern

void	xmlFreePattern			(xmlPatternPtr comp)
Packit Service a31ea6

Free up the memory allocated by @comp

Packit Service a31ea6
<tt>comp</tt>:an XSLT comp

Function: xmlFreePatternList

void	xmlFreePatternList		(xmlPatternPtr comp)
Packit Service a31ea6

Free up the memory allocated by all the elements of @comp

Packit Service a31ea6
<tt>comp</tt>:an XSLT comp list

Function: xmlFreeStreamCtxt

void	xmlFreeStreamCtxt		(xmlStreamCtxtPtr stream)
Packit Service a31ea6

Free the stream context

Packit Service a31ea6
<tt>stream</tt>:the stream context

Function: xmlPatternFromRoot

int	xmlPatternFromRoot		(xmlPatternPtr comp)
Packit Service a31ea6

Check if the pattern must be looked at from the root.

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>Returns</tt>:1 if true, 0 if false and -1 in case of error

Function: xmlPatternGetStreamCtxt

xmlStreamCtxtPtr	xmlPatternGetStreamCtxt	(xmlPatternPtr comp)
Packit Service a31ea6

Get a streaming context for that pattern Use xmlFreeStreamCtxt to free the context.

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>Returns</tt>:a pointer to the context or NULL in case of failure

Function: xmlPatternMatch

int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)
Packit Service a31ea6

Test whether the node matches the pattern

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>node</tt>:a node
<tt>Returns</tt>:1 if it matches, 0 if it doesn't and -1 in case of failure

Function: xmlPatternMaxDepth

int	xmlPatternMaxDepth		(xmlPatternPtr comp)
Packit Service a31ea6

Check the maximum depth reachable by a pattern

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>Returns</tt>:-2 if no limit (using //), otherwise the depth, and -1 in case of error

Function: xmlPatternMinDepth

int	xmlPatternMinDepth		(xmlPatternPtr comp)
Packit Service a31ea6

Check the minimum depth reachable by a pattern, 0 mean the / or . are part of the set.

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>Returns</tt>:-1 in case of error otherwise the depth,

Function: xmlPatternStreamable

int	xmlPatternStreamable		(xmlPatternPtr comp)
Packit Service a31ea6

Check if the pattern is streamable i.e. xmlPatternGetStreamCtxt() should work.

Packit Service a31ea6
<tt>comp</tt>:the precompiled pattern
<tt>Returns</tt>:1 if streamable, 0 if not and -1 in case of error.

Function: xmlPatterncompile

xmlPatternPtr	xmlPatterncompile	(const xmlChar * pattern, 
xmlDict * dict,
int flags,
const xmlChar ** namespaces)
Packit Service a31ea6

Compile a pattern.

Packit Service a31ea6
<tt>pattern</tt>:the pattern to compile
<tt>dict</tt>:an optional dictionary for interned strings
<tt>flags</tt>:compilation flags, see xmlPatternFlags
<tt>namespaces</tt>:the prefix definitions, array of [URI, prefix] or NULL
<tt>Returns</tt>:the compiled form of the pattern or NULL in case of error

Function: xmlStreamPop

int	xmlStreamPop			(xmlStreamCtxtPtr stream)
Packit Service a31ea6

push one level from the stream.

Packit Service a31ea6
<tt>stream</tt>:the stream context
<tt>Returns</tt>:-1 in case of error, 0 otherwise.

Function: xmlStreamPush

int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
Packit Service a31ea6

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.

Packit Service a31ea6
<tt>stream</tt>:the stream context
<tt>name</tt>:the current name
<tt>ns</tt>:the namespace name
<tt>Returns</tt>:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

Function: xmlStreamPushAttr

int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
Packit Service a31ea6

Push new attribute 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 attribute-node.

Packit Service a31ea6
<tt>stream</tt>:the stream context
<tt>name</tt>:the current name
<tt>ns</tt>:the namespace name
<tt>Returns</tt>:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

Function: xmlStreamPushNode

int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns,
int nodeType)
Packit Service a31ea6

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.

Packit Service a31ea6
<tt>stream</tt>:the stream context
<tt>name</tt>:the current name
<tt>ns</tt>:the namespace name
<tt>nodeType</tt>:the type of the node being pushed
<tt>Returns</tt>:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

Function: xmlStreamWantsAnyNode

int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)
Packit Service a31ea6

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.

Packit Service a31ea6
<tt>streamCtxt</tt>:the stream context
<tt>Returns</tt>:1 in case of need of nodes of the above described types, 0 otherwise. -1 on API errors.

Daniel Veillard

</body></html>