/usr/share/doc/libxml2-devel/html
NameSizeModeActions
book1.html96350644editdlrm
home.png6540644editdlrm
index.html96350644editdlrm
left.png4590644editdlrm
libxml-c14n.html180560644editdlrm
libxml-catalog.html410210644editdlrm
libxml-chvalid.html184230644editdlrm
libxml-debugXML.html379110644editdlrm
libxml-dict.html179450644editdlrm
libxml-DOCBparser.html206250644editdlrm
libxml-encoding.html350320644editdlrm
libxml-entities.html276890644editdlrm
libxml-globals.html330880644editdlrm
libxml-hash.html473760644editdlrm
libxml-HTMLparser.html600720644editdlrm
libxml-HTMLtree.html286380644editdlrm
libxml-lib.html96350644editdlrm
libxml-list.html300730644editdlrm
libxml-nanoftp.html270900644editdlrm
libxml-nanohttp.html212240644editdlrm
libxml-parser.html1467670644editdlrm
libxml-parserInternals.html1225140644editdlrm
libxml-pattern.html236730644editdlrm
libxml-relaxng.html410020644editdlrm
libxml-SAX.html434820644editdlrm
libxml-SAX2.html444490644editdlrm
libxml-schemasInternals.html640400644editdlrm
libxml-schematron.html217320644editdlrm
libxml-threads.html171610644editdlrm
libxml-tree.html2356560644editdlrm
libxml-uri.html226780644editdlrm
libxml-valid.html1024590644editdlrm
libxml-xinclude.html197050644editdlrm
libxml-xlink.html216460644editdlrm
libxml-xmlautomata.html395740644editdlrm
libxml-xmlerror.html1097020644editdlrm
libxml-xmlexports.html78550644editdlrm
libxml-xmlIO.html639630644editdlrm
libxml-xmlmemory.html292270644editdlrm
libxml-xmlmodule.html117130644editdlrm
libxml-xmlreader.html1142270644editdlrm
libxml-xmlregexp.html457810644editdlrm
libxml-xmlsave.html192490644editdlrm
libxml-xmlschemas.html477710644editdlrm
libxml-xmlschemastypes.html493760644editdlrm
libxml-xmlstring.html391580644editdlrm
libxml-xmlunicode.html1128520644editdlrm
libxml-xmlversion.html206290644editdlrm
libxml-xmlwriter.html1174800644editdlrm
libxml-xpath.html650420644editdlrm
libxml-xpathInternals.html1432220644editdlrm
libxml-xpointer.html299750644editdlrm
right.png4720644editdlrm
up.png4060644editdlrm
Edit: /usr/share/doc/libxml2-devel/html/libxml-pattern.html (23673B)
Module pattern from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module pattern from libxml2

API Menu
API Indexes
Related links

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 The content of this structure is not made public by the API.
Enum xmlPatternFlags
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)
int	xmlPatternFromRoot		(xmlPatternPtr comp)
xmlStreamCtxtPtr	xmlPatternGetStreamCtxt	(xmlPatternPtr comp)
int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)
int	xmlPatternMaxDepth		(xmlPatternPtr comp)
int	xmlPatternMinDepth		(xmlPatternPtr comp)
int	xmlPatternStreamable		(xmlPatternPtr comp)
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)
int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns,
int nodeType)
int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)

Description

Structure xmlPattern

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

Enum xmlPatternFlags

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

Structure xmlStreamCtxt

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

Function: xmlFreePattern

void	xmlFreePattern			(xmlPatternPtr comp)

Free up the memory allocated by @comp

comp:an XSLT comp

Function: xmlFreePatternList

void	xmlFreePatternList		(xmlPatternPtr comp)

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

comp:an XSLT comp list

Function: xmlFreeStreamCtxt

void	xmlFreeStreamCtxt		(xmlStreamCtxtPtr stream)

Free the stream context

stream:the stream context

Function: xmlPatternFromRoot

int	xmlPatternFromRoot		(xmlPatternPtr comp)

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

comp:the precompiled pattern
Returns:1 if true, 0 if false and -1 in case of error

Function: xmlPatternGetStreamCtxt

xmlStreamCtxtPtr	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: xmlPatternMatch

int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)

Test whether 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: xmlPatternMaxDepth

int	xmlPatternMaxDepth		(xmlPatternPtr comp)

Check the maximum depth reachable by a pattern

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

Function: xmlPatternMinDepth

int	xmlPatternMinDepth		(xmlPatternPtr comp)

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

comp:the precompiled pattern
Returns:-1 in case of error otherwise the depth,

Function: xmlPatternStreamable

int	xmlPatternStreamable		(xmlPatternPtr comp)

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

comp:the precompiled pattern
Returns: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)

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
Returns:the compiled form of the pattern or NULL in case of error

Function: xmlStreamPop

int	xmlStreamPop			(xmlStreamCtxtPtr stream)

push one level from the stream.

stream:the stream context
Returns:-1 in case of error, 0 otherwise.

Function: xmlStreamPush

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

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
Returns:-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)

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.

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.

Function: xmlStreamPushNode

int	xmlStreamPushNode		(xmlStreamCtxtPtr 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
Returns:-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)

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
Returns:1 in case of need of nodes of the above described types, 0 otherwise. -1 on API errors.

Daniel Veillard