# ## Module pattern from libxml2

API Menu
Main Menu Developer Menu Code Examples API Menu Parser API Tree API Reader API XML Guidelines ChangeLog
API Indexes
Alphabetic Constructors Functions/Types Modules Symbols
Related links
Mail archive XSLT libxslt DOM gdome2 XML-DSig xmlsec FTP Windows binaries Solaris binaries MacOsX binaries Pascal bindings Bug Tracker
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.
    Typedef xmlPattern * xmlPatternPtr
    void	xmlFreePattern			(xmlPatternPtr comp)
    void	xmlFreePatternList		(xmlPatternPtr comp)
    int	xmlPatternMatch			(xmlPatternPtr comp,
    					 xmlNodePtr node)
    xmlPatternPtr	xmlPatterncompile	(const xmlChar * pattern,
    					 xmlDict * dict,
    					 int flags,
    					 const xmlChar ** namespaces)
## Description ### Structure xmlPattern
    Structure xmlPattern
    struct _xmlPattern {
    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: xmlPatternMatch
    int	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: xmlPatterncompile
    xmlPatternPtr	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
Daniel Veillard