Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:41:49

0001 /*
0002  * Summary: pattern expression handling
0003  * Description: allows to compile and test pattern expressions for nodes
0004  *              either in a tree or based on a parser state.
0005  *
0006  * Copy: See Copyright for the status of this software.
0007  *
0008  * Author: Daniel Veillard
0009  */
0010 
0011 #ifndef __XML_PATTERN_H__
0012 #define __XML_PATTERN_H__
0013 
0014 #include <libxml/xmlversion.h>
0015 #include <libxml/tree.h>
0016 #include <libxml/dict.h>
0017 
0018 #ifdef LIBXML_PATTERN_ENABLED
0019 
0020 #ifdef __cplusplus
0021 extern "C" {
0022 #endif
0023 
0024 /**
0025  * xmlPattern:
0026  *
0027  * A compiled (XPath based) pattern to select nodes
0028  */
0029 typedef struct _xmlPattern xmlPattern;
0030 typedef xmlPattern *xmlPatternPtr;
0031 
0032 /**
0033  * xmlPatternFlags:
0034  *
0035  * This is the set of options affecting the behaviour of pattern
0036  * matching with this module
0037  *
0038  */
0039 typedef enum {
0040     XML_PATTERN_DEFAULT     = 0,    /* simple pattern match */
0041     XML_PATTERN_XPATH       = 1<<0, /* standard XPath pattern */
0042     XML_PATTERN_XSSEL       = 1<<1, /* XPath subset for schema selector */
0043     XML_PATTERN_XSFIELD     = 1<<2  /* XPath subset for schema field */
0044 } xmlPatternFlags;
0045 
0046 XMLPUBFUN void
0047             xmlFreePattern      (xmlPatternPtr comp);
0048 
0049 XMLPUBFUN void
0050             xmlFreePatternList  (xmlPatternPtr comp);
0051 
0052 XMLPUBFUN xmlPatternPtr
0053             xmlPatterncompile   (const xmlChar *pattern,
0054                          xmlDict *dict,
0055                          int flags,
0056                          const xmlChar **namespaces);
0057 XMLPUBFUN int
0058             xmlPatternCompileSafe   (const xmlChar *pattern,
0059                          xmlDict *dict,
0060                          int flags,
0061                          const xmlChar **namespaces,
0062                          xmlPatternPtr *patternOut);
0063 XMLPUBFUN int
0064             xmlPatternMatch     (xmlPatternPtr comp,
0065                          xmlNodePtr node);
0066 
0067 /* streaming interfaces */
0068 typedef struct _xmlStreamCtxt xmlStreamCtxt;
0069 typedef xmlStreamCtxt *xmlStreamCtxtPtr;
0070 
0071 XMLPUBFUN int
0072             xmlPatternStreamable    (xmlPatternPtr comp);
0073 XMLPUBFUN int
0074             xmlPatternMaxDepth  (xmlPatternPtr comp);
0075 XMLPUBFUN int
0076             xmlPatternMinDepth  (xmlPatternPtr comp);
0077 XMLPUBFUN int
0078             xmlPatternFromRoot  (xmlPatternPtr comp);
0079 XMLPUBFUN xmlStreamCtxtPtr
0080             xmlPatternGetStreamCtxt (xmlPatternPtr comp);
0081 XMLPUBFUN void
0082             xmlFreeStreamCtxt   (xmlStreamCtxtPtr stream);
0083 XMLPUBFUN int
0084             xmlStreamPushNode   (xmlStreamCtxtPtr stream,
0085                          const xmlChar *name,
0086                          const xmlChar *ns,
0087                          int nodeType);
0088 XMLPUBFUN int
0089             xmlStreamPush       (xmlStreamCtxtPtr stream,
0090                          const xmlChar *name,
0091                          const xmlChar *ns);
0092 XMLPUBFUN int
0093             xmlStreamPushAttr   (xmlStreamCtxtPtr stream,
0094                          const xmlChar *name,
0095                          const xmlChar *ns);
0096 XMLPUBFUN int
0097             xmlStreamPop        (xmlStreamCtxtPtr stream);
0098 XMLPUBFUN int
0099             xmlStreamWantsAnyNode   (xmlStreamCtxtPtr stream);
0100 #ifdef __cplusplus
0101 }
0102 #endif
0103 
0104 #endif /* LIBXML_PATTERN_ENABLED */
0105 
0106 #endif /* __XML_PATTERN_H__ */