2003-12-02 22:32:15 +00: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 12:08:10 +00:00
# ifdef LIBXML_PATTERN_ENABLED
2003-12-02 22:32:15 +00: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 18:12:28 +00: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 ;
2003-12-02 22:32:15 +00:00
XMLPUBFUN void XMLCALL
xmlFreePattern ( xmlPatternPtr comp ) ;
XMLPUBFUN void XMLCALL
xmlFreePatternList ( xmlPatternPtr comp ) ;
XMLPUBFUN xmlPatternPtr XMLCALL
xmlPatterncompile ( const xmlChar * pattern ,
2003-12-05 14:57:46 +00:00
xmlDict * dict ,
2005-07-23 15:00:22 +00:00
int flags ,
2003-12-05 16:10:21 +00:00
const xmlChar * * namespaces ) ;
2003-12-02 22:32:15 +00:00
XMLPUBFUN int XMLCALL
xmlPatternMatch ( xmlPatternPtr comp ,
xmlNodePtr node ) ;
2005-01-30 18:42:55 +00:00
/* streaming interfaces */
typedef struct _xmlStreamCtxt xmlStreamCtxt ;
typedef xmlStreamCtxt * xmlStreamCtxtPtr ;
2005-02-16 00:22:29 +00:00
XMLPUBFUN int XMLCALL
xmlPatternStreamable ( xmlPatternPtr comp ) ;
XMLPUBFUN int XMLCALL
xmlPatternMaxDepth ( xmlPatternPtr comp ) ;
2005-09-04 12:01:57 +00:00
XMLPUBFUN int XMLCALL
xmlPatternMinDepth ( xmlPatternPtr comp ) ;
2005-02-16 00:22:29 +00:00
XMLPUBFUN int XMLCALL
xmlPatternFromRoot ( xmlPatternPtr comp ) ;
2005-01-30 18:42:55 +00:00
XMLPUBFUN xmlStreamCtxtPtr XMLCALL
xmlPatternGetStreamCtxt ( xmlPatternPtr comp ) ;
XMLPUBFUN void XMLCALL
xmlFreeStreamCtxt ( xmlStreamCtxtPtr stream ) ;
2006-01-05 12:30:43 +00:00
XMLPUBFUN int XMLCALL
xmlStreamPushNode ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ,
int nodeType ) ;
2005-01-30 18:42:55 +00:00
XMLPUBFUN int XMLCALL
xmlStreamPush ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ) ;
2005-02-17 21:34:45 +00:00
XMLPUBFUN int XMLCALL
xmlStreamPushAttr ( xmlStreamCtxtPtr stream ,
const xmlChar * name ,
const xmlChar * ns ) ;
2005-01-30 18:42:55 +00:00
XMLPUBFUN int XMLCALL
xmlStreamPop ( xmlStreamCtxtPtr stream ) ;
2006-01-05 12:30:43 +00:00
XMLPUBFUN int XMLCALL
xmlStreamWantsAnyNode ( xmlStreamCtxtPtr stream ) ;
2003-12-02 22:32:15 +00:00
# ifdef __cplusplus
}
# endif
2004-06-27 12:08:10 +00:00
# endif /* LIBXML_PATTERN_ENABLED */
2003-12-02 22:32:15 +00:00
# endif /* __XML_PATTERN_H__ */