2003-12-03 01:32:15 +03:00
/*
* Summary : pattern expression handling
* Description : allows to compile and test pattern expressions for nodes
* either in a tree or based on a parser state .
*
* Copy : See Copyright for the status of this software .
*
* Author : Daniel Veillard
*/
# ifndef __XML_PATTERN_H__
# define __XML_PATTERN_H__
# include <libxml/xmlversion.h>
# include <libxml/tree.h>
# include <libxml/dict.h>
2004-06-27 16:08:10 +04:00
# ifdef LIBXML_PATTERN_ENABLED
2003-12-03 01:32:15 +03:00
# ifdef __cplusplus
extern " C " {
# endif
/**
* xmlPattern :
*
* A compiled ( XPath based ) pattern to select nodes
*/
typedef struct _xmlPattern xmlPattern ;
typedef xmlPattern * xmlPatternPtr ;
2005-06-09 22:12:28 +04:00
/**
* xmlPatternFlags :
*
* This is the set of options affecting the behaviour of pattern
* matching with this module
*
*/
typedef enum {
XML_PATTERN_DEFAULT = 0 , /* simple pattern match */
XML_PATTERN_XPATH = 1 < < 0 , /* standard XPath pattern */
XML_PATTERN_XSSEL = 1 < < 1 , /* XPath subset for schema selector */
XML_PATTERN_XSFIELD = 1 < < 2 /* XPath subset for schema field */
} xmlPatternFlags ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN void
2003-12-03 01:32:15 +03:00
xmlFreePattern ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN void
2003-12-03 01:32:15 +03:00
xmlFreePatternList ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN xmlPatternPtr
2003-12-03 01:32:15 +03:00
xmlPatterncompile ( const xmlChar * pattern ,
2003-12-05 17:57:46 +03:00
xmlDict * dict ,
2005-07-23 19:00:22 +04:00
int flags ,
2003-12-05 19:10:21 +03:00
const xmlChar * * namespaces ) ;
2023-12-10 17:30:47 +03:00
XMLPUBFUN int
xmlPatternCompileSafe ( const xmlChar * pattern ,
xmlDict * dict ,
int flags ,
const xmlChar * * namespaces ,
xmlPatternPtr * patternOut ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2003-12-03 01:32:15 +03:00
xmlPatternMatch ( xmlPatternPtr comp ,
xmlNodePtr node ) ;
2005-01-30 21:42:55 +03:00
/* streaming interfaces */
typedef struct _xmlStreamCtxt xmlStreamCtxt ;
typedef xmlStreamCtxt * xmlStreamCtxtPtr ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-02-16 03:22:29 +03:00
xmlPatternStreamable ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-02-16 03:22:29 +03:00
xmlPatternMaxDepth ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-09-04 16:01:57 +04:00
xmlPatternMinDepth ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-02-16 03:22:29 +03:00
xmlPatternFromRoot ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN xmlStreamCtxtPtr
2005-01-30 21:42:55 +03:00
xmlPatternGetStreamCtxt ( xmlPatternPtr comp ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN void
2005-01-30 21:42:55 +03:00
xmlFreeStreamCtxt ( xmlStreamCtxtPtr stream ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2006-01-05 15:30:43 +03:00
xmlStreamPushNode ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ,
int nodeType ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-01-30 21:42:55 +03:00
xmlStreamPush ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-02-18 00:34:45 +03:00
xmlStreamPushAttr ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2005-01-30 21:42:55 +03:00
xmlStreamPop ( xmlStreamCtxtPtr stream ) ;
2022-12-08 04:48:27 +03:00
XMLPUBFUN int
2006-01-05 15:30:43 +03:00
xmlStreamWantsAnyNode ( xmlStreamCtxtPtr stream ) ;
2003-12-03 01:32:15 +03:00
# ifdef __cplusplus
}
# endif
2004-06-27 16:08:10 +04:00
# endif /* LIBXML_PATTERN_ENABLED */
2003-12-03 01:32:15 +03:00
# endif /* __XML_PATTERN_H__ */