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 28 extern "C" { 29 #endif 30 31 /* 32 * A Location Set 33 */ 34 typedef struct _xmlLocationSet xmlLocationSet; 35 typedef xmlLocationSet *xmlLocationSetPtr; 36 struct _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 46 XMLPUBFUN xmlLocationSetPtr XMLCALL 47 xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); 48 XMLPUBFUN void XMLCALL 49 xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); 50 XMLPUBFUN xmlLocationSetPtr XMLCALL 51 xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, 52 xmlLocationSetPtr val2); 53 XMLPUBFUN xmlXPathObjectPtr XMLCALL 54 xmlXPtrNewRange (xmlNodePtr start, 55 int startindex, 56 xmlNodePtr end, 57 int endindex); 58 XMLPUBFUN xmlXPathObjectPtr XMLCALL 59 xmlXPtrNewRangePoints (xmlXPathObjectPtr start, 60 xmlXPathObjectPtr end); 61 XMLPUBFUN xmlXPathObjectPtr XMLCALL 62 xmlXPtrNewRangeNodePoint (xmlNodePtr start, 63 xmlXPathObjectPtr end); 64 XMLPUBFUN xmlXPathObjectPtr XMLCALL 65 xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, 66 xmlNodePtr end); 67 XMLPUBFUN xmlXPathObjectPtr XMLCALL 68 xmlXPtrNewRangeNodes (xmlNodePtr start, 69 xmlNodePtr end); 70 XMLPUBFUN xmlXPathObjectPtr XMLCALL 71 xmlXPtrNewLocationSetNodes (xmlNodePtr start, 72 xmlNodePtr end); 73 XMLPUBFUN xmlXPathObjectPtr XMLCALL 74 xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); 75 XMLPUBFUN xmlXPathObjectPtr XMLCALL 76 xmlXPtrNewRangeNodeObject (xmlNodePtr start, 77 xmlXPathObjectPtr end); 78 XMLPUBFUN xmlXPathObjectPtr XMLCALL 79 xmlXPtrNewCollapsedRange (xmlNodePtr start); 80 XMLPUBFUN void XMLCALL 81 xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, 82 xmlXPathObjectPtr val); 83 XMLPUBFUN xmlXPathObjectPtr XMLCALL 84 xmlXPtrWrapLocationSet (xmlLocationSetPtr val); 85 XMLPUBFUN void XMLCALL 86 xmlXPtrLocationSetDel (xmlLocationSetPtr cur, 87 xmlXPathObjectPtr val); 88 XMLPUBFUN void XMLCALL 89 xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, 90 int val); 91 92 /* 93 * Functions. 94 */ 95 XMLPUBFUN xmlXPathContextPtr XMLCALL 96 xmlXPtrNewContext (xmlDocPtr doc, 97 xmlNodePtr here, 98 xmlNodePtr origin); 99 XMLPUBFUN xmlXPathObjectPtr XMLCALL 100 xmlXPtrEval (const xmlChar *str, 101 xmlXPathContextPtr ctx); 102 XMLPUBFUN void XMLCALL 103 xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, 104 int nargs); 105 XMLPUBFUN xmlNodePtr XMLCALL 106 xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); 107 XMLPUBFUN void XMLCALL 108 xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); 109 #ifdef __cplusplus 110 } 111 #endif 112 113 #endif /* LIBXML_XPTR_ENABLED */ 114 #endif /* __XML_XPTR_H__ */ 115