codekingpro/portable-devtools
116k
1/*2 * Summary: pattern expression handling3 * Description: allows to compile and test pattern expressions for nodes4 * either in a tree or based on a parser state.5 *6 * Copy: See Copyright for the status of this software.7 *8 * Author: Daniel Veillard9 */10 11#ifndef __XML_PATTERN_H__12#define __XML_PATTERN_H__13 14#include <libxml/xmlversion.h>15#include <libxml/tree.h>16#include <libxml/dict.h>17 18#ifdef LIBXML_PATTERN_ENABLED19 20#ifdef __cplusplus21extern "C" {22#endif23 24/**25 * xmlPattern:26 *27 * A compiled (XPath based) pattern to select nodes28 */29typedef struct _xmlPattern xmlPattern;30typedef xmlPattern *xmlPatternPtr;31 32/**33 * xmlPatternFlags:34 *35 * This is the set of options affecting the behaviour of pattern36 * matching with this module37 *38 */39typedef enum {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 */44} xmlPatternFlags;45 46XMLPUBFUN void47 xmlFreePattern (xmlPatternPtr comp);48 49XMLPUBFUN void50 xmlFreePatternList (xmlPatternPtr comp);51 52XMLPUBFUN xmlPatternPtr53 xmlPatterncompile (const xmlChar *pattern,54 xmlDict *dict,55 int flags,56 const xmlChar **namespaces);57XMLPUBFUN int58 xmlPatternMatch (xmlPatternPtr comp,59 xmlNodePtr node);60 61/* streaming interfaces */62typedef struct _xmlStreamCtxt xmlStreamCtxt;63typedef xmlStreamCtxt *xmlStreamCtxtPtr;64 65XMLPUBFUN int66 xmlPatternStreamable (xmlPatternPtr comp);67XMLPUBFUN int68 xmlPatternMaxDepth (xmlPatternPtr comp);69XMLPUBFUN int70 xmlPatternMinDepth (xmlPatternPtr comp);71XMLPUBFUN int72 xmlPatternFromRoot (xmlPatternPtr comp);73XMLPUBFUN xmlStreamCtxtPtr74 xmlPatternGetStreamCtxt (xmlPatternPtr comp);75XMLPUBFUN void76 xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);77XMLPUBFUN int78 xmlStreamPushNode (xmlStreamCtxtPtr stream,79 const xmlChar *name,80 const xmlChar *ns,81 int nodeType);82XMLPUBFUN int83 xmlStreamPush (xmlStreamCtxtPtr stream,84 const xmlChar *name,85 const xmlChar *ns);86XMLPUBFUN int87 xmlStreamPushAttr (xmlStreamCtxtPtr stream,88 const xmlChar *name,89 const xmlChar *ns);90XMLPUBFUN int91 xmlStreamPop (xmlStreamCtxtPtr stream);92XMLPUBFUN int93 xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream);94#ifdef __cplusplus95}96#endif97 98#endif /* LIBXML_PATTERN_ENABLED */99 100#endif /* __XML_PATTERN_H__ */101 