1/*
2 * 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
7 *
8 * Added support for the element() scheme described in:
9 * W3C Proposed Recommendation 13 November 2002
10 * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
11 *
12 * Copy: See Copyright for the status of this software.
13 *
14 * Author: Daniel Veillard
15 */
16
17#ifndef __XML_XPTR_H__
18#define __XML_XPTR_H__
19
20#include <libxml/xmlversion.h>
21
22#ifdef LIBXML_XPTR_ENABLED
23
24#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/*
43 * Handling of location sets.
44 */
45
46XMLPUBFUN xmlLocationSetPtr XMLCALL
47 xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
48XMLPUBFUN void XMLCALL
49 xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
50XMLPUBFUN xmlLocationSetPtr XMLCALL
51 xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
52 xmlLocationSetPtr val2);
53XMLPUBFUN xmlXPathObjectPtr XMLCALL
54 xmlXPtrNewRange (xmlNodePtr start,
55 int startindex,
56 xmlNodePtr end,
57 int endindex);
58XMLPUBFUN xmlXPathObjectPtr XMLCALL
59 xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
60 xmlXPathObjectPtr end);
61XMLPUBFUN xmlXPathObjectPtr XMLCALL
62 xmlXPtrNewRangeNodePoint (xmlNodePtr start,
63 xmlXPathObjectPtr end);
64XMLPUBFUN xmlXPathObjectPtr XMLCALL
65 xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
66 xmlNodePtr end);
67XMLPUBFUN xmlXPathObjectPtr XMLCALL
68 xmlXPtrNewRangeNodes (xmlNodePtr start,
69 xmlNodePtr end);
70XMLPUBFUN xmlXPathObjectPtr XMLCALL
71 xmlXPtrNewLocationSetNodes (xmlNodePtr start,
72 xmlNodePtr end);
73XMLPUBFUN xmlXPathObjectPtr XMLCALL
74 xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
75XMLPUBFUN xmlXPathObjectPtr XMLCALL
76 xmlXPtrNewRangeNodeObject (xmlNodePtr start,
77 xmlXPathObjectPtr end);
78XMLPUBFUN xmlXPathObjectPtr XMLCALL
79 xmlXPtrNewCollapsedRange (xmlNodePtr start);
80XMLPUBFUN void XMLCALL
81 xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
82 xmlXPathObjectPtr val);
83XMLPUBFUN xmlXPathObjectPtr XMLCALL
84 xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
85XMLPUBFUN void XMLCALL
86 xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
87 xmlXPathObjectPtr val);
88XMLPUBFUN void XMLCALL
89 xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
90 int val);
91
92/*
93 * Functions.
94 */
95XMLPUBFUN xmlXPathContextPtr XMLCALL
96 xmlXPtrNewContext (xmlDocPtr doc,
97 xmlNodePtr here,
98 xmlNodePtr origin);
99XMLPUBFUN xmlXPathObjectPtr XMLCALL
100 xmlXPtrEval (const xmlChar *str,
101 xmlXPathContextPtr ctx);
102XMLPUBFUN void XMLCALL
103 xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
104 int nargs);
105XMLPUBFUN xmlNodePtr XMLCALL
106 xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
107XMLPUBFUN void XMLCALL
108 xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
109#ifdef __cplusplus
110}
111#endif
112
113#endif /* LIBXML_XPTR_ENABLED */
114#endif /* __XML_XPTR_H__ */
115