blob: b99112b87a108dcc5154be5fcf4d0e53c55b8a6e [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: API to handle XML Pointers
3 * Description: API to handle XML Pointers
4 * Base implementation was made accordingly to
5 * W3C Candidate Recommendation 7 June 2000
6 * http://www.w3.org/TR/2000/CR-xptr-20000607
Owen Taylor3473f882001-02-23 17:55:21 +00007 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * Added support for the element() scheme described in:
9 * W3C Proposed Recommendation 13 November 2002
Daniel Veillardf8e3db02012-09-11 13:26:36 +080010 * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
Owen Taylor3473f882001-02-23 17:55:21 +000011 *
Daniel Veillardbe586972003-11-18 20:56:51 +000012 * Copy: See Copyright for the status of this software.
Owen Taylor3473f882001-02-23 17:55:21 +000013 *
Daniel Veillardbe586972003-11-18 20:56:51 +000014 * Author: Daniel Veillard
Owen Taylor3473f882001-02-23 17:55:21 +000015 */
16
17#ifndef __XML_XPTR_H__
18#define __XML_XPTR_H__
19
Igor Zlatkovic76874e42003-08-25 09:05:12 +000020#include <libxml/xmlversion.h>
Daniel Veillarda2351322004-06-27 12:08:10 +000021
22#ifdef LIBXML_XPTR_ENABLED
23
Owen Taylor3473f882001-02-23 17:55:21 +000024#include <libxml/tree.h>
25#include <libxml/xpath.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/*
32 * A Location Set
33 */
34typedef struct _xmlLocationSet xmlLocationSet;
35typedef xmlLocationSet *xmlLocationSetPtr;
36struct _xmlLocationSet {
37 int locNr; /* number of locations in the set */
38 int locMax; /* size of the array as allocated */
39 xmlXPathObjectPtr *locTab;/* array of locations */
40};
41
42/*
Daniel Veillard61f26172002-03-12 18:46:39 +000043 * Handling of location sets.
Owen Taylor3473f882001-02-23 17:55:21 +000044 */
45
Daniel Veillardf8e3db02012-09-11 13:26:36 +080046XMLPUBFUN xmlLocationSetPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000047 xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080048XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000049 xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080050XMLPUBFUN xmlLocationSetPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000051 xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
Owen Taylor3473f882001-02-23 17:55:21 +000052 xmlLocationSetPtr val2);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080053XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000054 xmlXPtrNewRange (xmlNodePtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000055 int startindex,
56 xmlNodePtr end,
57 int endindex);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080058XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000059 xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000060 xmlXPathObjectPtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080061XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000062 xmlXPtrNewRangeNodePoint (xmlNodePtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000063 xmlXPathObjectPtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080064XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000065 xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000066 xmlNodePtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080067XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000068 xmlXPtrNewRangeNodes (xmlNodePtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000069 xmlNodePtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080070XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000071 xmlXPtrNewLocationSetNodes (xmlNodePtr start,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000072 xmlNodePtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080073XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000074 xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080075XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000076 xmlXPtrNewRangeNodeObject (xmlNodePtr start,
Daniel Veillard9e7160d2001-03-18 23:17:47 +000077 xmlXPathObjectPtr end);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080078XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000079 xmlXPtrNewCollapsedRange (xmlNodePtr start);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080080XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000081 xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
Daniel Veillard9e7160d2001-03-18 23:17:47 +000082 xmlXPathObjectPtr val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080083XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000084 xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080085XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000086 xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000087 xmlXPathObjectPtr val);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080088XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000089 xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
Daniel Veillard56a4cb82001-03-24 17:00:36 +000090 int val);
Owen Taylor3473f882001-02-23 17:55:21 +000091
92/*
Daniel Veillard61f26172002-03-12 18:46:39 +000093 * Functions.
Owen Taylor3473f882001-02-23 17:55:21 +000094 */
Daniel Veillardf8e3db02012-09-11 13:26:36 +080095XMLPUBFUN xmlXPathContextPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000096 xmlXPtrNewContext (xmlDocPtr doc,
Owen Taylor3473f882001-02-23 17:55:21 +000097 xmlNodePtr here,
98 xmlNodePtr origin);
Daniel Veillardf8e3db02012-09-11 13:26:36 +080099XMLPUBFUN xmlXPathObjectPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000100 xmlXPtrEval (const xmlChar *str,
Owen Taylor3473f882001-02-23 17:55:21 +0000101 xmlXPathContextPtr ctx);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800102XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000103 xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800104 int nargs);
105XMLPUBFUN xmlNodePtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000106 xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800107XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +0000108 xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
Owen Taylor3473f882001-02-23 17:55:21 +0000109#ifdef __cplusplus
110}
111#endif
Daniel Veillarda2351322004-06-27 12:08:10 +0000112
113#endif /* LIBXML_XPTR_ENABLED */
Owen Taylor3473f882001-02-23 17:55:21 +0000114#endif /* __XML_XPTR_H__ */