2 * Summary: pattern expression handling
3 * Description: allows to compile and test pattern expressions for nodes
4 * either in a tree or based on a parser state.
6 * Copy: See Copyright for the status of this software.
8 * Author: Daniel Veillard
11 #ifndef __XML_PATTERN_H__
12 #define __XML_PATTERN_H__
14 #include <libxml/xmlversion.h>
15 #include <libxml/tree.h>
16 #include <libxml/dict.h>
18 #ifdef LIBXML_PATTERN_ENABLED
27 * A compiled (XPath based) pattern to select nodes
29 typedef struct _xmlPattern xmlPattern;
30 typedef xmlPattern *xmlPatternPtr;
35 * This is the set of options affecting the behaviour of pattern
36 * matching with this module
40 XML_PATTERN_DEFAULT = 0, /* simple pattern match */
41 XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */
42 XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */
43 XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */
46 XMLPUBFUN void XMLCALL
47 xmlFreePattern (xmlPatternPtr comp);
49 XMLPUBFUN void XMLCALL
50 xmlFreePatternList (xmlPatternPtr comp);
52 XMLPUBFUN xmlPatternPtr XMLCALL
53 xmlPatterncompile (const xmlChar *pattern,
56 const xmlChar **namespaces);
58 xmlPatternMatch (xmlPatternPtr comp,
61 /* streaming interfaces */
62 typedef struct _xmlStreamCtxt xmlStreamCtxt;
63 typedef xmlStreamCtxt *xmlStreamCtxtPtr;
66 xmlPatternStreamable (xmlPatternPtr comp);
68 xmlPatternMaxDepth (xmlPatternPtr comp);
70 xmlPatternMinDepth (xmlPatternPtr comp);
72 xmlPatternFromRoot (xmlPatternPtr comp);
73 XMLPUBFUN xmlStreamCtxtPtr XMLCALL
74 xmlPatternGetStreamCtxt (xmlPatternPtr comp);
75 XMLPUBFUN void XMLCALL
76 xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
78 xmlStreamPushNode (xmlStreamCtxtPtr stream,
83 xmlStreamPush (xmlStreamCtxtPtr stream,
87 xmlStreamPushAttr (xmlStreamCtxtPtr stream,
91 xmlStreamPop (xmlStreamCtxtPtr stream);
93 xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);
98 #endif /* LIBXML_PATTERN_ENABLED */
100 #endif /* __XML_PATTERN_H__ */