1 /* 2 * Summary: implementation of XInclude 3 * Description: API to handle XInclude processing, 4 * implements the 5 * World Wide Web Consortium Last Call Working Draft 10 November 2003 6 * http://www.w3.org/TR/2003/WD-xinclude-20031110 7 * 8 * Copy: See Copyright for the status of this software. 9 * 10 * Author: Daniel Veillard 11 */ 12 13 #ifndef __XML_XINCLUDE_H__ 14 #define __XML_XINCLUDE_H__ 15 16 #include <libxml/xmlversion.h> 17 #include <libxml/xmlerror.h> 18 #include <libxml/tree.h> 19 #include <libxml/parser.h> 20 21 #ifdef LIBXML_XINCLUDE_ENABLED 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 /** 28 * XINCLUDE_NS: 29 * 30 * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude 31 */ 32 #define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude" 33 /** 34 * XINCLUDE_OLD_NS: 35 * 36 * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude 37 */ 38 #define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude" 39 /** 40 * XINCLUDE_NODE: 41 * 42 * Macro defining "include" 43 */ 44 #define XINCLUDE_NODE (const xmlChar *) "include" 45 /** 46 * XINCLUDE_FALLBACK: 47 * 48 * Macro defining "fallback" 49 */ 50 #define XINCLUDE_FALLBACK (const xmlChar *) "fallback" 51 /** 52 * XINCLUDE_HREF: 53 * 54 * Macro defining "href" 55 */ 56 #define XINCLUDE_HREF (const xmlChar *) "href" 57 /** 58 * XINCLUDE_PARSE: 59 * 60 * Macro defining "parse" 61 */ 62 #define XINCLUDE_PARSE (const xmlChar *) "parse" 63 /** 64 * XINCLUDE_PARSE_XML: 65 * 66 * Macro defining "xml" 67 */ 68 #define XINCLUDE_PARSE_XML (const xmlChar *) "xml" 69 /** 70 * XINCLUDE_PARSE_TEXT: 71 * 72 * Macro defining "text" 73 */ 74 #define XINCLUDE_PARSE_TEXT (const xmlChar *) "text" 75 /** 76 * XINCLUDE_PARSE_ENCODING: 77 * 78 * Macro defining "encoding" 79 */ 80 #define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding" 81 /** 82 * XINCLUDE_PARSE_XPOINTER: 83 * 84 * Macro defining "xpointer" 85 */ 86 #define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer" 87 88 typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; 89 typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; 90 91 /* 92 * standalone processing 93 */ 94 XMLPUBFUN int 95 xmlXIncludeProcess (xmlDocPtr doc); 96 XMLPUBFUN int 97 xmlXIncludeProcessFlags (xmlDocPtr doc, 98 int flags); 99 XMLPUBFUN int 100 xmlXIncludeProcessFlagsData(xmlDocPtr doc, 101 int flags, 102 void *data); 103 XMLPUBFUN int 104 xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree, 105 int flags, 106 void *data); 107 XMLPUBFUN int 108 xmlXIncludeProcessTree (xmlNodePtr tree); 109 XMLPUBFUN int 110 xmlXIncludeProcessTreeFlags(xmlNodePtr tree, 111 int flags); 112 /* 113 * contextual processing 114 */ 115 XMLPUBFUN xmlXIncludeCtxtPtr 116 xmlXIncludeNewContext (xmlDocPtr doc); 117 XMLPUBFUN int 118 xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt, 119 int flags); 120 XMLPUBFUN void 121 xmlXIncludeSetErrorHandler(xmlXIncludeCtxtPtr ctxt, 122 xmlStructuredErrorFunc handler, 123 void *data); 124 XMLPUBFUN void 125 xmlXIncludeSetResourceLoader(xmlXIncludeCtxtPtr ctxt, 126 xmlResourceLoader loader, 127 void *data); 128 XMLPUBFUN int 129 xmlXIncludeGetLastError (xmlXIncludeCtxtPtr ctxt); 130 XMLPUBFUN void 131 xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt); 132 XMLPUBFUN int 133 xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt, 134 xmlNodePtr tree); 135 #ifdef __cplusplus 136 } 137 #endif 138 139 #endif /* LIBXML_XINCLUDE_ENABLED */ 140 141 #endif /* __XML_XINCLUDE_H__ */ 142